Control Plane Profiles

Control Plane Profiles

Profiles allow a cluster administrator to create reusable configurations that users may extend with their own customizations. Profiles may also inherit from other profiles. As an example, if there are two teams with different control planes, say an accounting team and a website team with a development and production configuration, then there could be a profile called development and one called production. Individual profile would be created for the accounting and development teams that extend these two configurations with their own customizations. Individual deployments can further customize these configurations. For additional extensibility, multiple profiles can be inherited in a single profile.

graph LR; Base --> Default Default --> Production Default --> Development Development --> Accounting_Development Development --> Website_Development Production --> Accounting_Production Production --> Website_Production Accounting_Development --> A[User SMCP]

Profiles follow the same configuration as a ServiceMeshControlPlane so if you get a ServiceMeshControlPlane working, you can then include it as a profiles. To add custom profiles, create a ConfigMap called smcp-templates in the openshift-operators project. This ConfigMap will contain a collection of profiles to use. The ConfigMap must then be mounted in the operator at /usr/local/share/istio-operator/templates/.

Creating the ConfigMap

To create the ConfigMap, execute the following as a cluster administrator, substituting <profiles-directory> for a directory containing a collection of ServiceMeshControlPlane files to use as profiles. The name of the profiles will match the name of the file. Templates will inherit from other profiles until a profile is reached which has an empty profile field. Using a profile name of default will override the default profile for all control planes when no profile is specified in a control plane.

To create a profile, save a ServiceMeshControlPlane in a directory referred to as <profiles-directory>. Follow the instructions below to create and configure a ConfigMap containing this new profile. Additional profiles can be added to the ConfigMap as desired.

$ oc create configmap --from-file=<profiles-directory> smcp-templates -n openshift-operators

Next, find the Maistra operator ClusterServiceVersion name.

$ oc get clusterserviceversion -n openshift-operators | grep 'Service Mesh'
maistra.v2.0.0.1            Red Hat OpenShift Service Mesh   2.0.0-1                Succeeded

Edit the ClusterServiceVersion to instruct the operator to use the smcp-templates ConfigMap.

$ oc edit clusterserviceversion -n openshift-operators servicemeshoperator.v2.0.0.1

In the editor, add a volume mount and volume to the deployments as shown below.

 deployments:
    - name: istio-operator
      spec:
        template:
          spec:
            containers:
              volumeMounts:
                - name: smcp-templates
                  mountPath: /usr/local/share/istio-operator/templates/
            volumes:
              - name: smcp-templates
                configMap:
                  name: smcp-templates
  ...

You can now use profiles in your ServiceMeshControlPlane by adding a profile parameter to the ServiceMeshControlPlane. In the example below, we are including the default profile, but you can use any profile from the smcp-templates ConfigMap as well.

apiVersion: maistra.io/v2
kind: ServiceMeshControlPlane
metadata:
  name: minimal-install
spec:
   profiles:
   - default