To upgrade the Splunk Operator for Kubernetes, you will overwrite the prior Operator release with the latest version. Once the lastest version of
splunk-operator-install.yaml (see below) is applied the CRD’s are updated and Operator deployment is updated with newer version of Splunk Operator image. Any new spec defined by the operator will be applied to the pods managed by Splunk Operator for Kubernetes.
A Splunk Operator for Kubernetes upgrade might include support for a later version of the Splunk Enterprise Docker image. In that scenario, after the Splunk Operator completes its upgrade, the pods managed by Splunk Operator for Kubernetes will be restarted using the latest Splunk Enterprise Docker image.
wget -O splunk-operator.yaml https://github.com/splunk/splunk-operator/releases/download/1.0.3/splunk-operator-install.yaml
kubectl apply -f splunk-operator.yaml
After applying the yaml, a new operator pod will be created and the existing operator pod will be terminated. Example:
kubectl get pods NAME READY STATUS RESTARTS AGE splunk-operator-75f5d4d85b-8pshn 1/1 Running 0 5s
If a Splunk Operator release changes the custom resource (CRD) API version, the administrator is responsible for updating their Custom Resource specification to reference the latest CRD API version.
If a Splunk Operator release includes an updated Splunk Enterprise Docker image, the operator upgrade will also initiate pod restart using the latest Splunk Enterprise Docker image.
To verify the Splunk Operator has been upgraded to the release image in
splunk-operator-install.yaml, you can check the version of the operator image in the deployment spec and subsequently the image in Pod spec of the newly deployed operator pod.
kubectl get deployment splunk-operator -o yaml | grep -i image image: docker.io/splunk/splunk-operator:<desired_operator_version> imagePullPolicy: IfNotPresent
kubectl get pod <splunk_operator_pod> -o yaml | grep -i image image: docker.io/splunk/splunk-operator:<desired_operator_version> imagePullPolicy: IfNotPresent
To verify that a new Splunk Enterprise Docker image was applied to a pod, you can check the version of the image. Example:
kubectl get pods splunk-default-monitoring-console-0 -o yaml | grep -i image image: splunk/splunk:8.1.2 imagePullPolicy: IfNotPresent image: splunk/splunk:8.1.2
This is an example of the process followed by the Splunk Operator if the operator version is upgraded and a later Splunk Enterprise Docker image is available: