Config Map

Config map template for enabling add-ons:

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-{{ .Values.addon.id}}-{{ .Values.addon.version}}-configmap
labels:
icpdata_addon: "true"
data:
add-ons.json: |
{ "{{ .Values.addon.id }}":{ "details":{ "openURL":"{{ .Values.addon.openUrl }}" }, "versions":{ "{{ .Values.addon.version }}":{ "state":"enabled" } } } }

Deployment notes:

Requirements:

1. config map must be deployed as a helm release. This will ensure add-on enablement can be simply removed by deleting the helm release.
2. config map must contain correct add-on id to be able to match the existing placeholder add-on tile. This add-on id will be provided by IBM on-boarding team
3. openURL link should point to an already externally exposed service. On OpenShift platform service can be exposed by creating a route with a command like this:
How to expose service:
oc expose service <service-name> [--name=<route-name] by default the exposed URL will have the form of: http://<route-name>[-<namespace>].<suffix> where <suffix> is public hostname of the cluster To get the list of routes and exposed URLs run: oc get routes More on exposing services can be found here: https://docs.openshift.com/containerplatform/3.11/architecture/networking/routes.html#route-hostnames
To deploy the config map:
1. If you’re already using helm charts to deploy your service offering simply add the config map template to your existing helm charts.
2. If you are currently not using helm charts to deploy your offering you need to package the config map template as a standalone helm chart:
à helm create <chart-name>
à place contents of the above mentioned config map template in <chart-name>/templates/enable-addon-config.yaml
3. Install the chart ensuring the required parameters for addon.id, addon.version and addon.openURL are supplied either via values.yaml or command line arguments, for example: helm install -n <release-name> ./<chart-name> --set addon.version=<version-number> --set addon.openUrl=<absolute-URL-of-the-exposed-service> --set addon.id=<addon-id> --tls
Reverting add-on tile to non-enabled status: Deleting helm release should revert add-on tile to previous state, that is, the Enabled badge will be removed and the Open link will be replaced with "Getting Started" link.