Skip to content

Commit

Permalink
add test for helm install in AKS with windows (#1193)
Browse files Browse the repository at this point in the history
* add test for helm install in AKS with windows

* test azcli

* test with diff values

* fix tag

* increase initial delay for windows

* update pullpolicy

* remove redundant test values
  • Loading branch information
jinja2 committed Mar 1, 2024
1 parent 99b097a commit f1c4e74
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 7 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/functional_test_v2.yaml
Expand Up @@ -296,3 +296,51 @@ jobs:
run: |
cd functional_tests
go test -v
aks-windows-test:
name: Test helm install in AKS - credentials needed
needs: kubernetes-test
if: github.event.pull_request.head.repo.full_name == github.repository
concurrency:
group: aks-windows-group
env:
KUBE_TEST_ENV: aks
SKIP_TESTS: "true"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ~1.20.8
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v3
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Set up kubelogin for non-interactive login
uses: azure/use-kubelogin@v1.2
with:
kubelogin-version: "v0.0.24"
- uses: azure/login@v1.6.1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- uses: azure/aks-set-context@v3.2
with:
resource-group: ${{ secrets.AKS_RESOURCE_GROUP }}
cluster-name: ${{ secrets.AKS_CLUSTER_NAME }}
admin: false
use-kubelogin: true
- name: Update dependencies
run: |
make dep-update
- name: run functional tests
env:
HOST_ENDPOINT: 0.0.0.0
run: |
cd functional_tests
go test -v
5 changes: 4 additions & 1 deletion functional_tests/functional_test.go
Expand Up @@ -61,6 +61,7 @@ const (
kindTestKubeEnv = "kind"
eksTestKubeEnv = "eks"
autopilotTestKubeEnv = "gke/autopilot"
aksTestKubeEnv = "aks"
testDir = "testdata"
valuesDir = "values"
manifestsDir = "manifests"
Expand Down Expand Up @@ -149,6 +150,8 @@ func deployChartsAndApps(t *testing.T) {
switch kubeTestEnv {
case autopilotTestKubeEnv:
valuesBytes, err = os.ReadFile(filepath.Join(testDir, valuesDir, "autopilot_test_values.yaml.tmpl"))
case aksTestKubeEnv:
valuesBytes, err = os.ReadFile(filepath.Join(testDir, valuesDir, "aks_test_values.yaml.tmpl"))
default:
valuesBytes, err = os.ReadFile(filepath.Join(testDir, valuesDir, "test_values.yaml.tmpl"))
}
Expand Down Expand Up @@ -375,7 +378,7 @@ func Test_Functions(t *testing.T) {
require.True(t, setKubeTestEnv, "the environment variable KUBE_TEST_ENV must be set")

switch kubeTestEnv {
case kindTestKubeEnv, autopilotTestKubeEnv:
case kindTestKubeEnv, autopilotTestKubeEnv, aksTestKubeEnv:
expectedValuesDir = kindValuesDir
case eksTestKubeEnv:
expectedValuesDir = eksValuesDir
Expand Down
80 changes: 80 additions & 0 deletions functional_tests/testdata/values/aks_test_values.yaml.tmpl
@@ -0,0 +1,80 @@
---
splunkObservability:
realm: CHANGEME
accessToken: CHANGEME
ingestUrl: {{ .AgentEndpoint }}
apiUrl: {{ .ApiURLEndpoint }}

splunkPlatform:
token: foobar
endpoint: {{ .LogHecEndpoint }}

agent:
config:
exporters:
otlp:
endpoint: {{ .OtlpEndpoint }}
tls:
insecure: true
service:
pipelines:
traces:
exporters:
- otlp
clusterReceiver:
eventsEnabled: true
config:
exporters:
signalfx:
ingest_url: {{ .K8sClusterEndpoint }}
tls:
insecure: true

k8sObjects:
- name: pods
- name: namespaces
- name: nodes
- name: events
mode: watch

extraAttributes:
fromAnnotations:
- key: splunk.com/customField
tag_name: customField
fromLabels:
- key: app
from: pod
- key: app
from: namespace

custom:
- name: "cluster_name"
value: "ci-k8s-cluster"
- name: "customfield1"
value: "customvalue1"
- name: "customfield2"
value: "customvalue2"

clusterName: test
environment: test
cloudProvider: azure
distribution: aks
isWindows: true
# use dev image until multi-platform version of splunk-otel-collector-windows is available
image:
otelcol:
repository: quay.io/signalfx/splunk-otel-collector-windows-dev
tag: latest
pullPolicy: Always
readinessProbe:
initialDelaySeconds: 60
livenessProbe:
initialDelaySeconds: 60

operator:
enabled: true
admissionWebhooks:
certManager:
enabled: false
autoGenerateCert:
enabled: true
@@ -1,12 +1,9 @@
---
metricsEnabled: true
tracesEnabled: true
splunkObservability:
realm: CHANGEME
accessToken: CHANGEME
ingestUrl: {{ .AgentEndpoint }}
apiUrl: {{ .ApiURLEndpoint }}
metricsEnabled: true

splunkPlatform:
token: foobar
Expand Down
4 changes: 1 addition & 3 deletions functional_tests/testdata/values/test_values.yaml.tmpl
@@ -1,12 +1,10 @@
---
metricsEnabled: true
tracesEnabled: true
splunkObservability:
realm: CHANGEME
accessToken: CHANGEME
ingestUrl: {{ .AgentEndpoint }}
apiUrl: {{ .ApiURLEndpoint }}
metricsEnabled: true

splunkPlatform:
token: foobar
endpoint: {{ .LogHecEndpoint }}
Expand Down

0 comments on commit f1c4e74

Please sign in to comment.