DG Kubernetes Operators


I’m sure if you are into Kubernetes/OCP you already played with those bundles of Go automation scripts called operators. If you haven’t that’s pretty cool stuff in the sense of automating the deployment, some operators cover the whole deployment life and as usual, if a pod or a resource is different than the spec, on the status, it will self adjust – for instance it will pop up another pod if the number of pods is different than the operator settings.

What is interesting about this, I would say for DevOps teams is the facility to deploy applications/start EAP/DG/SSO with the operators. As soon as you download one from OperatorHub in OCP for instance, and install in your respective project (given you have storage setup) the deployment is complete seamlessly, only the namespace is will need to be known before hand.

Depending on the operator you can have more or less features, like seemly upgrade up to complete autopilot.

I think it is amazing how powerful it is, with a few oc apply using some templates one can spawn a complete cluster very easily: oc apply rhdg-setup.yaml -f –, where the template defines a namespace for the operator, a namespace for the pods, the operator itself (subscription and OperatorGroup) and the cluster itself:

- apiVersion: operators.coreos.com/v1 <--- api version
  kind: OperatorGroup          <----- OperatorGroup
    name: datagrid
    namespace: ${OPERATOR_NAMESPACE}
- apiVersion: operators.coreos.com/v1alpha1
  kind: Subscription            <----- Subscription
    name: datagrid-operator
    namespace: ${OPERATOR_NAMESPACE} <---- the namespace
    channel: 8.2.x  <--- channel to fetch the operator, on this case channel 8.2.x instead of 8.1.x or 8.3.x
    installPlanApproval: Manual  <----- manual approval
    name: datagrid
    source: redhat-operators     <----- source
    sourceNamespace: openshift-marketplace <---- source namespace
    startingCSV: datagrid-operator.v8.2.8 <----- starting version

Above the fields are complete for subscription and operator group – as described here. Also the api version and so on defined here. It is very easy to add jvm flags or add routes, just do it in the custom resource, for instance infinispan or cache cr, and that’s all.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s