Skip to content

Commit

Permalink
test some more scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
jinja2 committed Jan 16, 2025
1 parent 90b91f3 commit 04eb928
Showing 1 changed file with 199 additions and 8 deletions.
207 changes: 199 additions & 8 deletions .github/workflows/functional_test_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,8 @@ jobs:
kubectl get instrumentations.opentelemetry.io -A
- name: check operator
run: |
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator
continue-on-error: true
- name: upgrade old again
run: |
Expand Down Expand Up @@ -633,9 +632,8 @@ jobs:
kubectl get instrumentations.opentelemetry.io -A
- name: check operator
run: |
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator
continue-on-error: true
- name: upgrade old again
run: |
Expand Down Expand Up @@ -722,9 +720,8 @@ jobs:
kubectl get instrumentations.opentelemetry.io -A
- name: check operator
run: |
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator
continue-on-error: true
- name: upgrade old again
run: |
Expand Down Expand Up @@ -811,9 +808,8 @@ jobs:
kubectl get instrumentations.opentelemetry.io -A
- name: check operator
run: |
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl describe po -lapp.kubernetes.io/name=operator
kubectl get po -lapp.kubernetes.io/name=operator
continue-on-error: true
- name: upgrade old again
run: |
Expand Down Expand Up @@ -844,3 +840,198 @@ jobs:
- name: check crds are installed
run: |
kubectl get crds | grep 'opentelemetry.io'
kuberenetes-test-new-install-w-subchart:
name: Test helm install in kind with subchart
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ~1.22.5
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Create kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v1.30.0
kubectl_version: v1.30.0
cluster_name: kind
config: ./.github/workflows/configs/kind-config.yaml
- name: Fix kubelet TLS server certificates
run: |
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
- name: Update dependencies
run: |
make dep-update
- name: Deploy cert-manager
run: |
make cert-manager
- name: helm install with operator enabled and no crds
run: |
helm install sock helm-charts/splunk-otel-collector --debug \
--set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx \
--set operator.enabled=true --set environment=dev --set clusterName=dev
continue-on-error: true
- name: check crds are installed
run: |
kubectl get crds | grep 'opentelemetry.io'
- name: check operator and instrumentation
run: |
kubectl get instrumentations.opentelemetry.io -A
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl get po -lapp.kubernetes.io/name=operator
kubectl get instrumentations.opentelemetry.io -A
kubernetes-test-new-install-wo-subchart:
name: Test helm install in kind without helm managed crds. CRDs are installed using kubectl.
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ~1.22.5
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Create kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v1.30.0
kubectl_version: v1.30.0
cluster_name: kind
config: ./.github/workflows/configs/kind-config.yaml
- name: Fix kubelet TLS server certificates
run: |
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
- name: Update dependencies
run: |
make dep-update
- name: Deploy cert-manager
run: |
make cert-manager
- name: install crds from helm template with kubectl
run: |
helm template helm-charts/splunk-otel-collector/ --include-crds \
--set="splunkObservability.realm=us0,splunkObservability.accessToken=xxxxxx,clusterName=my-cluster,operatorcrds.install=true" \
| yq e '. | select(.kind == "CustomResourceDefinition")' | kubectl apply -f -
continue-on-error: true
- name: check crds are installed
run: |
kubectl get crds | grep 'opentelemetry.io'
- name: helm install with operator enabled and no crds
run: |
helm install sock helm-charts/splunk-otel-collector --debug \
--set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx \
--set operator.enabled=true --set environment=dev --set clusterName=dev
continue-on-error: true
- name: check operator and instrumentation
run: |
kubectl get instrumentations.opentelemetry.io -A
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl get po -lapp.kubernetes.io/name=operator
kubectl get instrumentations.opentelemetry.io -A
kubernetes-test-upgrade-keep-crd-rm-from-helm:
name: Steps to helm upgrade but keeping crds in cluster but removing from helm release
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout old release
uses: actions/checkout@v4
with:
path: base
ref: splunk-otel-collector-0.113.0
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: ~1.22.5
cache: false
- name: Cache Go
id: go-cache
timeout-minutes: 5
uses: actions/cache@v4
with:
path: |
~/go/bin
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
- name: Create kind cluster
uses: helm/[email protected]
with:
node_image: kindest/node:v1.30.0
kubectl_version: v1.30.0
cluster_name: kind
config: ./.github/workflows/configs/kind-config.yaml
- name: Fix kubelet TLS server certificates
run: |
kubectl get csr -o=jsonpath='{range.items[?(@.spec.signerName=="kubernetes.io/kubelet-serving")]}{.metadata.name}{" "}{end}' | xargs kubectl certificate approve
- name: Update dependencies
run: |
cd base && make dep-update
- name: Deploy cert-manager
run: |
cd base && make cert-manager
- name: install helm chart with operator enabled
run: |
cd base && helm install sock helm-charts/splunk-otel-collector --debug \
--set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx \
--set operator.enabled=true --set environment=dev --set clusterName=dev
continue-on-error: true
- name: check crds are installed
run: |
kubectl get crds | grep 'opentelemetry.io'
- name: check operator
run: |
kubectl get po -lapp.kubernetes.io/name=operator -o=name | xargs -n 1 kubectl wait --for=condition=Ready --timeout=2m
kubectl get po -lapp.kubernetes.io/name=operator
continue-on-error: true
- name: upgrade old again
run: |
cd base && helm upgrade sock helm-charts/splunk-otel-collector --debug \
--set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx \
--set operator.enabled=true --set environment=dev --set clusterName=dev
- name: check helm release status
run: |
helm status sock
- name: check instrumentations installed
run: |
kubectl describe instrumentations.opentelemetry.io -A
- name: Update dependencies
run: |
make dep-update
- name: tell helm to keep CRDs
run: |
kubectl get crds -o=name | grep 'opentelemetry.io' | xargs -I% kubectl annotate % helm.sh/resource-policy=keep
- name: import instrumentation to helm release
run: |
NAMESPACE=default
RELEASE_NAME=sock
kubectl get -n $NAMESPACE instrumentations.opentelemetry.io -o name | xargs -I % kubectl annotate -n $NAMESPACE % meta.helm.sh/release-name=$RELEASE_NAME
kubectl get -n $NAMESPACE instrumentations.opentelemetry.io -o name | xargs -I % kubectl annotate -n $NAMESPACE % meta.helm.sh/release-namespace=$NAMESPACE
- name: upgrade helm chart
run: |
helm upgrade --install sock helm-charts/splunk-otel-collector --debug \
--set splunkObservability.realm=us0 --set splunkObservability.accessToken=xxxxx \
--set operator.enabled=true --set operatorcrds.install=true --set environment=dev --set clusterName=dev
- name: check crds are still installed
run: |
kubectl get crds -Lapp.kubernetes.io/managed-by | grep 'opentelemetry.io'

0 comments on commit 04eb928

Please sign in to comment.