From c83cd437c49e7850a7c1b092186455f92788db12 Mon Sep 17 00:00:00 2001 From: vivekr-splunk Date: Fri, 12 Jan 2024 11:59:05 -0800 Subject: [PATCH] doc changes Signed-off-by: vivekr-splunk --- .../workflows/build-test-push-workflow.yml | 7 ++++++- docs/SplunkOperatorUpgrade.md | 20 +++++++++---------- pkg/splunk/enterprise/indexercluster.go | 3 --- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-test-push-workflow.yml b/.github/workflows/build-test-push-workflow.yml index 409b70cbe..f87fc8635 100644 --- a/.github/workflows/build-test-push-workflow.yml +++ b/.github/workflows/build-test-push-workflow.yml @@ -134,7 +134,12 @@ jobs: fail-fast: false matrix: test: [ - managerappframeworkc3t, + basic, + appframeworks1, + managerappframeworkc3, + managerappframeworkm4, + managersecret, + managermc, ] runs-on: ubuntu-latest env: diff --git a/docs/SplunkOperatorUpgrade.md b/docs/SplunkOperatorUpgrade.md index c63ecd03b..76e7ca4c1 100644 --- a/docs/SplunkOperatorUpgrade.md +++ b/docs/SplunkOperatorUpgrade.md @@ -1,6 +1,6 @@ # How to upgrade Splunk Operator and Splunk Enterprise Deployments -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-namespace.yaml` ([see below](#upgrading-splunk-operator-and-splunk-operator-deployment)) 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. +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-namespace.yaml` ([see below](#upgrading-splunk-operator-and-splunk-operator-deployment)) 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. ​ @@ -10,7 +10,7 @@ A Splunk Operator for Kubernetes upgrade might include support for a later versi ​ * Before you upgrade, review the Splunk Operator [change log](https://github.com/splunk/splunk-operator/releases) page for information on changes made in the latest release. The Splunk Enterprise Docker image compatibility is noted in each release version. ​ -* If the Splunk Enterprise Docker image changes, review the Splunk Enterprise [Upgrade Readme](https://docs.splunk.com/Documentation/Splunk/latest/Installation/AboutupgradingREADTHISFIRST) page before upgrading. +* If the Splunk Enterprise Docker image changes, review the Splunk Enterprise [Upgrade Readme](https://docs.splunk.com/Documentation/Splunk/latest/Installation/AboutupgradingREADTHISFIRST) page before upgrading. ​ * For general information about Splunk Enterprise compatibility and the upgrade process, see [How to upgrade Splunk Enterprise](https://docs.splunk.com/Documentation/Splunk/latest/Installation/HowtoupgradeSplunk). ​ @@ -44,11 +44,11 @@ NAME READY STATUS RESTARTS splunk-operator-controller-manager-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 changes the custom resource (CRD) API version, the administrator is responsible for updating their Custom Resource specification to reference the latest CRD API version. ### Upgrading Splunk Enterprise Docker Image with the Operator Upgrade -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 follow the best practices described under the [General Process to Upgrade the Splunk Enterprise], a recommeded upgrade path is followed while initiating pod restarts of different Splunk Instances. At each step, if a particular CR instance exists, a certain flow is imposed to ensure that each instance is updated in the correct order. After an instance is upgraded, the Operator verifies if the upgrade was successful and all the components are working as expected. If any unexpected behaviour is detected, the process is terminated. +Splunk Operator follows the upgrade path steps mentioned in [Splunk documentation](https://docs.splunk.com/Documentation/Splunk/9.1.2/Installation/HowtoupgradeSplunk). 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 follow the best practices described under the [General Process to Upgrade the Splunk Enterprise], a recommeded upgrade path is followed while initiating pod restarts of different Splunk Instances. At each step, if a particular CR instance exists, a certain flow is imposed to ensure that each instance is updated in the correct order. After an instance is upgraded, the Operator verifies if the upgrade was successful and all the components are working as expected. If any unexpected behaviour is detected, the process is terminated. ## Steps to Upgrade from 1.0.5 or older version to latest @@ -131,7 +131,7 @@ imagePullPolicy: IfNotPresent ```bash kubectl get pod -o yaml | grep -i image image: docker.io/splunk/splunk-operator: -imagePullPolicy: IfNotPresent +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: @@ -146,10 +146,10 @@ imagePullPolicy: IfNotPresent 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: ​ 1. A new Splunk Operator pod will be created, and the existing operator pod will be terminated. -2. Any existing License Manager, Search Head, Deployer, ClusterManager, Standalone pods will be terminated to be redeployed with the upgraded spec. -3. The termination and redeployment of the pods happen in a particular order based on a recommended upgrade path. -4. After a ClusterManager pod is restarted, the Indexer Cluster pods which are connected to it are terminated and redeployed. -5. After all pods in the Indexer cluster and Search head cluster are redeployed, the Monitoring Console pod is terminated and redeployed. -6. Each pod upgrade is verified to ensure the process was successful and everything is working as expected. +3. Any existing License Manager, Standalone, Monitoring console, Cluster manager, Search Head, ClusterManager, Indexer pods will be terminated to be redeployed with the upgraded spec. +4. Splunk Operator follows the upgrade path steps mentioned in Splunk documentation. The termination and redeployment of the pods happen in a particular order based on a recommended upgrade path. +5. After a ClusterManager pod is restarted, the Indexer Cluster pods which are connected to it are terminated and redeployed. +6. After all pods in the Indexer cluster and Search head cluster are redeployed, the Monitoring Console pod is terminated and redeployed. +7. Each pod upgrade is verified to ensure the process was successful and everything is working as expected. * Note: If there are multiple pods per Custom Resource, the pods are terminated and re-deployed in a descending order with the highest numbered pod going first diff --git a/pkg/splunk/enterprise/indexercluster.go b/pkg/splunk/enterprise/indexercluster.go index df98bc42c..39200f8d7 100644 --- a/pkg/splunk/enterprise/indexercluster.go +++ b/pkg/splunk/enterprise/indexercluster.go @@ -1097,7 +1097,6 @@ func RetrieveCMSpec(ctx context.Context, client splcommon.ControllerClient, cr * func getIndexerClusterSortedSiteList(ctx context.Context, c splcommon.ControllerClient, ref corev1.ObjectReference, indexerList enterpriseApi.IndexerClusterList) (enterpriseApi.IndexerClusterList, error) { namespaceList := enterpriseApi.IndexerClusterList{} - for _, v := range indexerList.Items { if v.Spec.ClusterManagerRef == ref { namespaceList.Items = append(namespaceList.Items, v) @@ -1141,7 +1140,6 @@ func (mgr *indexerClusterPodManager) isIndexerClusterReadyForUpgrade(ctx context // get the clusterManagerRef attached to the instance clusterManagerRef := cr.Spec.ClusterManagerRef - if mgr.c == nil { mgr.c = c } @@ -1162,7 +1160,6 @@ func (mgr *indexerClusterPodManager) isIndexerClusterReadyForUpgrade(ctx context sortedList, err := getIndexerClusterSortedSiteList(ctx, c, cr.Spec.ClusterManagerRef, indexerList) preIdx := enterpriseApi.IndexerCluster{} - for i, v := range sortedList.Items { if &v == cr { if i > 0 {