-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from stefanprodan/module-imps
Timoni module improvements
- Loading branch information
Showing
9 changed files
with
205 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters