Skip to content

Commit

Permalink
docker-plain add helm lint and helm template processing howto info in…
Browse files Browse the repository at this point in the history
… the readme
  • Loading branch information
gerardcl committed Sep 20, 2024
1 parent 818e13f commit 6bf18ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions docker-plain/files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: '<your_cd_namespace>/<your_custom_jenkins_agent_image_name>:latest'` in the `Jenkinsfile` of the actual application you want to build with your custom new jenkins-agent.
- Now you can use your custom jenkins-agent by changing the imageStreamTag to `imageStreamTag: '<your_cd_namespace>/<your_custom_jenkins_agent_image_name>:latest'` in the `Jenkinsfile` of the actual application you want to build with your custom new jenkins-agent.
2 changes: 1 addition & 1 deletion docker-plain/files/chart/templates/_image.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
{{- end }}

0 comments on commit 6bf18ed

Please sign in to comment.