Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker plain helm chart #1035

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
429158a
feat: add initial draft for helm chart (docker-plain)
segfault16 May 6, 2024
a8df74d
test: docker-plain chart test use AWS ECR busybox
gerardcl May 10, 2024
55df77c
test: update docker-plain golden tests with helm integration
gerardcl May 10, 2024
abcd6c1
feat: docker-plain remove provisioning resources creation
gerardcl May 10, 2024
8be1e7a
drop: comment on docker-plain chart name
gerardcl May 10, 2024
5fb6f7e
feat: prepare Chart.yaml for templating the componend_id
segfault16 Jul 17, 2024
3dc157b
fix: remove custom app label, prefer the labels suggested by kubernetes
segfault16 Jul 17, 2024
ed3b160
fix: remove componentId since this should be covered by the helm char…
segfault16 Jul 17, 2024
f83dba3
feat: update image section
segfault16 Jul 17, 2024
1d7229d
update devnotes
segfault16 Jul 17, 2024
543e5e2
fix TODO note regarding image Values values.yaml
gerardcl Jul 17, 2024
e48a729
feat: docker-plain ingress with default tls templating, fix imagetag …
gerardcl Jul 17, 2024
3c9e765
fix: align tabs on ingress.yaml and update devnotes todo
gerardcl Jul 17, 2024
0658683
feat: docker-plain render Helm chart Chart.yaml file
gerardcl Jul 18, 2024
0b541a8
update devnotes, remove dependencies in Chart.yml for now
segfault16 Aug 2, 2024
d6d7121
Merge branch 'master' into docker-plain-helm-chart
segfault16 Aug 2, 2024
b97f813
update changelog
segfault16 Aug 2, 2024
8b87c2c
enable chart testing and enable deploymentStrategy to be set via valu…
gerardcl Aug 21, 2024
b2452c0
avoid dependency on Jenkins lib only provided image values - enable c…
gerardcl Aug 21, 2024
6148c67
fix: add missing tpl for serviceAccount
segfault16 Aug 27, 2024
2b4a064
fix no property error
BraisVQ Sep 5, 2024
9b6e866
fix
BraisVQ Sep 5, 2024
37271df
skip SA creation on default, use chart fullname
segfault16 Sep 5, 2024
b64fd82
Change to nginxinc image
BraisVQ Sep 5, 2024
4b74140
Merge branch 'master' into docker-plain-helm-chart
BraisVQ Sep 5, 2024
6cd786f
Specify selector for Release manager pipeline
BraisVQ Sep 6, 2024
1d9ff9c
Remove value
segfault16 Sep 10, 2024
865c738
use nginx image from redhat
segfault16 Sep 17, 2024
be71448
move image name logic to _image.tpl, make registry optional
segfault16 Sep 17, 2024
f445e25
Update readme, switch to ImagePullStrategy: IfNotPresent
segfault16 Sep 17, 2024
00ceccd
Provide initial values files for environments
segfault16 Sep 17, 2024
4485450
more strict schema
segfault16 Sep 19, 2024
818e13f
update image
segfault16 Sep 20, 2024
6bf18ed
docker-plain add helm lint and helm template processing howto info in…
gerardcl Sep 20, 2024
11871d4
Update OS package by default
BraisVQ Sep 23, 2024
a4c338a
docker-plain: add HorizontalPodAutoscaler
faust2199 Nov 27, 2024
e3e6552
docker-plain: use nginx/nginx-unprivileged
faust2199 Nov 28, 2024
167397b
docker-plain: add simpleHost to chart/values.yaml
faust2199 Nov 28, 2024
fe5fa7f
docker-plain: allow additionalProperties; make use of .Values.service…
faust2199 Nov 28, 2024
6c58ed7
Revert "docker-plain: add simpleHost to chart/values.yaml"
faust2199 Nov 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docker-plain/files/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Plain Docker image (docker-plain)

## Purpose

This Quickstarter serves as a minimal starting point for building your own components that don't fit any of the other Quickstarters.
For demonstration purposes, a nginx webserver provides a simple 'Hello World' message.

## Folder structure and important files

- docker: All files inside this folder are available for use in building the docker container
- [docker/Dockerfile](docker/Dockerfile): Defines the container to be built.
- chart: The Helm chart used for deploying the component.
- [chart/Chart.yaml](chart/Chart.yaml): Metadata for your Helm chart.
- [chart/values.yaml](chart/values.yaml): Default values used when templating the Helm chart.
- [chart/values.dev.yaml](chart/values.dev.yaml): Values used for deployment in the 'dev' environment. Values specified in this file are overriding default values from [chart/values.yaml](chart/values.yaml).
- chart/templates:
- [chart/templates/deployment.yaml](chart/templates/deployment.yaml): Template for the [deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) resource. This is where you add additional configuration like environment variables.
- [chart/templates/service.yaml](chart/templates/service.yaml): Template for the [service](https://kubernetes.io/docs/concepts/services-networking/service/) resource.
- [chart/templates/ingress.yaml](chart/templates/ingress.yaml): Template for the [ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) resource.

## Testing locally

If you want to run this component locally for testing, this might get you started.
It also mimicks what's happening in the [Jenkinsfile](Jenkinsfile).

### Building the container

Using a local container runtime you can build the container and tag it with the current git revision:

```bash
docker build -t testing/my-component:$(git rev-parse --short=8 HEAD) docker/
```

### Deploying the helm chart using

Using a local kubernetes cluster you can deploy the component:

```bash
kubectl create ns docker-plain
kind load docker-image testing/my-component:$(git rev-parse --short=8 HEAD)
helm upgrade --install --wait --atomic --namespace docker-plain --set image.path=testing --set image.name=my-component --set image.tag=$(git rev-parse --short=8 HEAD) docker-plain chart
```

## How to create a custom jenkins-agent out of this docker-plain component
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needed?

- Remove `odsComponentStageRolloutOpenShiftDeployment(context)` from your `Jenkinsfile`. We only want to build a docker image, not run it outside the pipeline.
- 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`.
Expand Down
12 changes: 6 additions & 6 deletions docker-plain/files/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ fullnameOverride: ""
# NOTE: By default image Values are injected from CICD Jenkins pipeline, values defined here are used when not being on CICD Jenkins pipeline context.
# Default values here are provided in case one needs to use the chart without CICD (i.e.: testing the chart).
image:
registry: "docker.io"
path: "nginxinc"
name: "nginx-unprivileged"
tag: "latest"
# You might consider using `IfNotPresent` policy, see https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
pullPolicy: Always
# registry: "docker.io"
# path: "nginxinc"
# name: "nginx-unprivileged"
# tag: "latest"
# see https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
pullPolicy: IfNotPresent

## Prefer using ingress over openshift routes
ingress:
Expand Down