Skip to content

Commit d9ad174

Browse files
committed
[chore] Add EKS Auto Mode cluster testing
Signed-off-by: Dani Louca <[email protected]>
1 parent e94a479 commit d9ad174

File tree

3 files changed

+172
-0
lines changed

3 files changed

+172
-0
lines changed

.github/workflows/functional_test_v2.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,3 +397,80 @@ jobs:
397397
UPGRADE_FROM_CHART_DIR: base/splunk-otel-collector
398398
run: |
399399
TEARDOWN_BEFORE_SETUP=true SUITE=functional make functionaltest
400+
401+
eks-auto-mode-test:
402+
name: Test helm install in EKS Auto Mode - credentials needed
403+
if: |
404+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
405+
(github.ref == 'refs/heads/main')
406+
env:
407+
KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-functional-testing-eks-auto-mode
408+
KUBE_TEST_ENV: eks/auto-mode
409+
SKIP_TESTS: "true" # we need to skip functional tests as we have not set probes to listen to the traffic.
410+
runs-on: ubuntu-latest
411+
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'Ignore Tests') }}
412+
steps:
413+
- uses: actions/checkout@v4
414+
- uses: actions/setup-go@v5
415+
with:
416+
go-version: ${{ env.GO_VERSION }}
417+
cache-dependency-path: '**/go.sum'
418+
- name: Configure AWS credentials
419+
uses: aws-actions/configure-aws-credentials@v4
420+
with:
421+
aws-access-key-id: ${{ secrets.AWS_KEY }}
422+
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
423+
aws-region: us-west-2
424+
- name: Install kubeconfig
425+
run: |
426+
aws eks update-kubeconfig --name rotel-eks-autotest --region us-west-2
427+
- name: Update dependencies
428+
run: |
429+
make dep-update
430+
- name: run functional tests
431+
env:
432+
HOST_ENDPOINT: 0.0.0.0
433+
run: |
434+
TEARDOWN_BEFORE_SETUP=true SUITE=functional make functionaltest
435+
436+
eks-auto-mode-upgrade-test:
437+
name: Test helm upgrade in EKS Auto Mode - credentials needed
438+
if: |
439+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) ||
440+
(github.ref == 'refs/heads/main')
441+
env:
442+
KUBECONFIG: /tmp/kube-config-splunk-otel-collector-chart-functional-testing-eks-auto-mode
443+
KUBE_TEST_ENV: eks/auto-mode
444+
SKIP_TESTS: "true" # we need to skip functional tests as we have not set probes to listen to the traffic.
445+
runs-on: ubuntu-latest
446+
continue-on-error: ${{ contains(github.event.pull_request.labels.*.name, 'Ignore Tests') }}
447+
steps:
448+
- uses: actions/checkout@v4
449+
- name: Download the latest published release to use as a base for the upgrade
450+
run: |
451+
helm repo add splunk-otel-collector-chart https://signalfx.github.io/splunk-otel-collector-chart
452+
helm repo update
453+
helm pull splunk-otel-collector-chart/splunk-otel-collector --untar --untardir base
454+
- uses: actions/setup-go@v5
455+
with:
456+
go-version: ${{ env.GO_VERSION }}
457+
cache-dependency-path: '**/go.sum'
458+
- name: Configure AWS credentials
459+
uses: aws-actions/configure-aws-credentials@v4
460+
with:
461+
aws-access-key-id: ${{ secrets.AWS_KEY }}
462+
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
463+
aws-region: us-west-2
464+
- name: Install kubeconfig
465+
run: |
466+
aws eks update-kubeconfig --name rotel-eks-autotest --region us-west-2
467+
- name: Update dependencies
468+
run: |
469+
make dep-update
470+
- name: run functional tests
471+
env:
472+
HOST_ENDPOINT: 0.0.0.0
473+
UPGRADE_FROM_VALUES: aws_upgrade_from_previous_release_values.yaml
474+
UPGRADE_FROM_CHART_DIR: base/splunk-otel-collector
475+
run: |
476+
TEARDOWN_BEFORE_SETUP=true SUITE=functional make functionaltest

functional_tests/functional/functional_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const (
4949
kindTestKubeEnv = "kind"
5050
eksTestKubeEnv = "eks"
5151
eksFargateTestKubeEnv = "eks/fargate"
52+
eksAutoModeTestKubeEnv = "eks/auto-mode"
5253
autopilotTestKubeEnv = "gke/autopilot"
5354
aksTestKubeEnv = "aks"
5455
gceTestKubeEnv = "gce"
@@ -177,6 +178,8 @@ func deployChartsAndApps(t *testing.T, testKubeConfig string) {
177178
valuesFile, err = filepath.Abs(filepath.Join(testDir, valuesDir, "aks_test_values.yaml.tmpl"))
178179
case eksFargateTestKubeEnv:
179180
valuesFile, err = filepath.Abs(filepath.Join(testDir, valuesDir, "eks_fargate_test_values.yaml.tmpl"))
181+
case eksAutoModeTestKubeEnv:
182+
valuesFile, err = filepath.Abs(filepath.Join(testDir, valuesDir, "eks_auto_mode_test_values.yaml.tmpl"))
180183
default:
181184
valuesFile, err = filepath.Abs(filepath.Join(testDir, valuesDir, "test_values.yaml.tmpl"))
182185
}
@@ -496,6 +499,7 @@ func Test_Functions(t *testing.T) {
496499
gceTestKubeEnv,
497500
eksTestKubeEnv,
498501
eksFargateTestKubeEnv,
502+
eksAutoModeTestKubeEnv,
499503
}
500504

501505
switch {
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
splunkObservability:
3+
realm: CHANGEME
4+
accessToken: CHANGEME
5+
ingestUrl: {{ .AgentEndpoint }}
6+
apiUrl: {{ .ApiURLEndpoint }}
7+
8+
splunkPlatform:
9+
token: foobar
10+
endpoint: {{ .LogHecEndpoint }}
11+
metricsEnabled: true
12+
metricsIndex: myMetricsIndex
13+
14+
serviceAccount:
15+
name: splunk-otel-collector
16+
17+
autodetect:
18+
prometheus: true
19+
20+
logsCollection:
21+
journald:
22+
enabled: true
23+
directory: /run/log/journal
24+
agent:
25+
config:
26+
exporters:
27+
otlp:
28+
endpoint: {{ .OtlpEndpoint }}
29+
tls:
30+
insecure: true
31+
splunk_hec/platform_metrics:
32+
endpoint: {{ .MetricHecEndpoint }}
33+
service:
34+
pipelines:
35+
traces:
36+
exporters:
37+
- otlp
38+
clusterReceiver:
39+
eventsEnabled: true
40+
config:
41+
exporters:
42+
signalfx:
43+
ingest_url: {{ .K8sClusterEndpoint }}
44+
tls:
45+
insecure: true
46+
splunk_hec/platform_logs:
47+
endpoint: {{ .LogObjectsHecEndpoint }}
48+
49+
k8sObjects:
50+
- name: pods
51+
- name: namespaces
52+
- name: nodes
53+
- name: events
54+
mode: watch
55+
56+
extraAttributes:
57+
fromAnnotations:
58+
- key: splunk.com/customField
59+
tag_name: customField
60+
fromLabels:
61+
- key: app
62+
from: pod
63+
- key: app
64+
from: namespace
65+
66+
custom:
67+
- name: "cluster_name"
68+
value: "ci-k8s-cluster"
69+
- name: "customfield1"
70+
value: "customvalue1"
71+
- name: "customfield2"
72+
value: "customvalue2"
73+
74+
environment: dev
75+
operatorcrds:
76+
install: true
77+
operator:
78+
enabled: true
79+
targetAllocator:
80+
enabled: true
81+
82+
83+
{{ if (eq .KubeTestEnv "eks/auto-mode") }}
84+
cloudProvider: aws
85+
distribution: eks
86+
{{ else }}
87+
clusterName: dev-operator
88+
{{ end }}
89+
90+
featureGates:
91+
enableEKSApiServerMetrics: true

0 commit comments

Comments
 (0)