Upgrade the Splunk Operator using manifest files
Upgrade the Splunk Operator to the latest version using a manifest file.
Upgrading the Splunk Operator replaces the currently installed release with the latest version by applying an updated manifest file. Because the Splunk Operator does not support downgrading to a previous release, review your target version carefully before you upgrade.
Applying the latest splunk-operator-cluster.yaml or splunk-operator-namespace.yaml manifest updates the CRDs and Operator deployment, and applies the new spec to the pods the Operator manages. If the upgrade includes a newer Splunk Enterprise Docker image, the Operator also restarts those pods. For the restart order and behavior, see Splunk Operator upgrade behavior and order.
To upgrade using Helm instead, see Upgrade the Splunk Operator using Helm.
Prerequisites
- Before you upgrade, review the Splunk Operator change log, which notes Splunk Enterprise Docker image compatibility for each release.
- If the Docker image changes, review the Upgrade Readme and How to upgrade Splunk Enterprise for compatibility and upgrade guidance.
- If you use forwarders, verify version compatibility in Compatibility between forwarders and Splunk Enterprise indexers.
- Verify whether your manifest is cluster-wide or namespace-scoped by checking the
WATCH_NAMESPACEenvironment variable in the runningsplunk-operator-controller-managerdeployment. An empty value means splunk-operator-cluster.yaml is in use; a value naming one or more namespaces means splunk-operator-namespace.yaml is in use.
Apply the updated Splunk Operator manifest file
Upgrade the Splunk Operator by applying an updated manifest file.
Download the latest Splunk Operator installation YAML and apply it to upgrade your deployment.
Verify the upgrade by checking the operator and Splunk Enterprise image versions.
To verify that the Splunk Operator upgrade applied the release image in splunk-operator-install.yaml, check the version of the operator image in the deployment spec and the image in the 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, check the version of the image:
kubectl get pods splunk-<crname>-monitoring-console-0 -o yaml | grep -i image
image: splunk/splunk:9.4.0
imagePullPolicy: IfNotPresent
Splunk Operator upgrade configuration
Configuration requirements for Splunk Operator upgrades.
When you upgrade the Splunk Operator, review and update configuration for the Splunk General Terms acceptance and the namespaces the Operator watches.
Configure the operator to accept the Splunk General Terms
Starting with Operator version 3.0.0, which includes support for Splunk Enterprise version 10.x, an additional Docker-Splunk specific parameter is required to start containers.
Starting in 10.x image versions of Splunk Enterprise, license acceptance requires an additional SPLUNK_GENERAL_TERMS=--accept-sgt-current-at-splunk-com argument. This indicates that users have read and accepted the current version of the Splunk General Terms, available at Splunk General Terms.
Read and make sure you agree to the Splunk General Terms before you access or use this software. Only after doing so should you include the --accept-sgt-current-at-splunk-com flag to indicate your acceptance.
By default, the SPLUNK_GENERAL_TERMS environment variable is set to an empty string. You must either:
- Manually update it to have the required value
--accept-sgt-current-at-splunk-comin thesplunk-operator-controller-managerdeployment. - Pass the
SPLUNK_GENERAL_TERMSparameter with the required value to the make deploy command. - Update the value in the Splunk Operator installation file from the release on GitHub.
...
env:
- name: WATCH_NAMESPACE
value: "splunk-operator"
- name: RELATED_IMAGE_SPLUNK_ENTERPRISE
value: splunk/splunk:9.4.0
- name: OPERATOR_NAME
value: splunk-operator
- name: SPLUNK_GENERAL_TERMS
value: "--accept-sgt-current-at-splunk-com"
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
...
Configure the operator to watch a specific namespace
If the Splunk Operator is installed cluster-wide, edit the splunk-operator-controller-manager deployment in the splunk-operator namespace and set the WATCH_NAMESPACE field to the namespace that the Splunk Operator needs to monitor:
...
env:
- name: WATCH_NAMESPACE
value: "splunk-operator"
- name: RELATED_IMAGE_SPLUNK_ENTERPRISE
value: splunk/splunk:9.4.0
- name: OPERATOR_NAME
value: splunk-operator
- name: SPLUNK_GENERAL_TERMS
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
...
If a Splunk Operator release includes an updated Splunk Enterprise Docker image, the operator upgrade also initiates pod restart using the latest Splunk Enterprise Docker image.
Splunk Operator upgrade behavior
Expected behavior and processing order when the Splunk Operator upgrades Splunk Enterprise deployments.
The Splunk Operator follows a defined behavior and processing order when it upgrades Splunk Enterprise deployments.
Upgrading the Splunk Enterprise Docker image with the Operator upgrade
The Splunk Operator follows the upgrade path described in the Splunk documentation, restarting pods with the latest Splunk Enterprise Docker image when a release includes one. For each existing CR instance, the Operator applies a specific flow to upgrade instances in order, verifies that each upgrade succeeded, and terminates the process if it detects unexpected behavior.
If a Splunk Operator release changes the custom resource (CRD) API version, the administrator is responsible for updating the Custom Resource specification to reference the latest CRD API version.
Splunk Enterprise cluster upgrade order
The Splunk Operator deletes and redeploys custom resource pods sequentially, redeploying multi-zone Indexer clusters zone by zone. For a Custom Resource with multiple pods, the Operator terminates and redeploys them in descending order, highest-numbered pod first.
When both the Operator version and the Splunk Enterprise Docker image are upgraded, pod termination and redeployment follow this order:
- Splunk Operator deployment pod
- Standalone
- License manager
- ClusterManager
- Search Head cluster
- Indexer Cluster
- Monitoring Console