From 6bf18ede8d52b61c814f40bc0fb68e4582f18946 Mon Sep 17 00:00:00 2001 From: "Gerard Castillo Lasheras (BI X)" Date: Fri, 20 Sep 2024 18:52:50 +0200 Subject: [PATCH] docker-plain add helm lint and helm template processing howto info in the readme --- docker-plain/files/README.md | 23 ++++++++++++++++--- docker-plain/files/chart/templates/_image.tpl | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/docker-plain/files/README.md b/docker-plain/files/README.md index 0738cd4c5..cd124f08c 100644 --- a/docker-plain/files/README.md +++ b/docker-plain/files/README.md @@ -31,9 +31,26 @@ Using a local container runtime you can build the container and tag it with the docker build -t testing/my-component:$(git rev-parse --short=8 HEAD) docker/ ``` -### Deploying the helm chart using +### Helm chart linting -Using a local kubernetes cluster you can deploy the component: +This quickstarter comes with a fine-tunned [values.schema.json](chart/values.schema.json) Helm chart linting file. +Validate your chart template by running, under the `chart` folder, the following command: + +```bash +helm lint +``` + +### Helm chart template processing test + +One can test the chart template processing; run, under the `chart` folder, the following command: + +```bash +helm --debug template . --set image.path=testing --set image.name=my-component --set image.tag=$(git rev-parse --short=8 HEAD) +``` + +### Deploying the helm chart using a local k8s + +Using a local kubernetes cluster (i.e.: [kind](https://kind.sigs.k8s.io/)) you can deploy the component: ```bash kubectl create ns docker-plain @@ -46,4 +63,4 @@ helm upgrade --install --wait --atomic --namespace docker-plain --set image.path - In your `Dockerfile`, replace `FROM alpine:latest` with the ods-jenkins-agent-base image that is available in the OpenDevStack namespace of your cluster, e.g. `FROM docker-registry.default.svc:5000/ods/jenkins-agent-base:latest`. - Add everything you need in the jenkins-agent to your `Dockerfile`, for examples see the existing agents at [github](https://github.com/opendevstack/ods-quickstarters/tree/master/common/jenkins-agents). - Commit and push your code to git, this will trigger the pipeline and result in a docker image of your custom jenkins-agent in your cd-namespace. -- Now you can use your custom jenkins-agent by changing the imageStreamTag to `imageStreamTag: '/:latest'` in the `Jenkinsfile` of the actual application you want to build with your custom new jenkins-agent. \ No newline at end of file +- Now you can use your custom jenkins-agent by changing the imageStreamTag to `imageStreamTag: '/:latest'` in the `Jenkinsfile` of the actual application you want to build with your custom new jenkins-agent. diff --git a/docker-plain/files/chart/templates/_image.tpl b/docker-plain/files/chart/templates/_image.tpl index 035ee646e..1a527617b 100644 --- a/docker-plain/files/chart/templates/_image.tpl +++ b/docker-plain/files/chart/templates/_image.tpl @@ -16,4 +16,4 @@ If not set, values from .Values.image.registry, .Values.image.path, .Values.imag {{- else }} {{- printf "%s/%s:%s" (or .Values.imageNamespace .Values.image.path) (or .Values.componentId .Values.image.name) (or .Values.imageTag .Values.image.tag ) -}} {{- end }} -{{- end }} \ No newline at end of file +{{- end }}