Skip to content

Commit 188e7c6

Browse files
CSPL-4005: Remove CRDs from splunk/splunk-operator helm chart (#1579)
* remove crds from helm chart, needs documentation * add documentation about adding CRDs before helm chart installation * repackage helm charts * cleanup helm test workflow
1 parent 9c31567 commit 188e7c6

31 files changed

+90
-55235
lines changed

.github/workflows/automated-release-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- name: Create Release
9191
uses: ncipollo/release-action@40bb172bd05f266cf9ba4ff965cb61e9ee5f6d01
9292
with:
93-
artifacts: "release-${{ github.event.inputs.release_version }}/splunk-operator-cluster.yaml,release-${{ github.event.inputs.release_version }}/splunk-operator-namespace.yaml"
93+
artifacts: "release-${{ github.event.inputs.release_version }}/splunk-operator-cluster.yaml,release-${{ github.event.inputs.release_version }}/splunk-operator-namespace.yaml,release-${{ github.event.inputs.release_version }}/splunk-operator-crds.yaml"
9494
bodyFile: "docs/ReleaseNotes.md"
9595
tag: "${{ github.event.inputs.release_version }}"
9696
draft: true

.github/workflows/helm-test-workflow.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ jobs:
169169
- name: install k8s dashboard
170170
run: |
171171
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml
172+
- name: Setup Kustomize
173+
run: |
174+
sudo snap install kustomize
175+
mkdir -p ./bin
176+
cp /snap/bin/kustomize ./bin/kustomize
177+
- name: Install CRDs on cluster
178+
run: |
179+
make install
172180
- name: Add splunk helm repo for main branch
173181
if: github.ref == 'refs/heads/main'
174182
run: |

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,12 @@ generate-artifacts-cluster: manifests kustomize ## Deploy controller to the K8s
372372
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
373373
RELATED_IMAGE_SPLUNK_ENTERPRISE=${SPLUNK_ENTERPRISE_IMAGE} WATCH_NAMESPACE=${WATCH_NAMESPACE} SPLUNK_GENERAL_TERMS=${SPLUNK_GENERAL_TERMS} $(KUSTOMIZE) build config/default > release-${VERSION}/splunk-operator-cluster.yaml
374374

375-
generate-artifacts: generate-artifacts-namespace generate-artifacts-cluster
375+
376+
generate-crds: manifests kustomize ## Generate CRD artifacts
377+
mkdir -p release-${VERSION}
378+
$(KUSTOMIZE) build config/crd > release-${VERSION}/splunk-operator-crds.yaml
379+
380+
generate-artifacts: generate-artifacts-namespace generate-artifacts-cluster generate-crds
376381
echo "artifacts generation complete"
377382

378383
#############################

docs/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* CSPL-3867: SHC and CM Error Message Visibility
1313
* CSPL-3186: Upgrade Enterprise Security Version 8.0.2
1414
* 1559: Added SplunkGeneralTerms acceptance
15+
* CSPL-4005: Remove CRDs from splunk/splunk-operator helm chart
1516

1617
### Supported Splunk Version
1718

docs/Helm.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ helm repo update
1111

1212
The ```splunk``` chart repository contains the ```splunk/splunk-operator``` chart to deploy the Splunk Operator and the ```splunk/splunk-enterprise``` chart to deploy Splunk Enterprise custom resources.
1313

14-
Upgrading to latest version of splunk operator using helm chart will not upgrade CRDs. User need to deploy the latest CRDs manually. this is [limitation](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) from helm
14+
Users need to deploy the latest CRDs manually. This is a [limitation](https://helm.sh/docs/chart_best_practices/custom_resource_definitions/) from helm. The ```splunk/splunk-operator``` chart no longer contains the CRDs to install on the first deployment due to the size of the CRDs. Helm has a chart size [limit of 1MB](https://helm.sh/docs/topics/advanced/#sql-storage-backend) due to internal limits in Kubernetes' underlying etcd key-value store, and the Splunk Operator for Kubernetes CRDs are too big to fit into the helm chart to deploy the operator. To install the CRDs for the first time, or to update the CRDs to the latest versions, follow one of the following steps.
1515

1616
```
1717
git clone https://github.com/splunk/splunk-operator.git .
18-
git checkout release/2.8.1
18+
git checkout release/3.0.0
1919
make install
2020
```
2121

22+
OR
23+
24+
```
25+
kubectl apply -f https://github.com/splunk/splunk-operator/releases/download/3.0.0/splunk-operator-crds.yaml --server-side
26+
```
27+
2228
Helm provides a long list of commands to manage your deployment, we'll be going over a few useful ones in the sections to come. You can learn more about supported commands [here](https://helm.sh/docs/helm/helm/).
2329

2430
## Splunk Operator deployments
@@ -35,7 +41,7 @@ There are a couple ways you can configure your operator deployment
3541

3642
1. Using a ```new_values.yaml``` file to override default values (Recommended)
3743
```
38-
helm install -f new_values.yaml --set installCRDs=true <RELEASE_NAME> splunk/splunk-operator -n <RELEASE_NAMESPACE>
44+
helm install -f new_values.yaml <RELEASE_NAME> splunk/splunk-operator -n <RELEASE_NAMESPACE>
3945
```
4046

4147
2. Using the Helm CLI directly to set new values
@@ -46,7 +52,7 @@ helm install --set <KEY>=<VALUE> <RELEASE_NAME> splunk/splunk-operator -n <RELEA
4652
If the release already exists, we can use ```helm upgrade``` to configure and upgrade the deployment using a file or the CLI directly as above.
4753

4854
```
49-
helm upgrade -f new_values.yaml --set installCRDs=true <RELEASE_NAME> splunk/splunk-operator -n <RELEASE_NAMESPACE>
55+
helm upgrade -f new_values.yaml <RELEASE_NAME> splunk/splunk-operator -n <RELEASE_NAMESPACE>
5056
```
5157

5258
Read more about configuring values [here](https://helm.sh/docs/intro/using_helm/).
@@ -74,7 +80,7 @@ The ```helm list``` command can be used to retrieve all deployed releases.
7480

7581
By default, the Splunk Operator has cluster-wide access. Let's upgrade the ```splunk-operator-test``` release by revoking cluster-wide access:
7682
```
77-
helm upgrade --set splunkOperator.clusterWideAccess=false --set installCRDs=true splunk-operator-test splunk/splunk-operator -n splunk-operator
83+
helm upgrade --set splunkOperator.clusterWideAccess=false splunk-operator-test splunk/splunk-operator -n splunk-operator
7884
```
7985
```
8086
NAME: splunk-operator-test
@@ -100,7 +106,7 @@ helm dependency build splunk/splunk-enterprise
100106
```
101107
If the operator is already installed then you will need to disable the dependency:
102108
```
103-
helm install --set splunk-operator.enabled=false --set installCRDs=true <RELEASE_NAME> splunk/splunk-enterprise -n <RELEASE_NAMESPACE>
109+
helm install --set splunk-operator.enabled=false <RELEASE_NAME> splunk/splunk-enterprise -n <RELEASE_NAMESPACE>
104110
```
105111
Installing ```splunk/splunk-enterprise``` will deploy Splunk Enterprise custom resources according to your configuration, the following ```new_values.yaml``` file specifies override configurations to deploy a Cluster Manager, an Indexer Cluster and a Search Head Cluster.
106112

@@ -124,7 +130,7 @@ helm show values splunk/splunk-enterprise
124130

125131
To install a Splunk Enterprise deployment according to our configurations above:
126132
```
127-
helm install --set installCRDs=true -f new_values.yaml splunk-enterprise-test splunk/splunk-enterprise -n splunk-operator
133+
helm install -f new_values.yaml splunk-enterprise-test splunk/splunk-enterprise -n splunk-operator
128134
```
129135
```
130136
NAME: splunk-enterprise-test
@@ -156,6 +162,17 @@ release "splunk-enterprise-test" uninstalled
156162

157163
Note: Helm by default does not cleanup Custom Resource Definitions and Persistent Volume Claims. Splunk Admin needs to manually clean them.
158164

165+
### Troubleshooting Splunk Enterprise Deployments
166+
167+
#### CRDs are not installed
168+
If you attempt to install a Splunk Enterprise deployment, and there is an error that says:
169+
```
170+
Error: INSTALLATION FAILED: unable to build kubernetes objects from release manifest: resource mapping not found for name: "release-name" namespace: "release-namespace" from "": no matches for kind "Standalone" in version "enterprise.splunk.com/v4"
171+
ensure CRDs are installed first
172+
```
173+
174+
Verify that the CRDs have been installed with the instructions at the [top of this documentation](#splunk-operator-helm-chart-repository).
175+
159176
## Splunk Validated Architecture deployments
160177

161178
The Splunk Enterprise chart has support for three Splunk Validated Architectures:
@@ -166,6 +183,6 @@ The Splunk Enterprise chart has support for three Splunk Validated Architectures
166183

167184
Install a Standalone deployment using the following command:
168185
```
169-
helm install --set s1.enabled=true --set installCRDs=true <RELEASE_NAME> splunk/splunk-enterprise -n <RELEASE_NAMESPACE>
186+
helm install --set s1.enabled=true <RELEASE_NAME> splunk/splunk-enterprise -n <RELEASE_NAMESPACE>
170187
```
171188
Visit the Splunk Operator github repository to learn more about the configurable values of [splunk/splunk-operator](https://github.com/splunk/splunk-operator/blob/develop/helm-chart/splunk-operator/values.yaml) and [splunk/splunk-enterprise](https://github.com/splunk/splunk-operator/blob/develop/helm-chart/splunk-enterprise/values.yaml).

docs/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ splunk-operator-75f5d4d85b-8pshn 1/1 Running 0 5s
136136

137137
### Installation using Helm charts
138138

139-
Installing the Splunk Operator using Helm allows you to quickly deploy the operator and Splunk Enterprise in a Kubernetes cluster. The operator and custom resources are easily configurable allowing for advanced installations including support for Splunk Validated Architectures. Helm also provides a number of features to manage the operator and custom resource lifecycle. The [Installation using Helm](Helm.md) page will walk you through installing and configuring Splunk Enterprise deployments using Helm charts.
139+
Installing the Splunk Operator using Helm allows you to quickly deploy the operator and Splunk Enterprise in a Kubernetes cluster. The operator is easily configurable allowing for advanced installations including support for Splunk Validated Architectures. Helm also provides a number of features to manage the operator lifecycle. The [Installation using Helm](Helm.md) page will walk you through installing and configuring Splunk Enterprise deployments using Helm charts.
140+
141+
Splunk Operator CRDs are not deployed as part of the helm installation. Users need to deploy the latest CRDs manually. See the [Installation using Helm](Helm.md) documentation on how to deploy the CRDs before installing the helm charts.
140142

141143
## Upgrading the Splunk Operator
142144

docs/SplunkGeneralTermsMigration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ make deploy IMG=docker.io/splunk/splunk-operator:<tag name> SPLUNK_GENERAL_TERMS
4343
```
4444
3. Set the value in a `helm install` command
4545
```
46-
helm install -f new_values.yaml --set installCRDs=true --set splunkOperator.splunkGeneralTerms="[required value]" <RELEASE_NAME> splunk/splunk-operator -n <RELEASE_NAMESPACE>
46+
helm install -f new_values.yaml --set splunkOperator.splunkGeneralTerms="[required value]" <RELEASE_NAME> splunk/splunk-operator -n <RELEASE_NAMESPACE>
4747
```
4848
4. Edit the splunk-operator-controller-manager deployment after it is deployed
4949
```

0 commit comments

Comments
 (0)