Skip to content

Commit 7d7e2f2

Browse files
Merge pull request #1408 from splunk/promote-develop-to-main-2.7.0
Promote Develop to main for Splunk Operator Release 2.7.0
2 parents 219d89c + d1f1fac commit 7d7e2f2

File tree

144 files changed

+16535
-2270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+16535
-2270
lines changed

Diff for: .env

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ GO_VERSION=1.23.0
44
AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
55
KUBECTL_VERSION=v1.29.1
66
AZ_CLI_VERSION=2.30.0
7-
EKSCTL_VERSION=v0.143.0
8-
EKS_CLUSTER_K8_VERSION=1.27
9-
SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:9.3.0
7+
EKSCTL_VERSION=v0.191.0
8+
EKS_CLUSTER_K8_VERSION=1.31
9+
SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:9.3.2

Diff for: .github/workflows/build-test-push-workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
matrix:
166166
test: [
167167
basic,
168-
appframeworks1,
168+
appframeworksS1,
169169
managerappframeworkc3,
170170
managerappframeworkm4,
171171
managersecret,

Diff for: .github/workflows/int-test-azure-workflow.yml

+1-5
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ jobs:
3838
password: ${{ secrets.AZURE_ACR_DOCKER_PASSWORD }}
3939
- name: Make Splunk Operator Image
4040
run: |
41-
make docker-build IMG=${{ secrets.AZURE_ACR_LOGIN_SERVER }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
42-
- name: Push Splunk Operator Image to the Container Registry
43-
run: |
44-
echo "Uploading Image to the Container Registry :: ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA"
45-
make docker-push IMG=${{ secrets.AZURE_ACR_LOGIN_SERVER }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
41+
make docker-buildx IMG=${{ secrets.AZURE_ACR_LOGIN_SERVER }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
4642
setup-aks-cluster:
4743
runs-on: ubuntu-latest
4844
needs: build-operator-image

Diff for: .github/workflows/int-test-gcp-workflow.yml

+277
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
name: Integration Test on GCP Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
9+
jobs:
10+
build-operator-image:
11+
runs-on: ubuntu-latest
12+
env:
13+
SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }}
14+
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
15+
ARTIFACT_REGISTRY: ${{ secrets.GCP_ARTIFACT_REGISTRY }} # Updated for Artifact Registry
16+
steps:
17+
- name: Checkout Code
18+
uses: actions/checkout@v2
19+
20+
- name: Load Environment Variables
21+
id: dotenv
22+
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
23+
with:
24+
path: .env # Adjust the path if your dotenv file is located elsewhere
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/[email protected]
33+
34+
- name: Install Operator SDK
35+
run: |
36+
ARCH=$(case $(uname -m) in
37+
x86_64) echo -n amd64 ;;
38+
aarch64) echo -n arm64 ;;
39+
*) echo -n $(uname -m) ;;
40+
esac)
41+
OS=$(uname | awk '{print tolower($0)}')
42+
OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${{ steps.dotenv.outputs.OPERATOR_SDK_VERSION }}
43+
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
44+
chmod +x operator-sdk_${OS}_${ARCH}
45+
sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
46+
47+
- name: Authenticate to GCP
48+
uses: google-github-actions/auth@v1
49+
with:
50+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
51+
52+
- name: Login to GCR
53+
uses: docker/login-action@v3
54+
with:
55+
registry: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
56+
username: _json_key
57+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
58+
59+
- name: Build Splunk Operator Image
60+
run: |
61+
make docker-buildx IMG=${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
62+
63+
create-cluster-and-run-tests:
64+
strategy:
65+
matrix:
66+
test_focus:
67+
- { order: 1, name: "c3_gcp_sanity" }
68+
- { order: 2, name: "c3_mgr_gcp_sanity" }
69+
- { order: 3, name: "m4_gcp_sanity" }
70+
- { order: 4, name: "m4_mgr_gcp_sanity" }
71+
- { order: 5, name: "s1_gcp_sanity" }
72+
runs-on: ubuntu-latest
73+
needs: build-operator-image
74+
env:
75+
CLUSTER_WORKERS: 5
76+
TEST_CLUSTER_PLATFORM: gcp
77+
CLUSTER_PROVIDER: gcp
78+
ARTIFACT_REGISTRY: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
79+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
80+
GCP_REGION: ${{ secrets.GCP_REGION }}
81+
AWS_S3_REGION: ${{ secrets.GCP_REGION }}
82+
GCP_ZONE: ${{ secrets.GCP_ZONE }}
83+
GCP_NETWORK: default # Adjust if using a custom network
84+
GCP_SUBNETWORK: default # Adjust if using a custom subnetwork
85+
TEST_FOCUS: ${{ matrix.test_focus.name }}
86+
CLUSTER_NODES: 2
87+
SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }}
88+
SPLUNK_ENTERPRISE_RELEASE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}
89+
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
90+
SPLUNK_OPERATOR_IMAGE_FILENAME: splunk-operator
91+
TEST_TO_SKIP: "^(?:[^s]+|s(?:$|[^m]|m(?:$|[^o]|o(?:$|[^k]|k(?:$|[^e])))))*$"
92+
TEST_BUCKET: ${{ secrets.TEST_BUCKET }}
93+
TEST_S3_BUCKET: ${{ secrets.TEST_BUCKET }}
94+
TEST_INDEXES_S3_BUCKET: ${{ secrets.TEST_INDEXES_S3_BUCKET }}
95+
INDEXES_S3_BUCKET: ${{ secrets.TEST_INDEXES_S3_BUCKET }}
96+
GCP_ENTERPRISE_LICENSE_LOCATION: "test_licenses"
97+
ENTERPRISE_LICENSE_LOCATION: "test_licenses"
98+
ENTERPRISE_LICENSE_S3_PATH: "test_licenses"
99+
REGISTRY_REPOSITORY: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
100+
CLUSTER_WIDE: "true"
101+
GCP_SERVICE_ACCOUNT_ENABLED: "false"
102+
PRIVATE_REGISTRY: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
103+
GCP_STORAGE_ACCOUNT: ${{ secrets.GCP_STORAGE_ACCOUNT }}
104+
GCP_STORAGE_ACCOUNT_KEY: ${{ secrets.GCP_STORAGE_ACCOUNT_KEY }}
105+
GCP_TEST_CONTAINER: ${{ secrets.GCP_TEST_CONTAINER}}
106+
GCP_INDEXES_CONTAINER: ${{ secrets.GCP_INDEXES_CONTAINER}}
107+
ECR_REPOSITORY: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
108+
GCP_CONTAINER_REGISTRY_LOGIN_SERVER: ${{ secrets.AZURE_ACR_LOGIN_SERVER }}
109+
steps:
110+
- name: Set Test Cluster Name
111+
run: |
112+
echo "CLUSTER_NAME=gke-${{ matrix.test_focus.order }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
113+
echo "TEST_CLUSTER_NAME=gke-${{ matrix.test_focus.order }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
114+
- name: Checkout Code
115+
uses: actions/checkout@v2
116+
117+
- name: Load Environment Variables
118+
id: dotenv
119+
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
120+
with:
121+
path: .env
122+
123+
- name: Authenticate to GCP
124+
uses: google-github-actions/auth@v1
125+
with:
126+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
127+
128+
- name: Set up Cloud SDK
129+
uses: google-github-actions/setup-gcloud@v1
130+
with:
131+
project_id: ${{ secrets.GCP_PROJECT_ID }}
132+
install_components: 'kubectl'
133+
134+
- name: Set GCP Project
135+
run: |
136+
gcloud config set project ${{ env.GCP_PROJECT_ID }}
137+
138+
- name: Create GKE Cluster
139+
run: |
140+
export EKS_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
141+
export GKE_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
142+
make cluster-up
143+
144+
- name: Get Kubernetes Credentials
145+
run: |
146+
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.GCP_ZONE }} --project ${{ env.GCP_PROJECT_ID }}
147+
148+
- name: Allow Pulling from Artifact Registry
149+
run: |
150+
gcloud auth configure-docker ${{ secrets.GCP_ARTIFACT_REGISTRY }}
151+
152+
- name: Set up Cloud SDK
153+
uses: google-github-actions/setup-gcloud@v1
154+
with:
155+
project_id: ${{ secrets.GCP_PROJECT_ID }}
156+
install_components: 'kubectl'
157+
158+
- name: Change Splunk Enterprise Image on Main Branches
159+
if: github.ref == 'refs/heads/main'
160+
run: |
161+
echo "SPLUNK_ENTERPRISE_IMAGE=${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}" >> $GITHUB_ENV
162+
163+
- name: Authenticate to GCP
164+
uses: google-github-actions/auth@v1
165+
with:
166+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
167+
168+
- name: Set GCP Project
169+
run: |
170+
gcloud config set project ${{ env.GCP_PROJECT_ID }}
171+
172+
- name: Install Kubectl
173+
uses: azure/setup-kubectl@v3
174+
with:
175+
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
176+
177+
- name: Install Python
178+
uses: actions/setup-python@v2
179+
with:
180+
python-version: '3.x' # Specify the Python version if needed
181+
182+
- name: Setup Go
183+
uses: actions/setup-go@v2
184+
with:
185+
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
186+
187+
- name: Install Go Lint
188+
run: |
189+
go version
190+
go install golang.org/x/lint/golint@latest
191+
192+
- name: Install Ginkgo
193+
run: |
194+
make setup/ginkgo
195+
196+
- name: Set up Docker Buildx
197+
uses: docker/[email protected]
198+
199+
- name: Login to GCR
200+
uses: docker/login-action@v3
201+
with:
202+
registry: ${{ secrets.GCP_ARTIFACT_REGISTRY }}
203+
username: _json_key
204+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
205+
206+
- name: Pull Splunk Enterprise Image
207+
run: docker pull ${{ env.SPLUNK_ENTERPRISE_IMAGE }}
208+
209+
- name: Pull Splunk Operator Image Locally
210+
run: |
211+
docker pull ${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
212+
docker tag ${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
213+
echo "SPLUNK_OPERATOR_IMAGE=${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA" >> $GITHUB_ENV
214+
215+
- name: Tag and Push Splunk Enterprise Image to Artifact Registry
216+
run: |
217+
docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
218+
docker push ${{ secrets.GCP_ARTIFACT_REGISTRY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
219+
220+
- name: Get Kubernetes Credentials
221+
run: |
222+
gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.GCP_ZONE }} --project ${{ env.GCP_PROJECT_ID }}
223+
224+
- name: Get GKE Credentials
225+
uses: google-github-actions/get-gke-credentials@v1
226+
with:
227+
cluster_name: ${{ env.CLUSTER_NAME }}
228+
location: ${{ env.GCP_ZONE }}
229+
230+
- name: Install Metrics Server
231+
run: |
232+
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
233+
234+
- name: Install Kubernetes Dashboard
235+
run: |
236+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml
237+
238+
- name: Setup Kustomize
239+
run: |
240+
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
241+
sudo mv kustomize /usr/local/bin/
242+
243+
- name: Verify kubectl Configuration
244+
run: |
245+
kubectl config current-context
246+
247+
- name: Apply StorageClass
248+
run: |
249+
kubectl apply -f test/gcp-storageclass.yaml
250+
251+
- name: Run Integration Tests
252+
run: |
253+
export GCP_SERVICE_ACCOUNT_KEY=${{ secrets.GCP_SERVICE_ACCOUNT_KEY_BASE64 }}
254+
make int-test
255+
256+
- name: Collect Test Logs
257+
if: ${{ always() }}
258+
run: |
259+
mkdir -p /tmp/pod_logs
260+
find ./test -name "*.log" -exec cp {} /tmp/pod_logs \;
261+
262+
- name: Archive Pod Logs
263+
if: ${{ always() }}
264+
uses: actions/upload-artifact@v4
265+
with:
266+
name: splunk-pods-logs-artifacts-${{ matrix.test_focus.name }}
267+
path: /tmp/pod_logs/**
268+
- name: Cleanup Test Case Artifacts
269+
if: ${{ always() }}
270+
run: |
271+
export EKS_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
272+
export GKE_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
273+
tools/cleanup.sh
274+
- name: Cleanup up EKS cluster
275+
if: ${{ always() }}
276+
run: |
277+
make cluster-down

Diff for: .github/workflows/int-test-workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ jobs:
5555
matrix:
5656
test:
5757
[
58-
appframeworks1,
58+
appframeworksS1,
5959
managerappframeworkc3,
6060
managerappframeworkm4,
6161
managersecret,
6262
managersmartstore,
63-
managermc,
63+
managermc1,
64+
managermc2,
6465
managercrcrud,
6566
licensemanager,
6667
managerdeletecr,

Diff for: .github/workflows/manual-int-test-workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ jobs:
1313
matrix:
1414
test:
1515
[
16-
appframeworks1,
16+
appframeworksS1,
1717
managerappframeworkc3,
1818
managerappframeworkm4,
1919
managersecret,
2020
managersmartstore,
21-
managermc,
21+
managermc1,
22+
managermc2,
2223
managerscaling,
2324
managercrcrud,
2425
licensemanager,

Diff for: .github/workflows/namespace-scope-int-workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ jobs:
99
matrix:
1010
test:
1111
[
12-
appframeworks1,
12+
appframeworksS1,
1313
managerappframeworkc3,
1414
managerappframeworkm4,
1515
managersecret,
1616
managersmartstore,
17-
managermc,
17+
managermc1,
18+
managermc2,
1819
managerscaling,
1920
managercrcrud,
2021
licensemanager,

Diff for: .github/workflows/nightly-int-test-workflow.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ jobs:
5353
matrix:
5454
test:
5555
[
56-
appframeworks1,
56+
appframeworksS1,
5757
managerappframeworkc3,
5858
managerappframeworkm4,
5959
managersecret,
6060
managersmartstore,
61-
managermc,
61+
managermc1,
62+
managermc2,
6263
managerscaling,
6364
managercrcrud,
6465
licensemanager,

Diff for: Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go
2222

2323
# Use distroless as minimal base image to package the manager binary
2424
# Refer to https://github.com/GoogleContainerTools/distroless for more details
25-
FROM registry.access.redhat.com/ubi8/ubi:8.10
25+
# This sha relates to ubi version 8.10-1132, which is tagged as 8.10 and latest as of Nov 15, 2024
26+
FROM registry.access.redhat.com/ubi8/ubi@sha256:8990388831e1b41c9a67389e4b691dae8b1283f77d5fb7263e1f4fc69c0a9d05
2627
ENV OPERATOR=/manager \
2728
USER_UID=1001 \
2829
USER_NAME=nonroot

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ docker-buildx: test ## Build and push docker image for the manager for cross-pla
156156
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
157157
- docker buildx create --name project-v3-builder
158158
docker buildx use project-v3-builder
159-
- docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross
159+
- docker buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
160160
- docker buildx rm project-v3-builder
161161
rm Dockerfile.cross
162162

0 commit comments

Comments
 (0)