Skip to content

Commit

Permalink
test: Test integration with cert-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasVitale committed Jun 17, 2024
1 parent 9e1b019 commit ab135a4
Show file tree
Hide file tree
Showing 10 changed files with 100 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/integration/cert-manager/00-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: contour-cert
namespace: projectcontour
status:
conditions:
- status: "True"
type: Ready

---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: envoy-cert
namespace: projectcontour
status:
conditions:
- status: "True"
type: Ready
8 changes: 8 additions & 0 deletions test/integration/cert-manager/00-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
cd ../../../package && \
kubectl config set-context --current --namespace=tests && \
ytt -f ../test/integration/cert-manager/config -f package-resources.yml | kctrl dev -f- --local -y
6 changes: 6 additions & 0 deletions test/integration/cert-manager/01-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
kapp deploy -a kuard -f https://projectcontour.io/examples/kuard.yaml -y
6 changes: 6 additions & 0 deletions test/integration/cert-manager/01-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
commands:
- script: |
curl --fail-with-body localhost:80
9 changes: 9 additions & 0 deletions test/integration/cert-manager/02-uninstall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
kapp delete -a kuard -y
cd ../../../package && \
kubectl config set-context --current --namespace=tests && \
ytt -f ../test/integration/cert-manager/config -f package-resources.yml | kctrl dev -f- --local --delete -y
9 changes: 9 additions & 0 deletions test/integration/cert-manager/config/overlay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#@ load("@ytt:overlay", "overlay")

#@overlay/match by=overlay.subset({"metadata":{"name":"contour"}, "kind":"PackageInstall"})
---
spec:
#@overlay/match missing_ok=True
values:
- secretRef:
name: contour-values
13 changes: 13 additions & 0 deletions test/integration/cert-manager/config/values.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: v1
kind: Secret
metadata:
name: contour-values
namespace: tests
stringData:
values.yaml: |
envoy:
service:
type: NodePort
certificates:
useCertManager: true
12 changes: 12 additions & 0 deletions test/integration/kuttl-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ kindContext: integration
kindNodeCache: true
timeout: 120
artifactsDir: /tmp/kuttl-artifacts
commands:
- script: |
kapp deploy -a kapp-controller -y \
-f https://github.com/carvel-dev/kapp-controller/releases/latest/download/release.yml
- script: |
kubectl config set-context --current --namespace=tests && \
kapp deploy -a cert-manager-package -y \
-f https://github.com/kadras-io/package-for-cert-manager/releases/download/v1.15.0%2Bkadras.1/package.yml \
-f https://github.com/kadras-io/package-for-cert-manager/releases/download/v1.15.0%2Bkadras.1/metadata.yml
- script: |
kubectl config set-context --current --namespace=tests && \
kapp deploy -a dependencies -y -f ./test/setup/dependencies
1 change: 1 addition & 0 deletions test/integration/nodeport/02-uninstall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: |
kapp delete -a kuard -y
cd ../../../package && \
kubectl config set-context --current --namespace=tests && \
ytt -f ../test/integration/nodeport/config -f package-resources.yml | kctrl dev -f- --local --delete -y
15 changes: 15 additions & 0 deletions test/setup/dependencies/cert-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
name: cert-manager
namespace: tests
annotations:
kapp.k14s.io/change-group: cert-manager
kapp.k14s.io/change-rule.serviceaccount: delete before deleting serviceaccount
spec:
serviceAccountName: kadras-install-sa
packageRef:
refName: cert-manager.packages.kadras.io
versionSelection:
constraints: 1.15.0+kadras.1

0 comments on commit ab135a4

Please sign in to comment.