mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-02-14 18:29:52 +00:00
Add e2e tests for Timoni module
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
51
.github/workflows/e2e.yml
vendored
51
.github/workflows/e2e.yml
vendored
@@ -11,18 +11,14 @@ permissions:
|
||||
|
||||
jobs:
|
||||
kind-helm:
|
||||
strategy:
|
||||
matrix:
|
||||
helm-version:
|
||||
- v3.11.0
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Kubernetes
|
||||
uses: helm/kind-action@v1.5.0
|
||||
uses: helm/kind-action@v1.8.0
|
||||
with:
|
||||
version: v0.17.0
|
||||
version: v0.20.0
|
||||
cluster_name: kind
|
||||
- name: Build container image
|
||||
run: |
|
||||
@@ -31,7 +27,7 @@ jobs:
|
||||
- name: Setup Helm
|
||||
uses: azure/setup-helm@v3
|
||||
with:
|
||||
version: ${{ matrix.helm-version }}
|
||||
version: v3.12.3
|
||||
- name: Deploy
|
||||
run: ./test/deploy.sh
|
||||
- name: Run integration tests
|
||||
@@ -40,3 +36,42 @@ jobs:
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl logs -l app=podinfo || true
|
||||
kind-timoni:
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
registry:
|
||||
image: registry:2
|
||||
ports:
|
||||
- 5000:5000
|
||||
env:
|
||||
PODINFO_IMAGE_URL: "test/podinfo"
|
||||
PODINFO_MODULE_URL: "oci://localhost:5000/podinfo"
|
||||
PODINFO_VERSION: "0.0.0-devel"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Timoni
|
||||
uses: stefanprodan/timoni/actions/setup@main
|
||||
- name: Setup Kubernetes
|
||||
uses: helm/kind-action@v1.8.0
|
||||
with:
|
||||
version: v0.20.0
|
||||
cluster_name: kind
|
||||
- name: Build container
|
||||
run: |
|
||||
docker build -t ${PODINFO_IMAGE_URL}:${PODINFO_VERSION} --build-arg "REVISION=${GITHUB_SHA}" -f Dockerfile.xx .
|
||||
kind load docker-image ${PODINFO_IMAGE_URL}:${PODINFO_VERSION}
|
||||
- name: Build module
|
||||
run: |
|
||||
timoni mod push ./timoni/podinfo ${PODINFO_MODULE_URL} -v ${PODINFO_VERSION}
|
||||
- name: Apply bundle
|
||||
run: |
|
||||
timoni bundle apply -f ./timoni/bundles/test.podinfo.cue --runtime-from-env
|
||||
- name: Verify status
|
||||
run: |
|
||||
timoni -n podinfo status backend
|
||||
timoni -n podinfo status frontend
|
||||
- name: Debug failure
|
||||
if: failure()
|
||||
run: |
|
||||
kubectl -n podinfo get all || true
|
||||
|
||||
66
timoni/bundles/test.podinfo.cue
Normal file
66
timoni/bundles/test.podinfo.cue
Normal file
@@ -0,0 +1,66 @@
|
||||
bundle: {
|
||||
apiVersion: "v1alpha1"
|
||||
name: "podinfo"
|
||||
|
||||
_modURL: "oci://ghcr.io/stefanprodan/modules/podinfo" @timoni(runtime:string:PODINFO_MODULE_URL)
|
||||
_imgURL: "ghcr.io/stefanprodan/modules/podinfo" @timoni(runtime:string:PODINFO_IMAGE_URL)
|
||||
_imgTag: "latest" @timoni(runtime:string:PODINFO_VERSION)
|
||||
|
||||
instances: {
|
||||
backend: {
|
||||
module: url: _modURL
|
||||
namespace: "podinfo"
|
||||
values: {
|
||||
image: {
|
||||
repository: _imgURL
|
||||
tag: _imgTag
|
||||
}
|
||||
resources: requests: {
|
||||
cpu: "100m"
|
||||
memory: "128Mi"
|
||||
}
|
||||
autoscaling: {
|
||||
enabled: true
|
||||
minReplicas: 1
|
||||
maxReplicas: 10
|
||||
cpu: 90
|
||||
}
|
||||
}
|
||||
}
|
||||
frontend: {
|
||||
module: url: _modURL
|
||||
namespace: "podinfo"
|
||||
values: {
|
||||
image: {
|
||||
repository: _imgURL
|
||||
tag: _imgTag
|
||||
}
|
||||
ui: backend: "http://backend.podinfo.svc.cluster.local/echo"
|
||||
replicas: 2
|
||||
podSecurityContext: {
|
||||
runAsUser: 100
|
||||
runAsGroup: 101
|
||||
fsGroup: 101
|
||||
}
|
||||
securityContext: {
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
runAsNonRoot: true
|
||||
capabilities: drop: ["ALL"]
|
||||
seccompProfile: type: "RuntimeDefault"
|
||||
}
|
||||
ingress: {
|
||||
enabled: true
|
||||
className: "nginx"
|
||||
host: "podinfo.local"
|
||||
tls: true
|
||||
annotations: {
|
||||
"nginx.ingress.kubernetes.io/ssl-redirect": "false"
|
||||
"nginx.ingress.kubernetes.io/force-ssl-redirect": "false"
|
||||
"cert-manager.io/cluster-issuer": "self-signed"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ values: {
|
||||
annotations: "cert-manager.io/cluster-issuer": "letsencrypt"
|
||||
}
|
||||
|
||||
monitoring: enabled: true
|
||||
monitoring: enabled: false
|
||||
|
||||
_mcpu: 100
|
||||
_mem: 128
|
||||
|
||||
Reference in New Issue
Block a user