From 976792818aeb5b5175f49546888f315c8cba2d64 Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 20 Mar 2024 12:04:55 +0100 Subject: [PATCH 1/3] #71 Add volume mount for dogu registry cert This mount is needed because in dev environments the dogu registry always contains a self-signed certificate. Without the mount the blueprint-operator throws an error querying dogu jsons. --- CHANGELOG.md | 2 ++ k8s/helm/templates/deployment.yaml | 11 ++++++++++- k8s/helm/values.yaml | 3 +++ main.go | 4 ++-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb59aa94..e5c4f1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- [71] Add optional volume mount for self-signed certificate for the dogu registry. ## [v0.1.0] - 2024-03-20 ### Added diff --git a/k8s/helm/templates/deployment.yaml b/k8s/helm/templates/deployment.yaml index fa455770..bac5e3ee 100644 --- a/k8s/helm/templates/deployment.yaml +++ b/k8s/helm/templates/deployment.yaml @@ -99,9 +99,18 @@ spec: drop: - ALL imagePullPolicy: {{ .Values.manager.imagePullPolicy }} + volumeMounts: + - mountPath: /etc/ssl/certs/dogu-registry-cert.pem + name: dogu-registry-cert + subPath: dogu-registry-cert.pem securityContext: runAsNonRoot: true seccompProfile: type: RuntimeDefault serviceAccountName: {{ include "k8s-blueprint-operator.name" . }}-controller-manager - terminationGracePeriodSeconds: 10 \ No newline at end of file + terminationGracePeriodSeconds: 10 + volumes: + - name: dogu-registry-cert + secret: + optional: true + secretName: {{ .Values.doguRegistry.certificate.secret }} \ No newline at end of file diff --git a/k8s/helm/values.yaml b/k8s/helm/values.yaml index db2b40b6..ee524550 100644 --- a/k8s/helm/values.yaml +++ b/k8s/helm/values.yaml @@ -33,3 +33,6 @@ healthConfig: wait: timeout: 10m interval: 10s +doguRegistry: + certificate: + secret: dogu-registry-cert diff --git a/main.go b/main.go index 5faaa587..7796c56d 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,7 @@ import ( k8sv1 "github.com/cloudogu/k8s-blueprint-operator/pkg/adapter/kubernetes/blueprintcr/v1" "github.com/cloudogu/k8s-blueprint-operator/pkg/adapter/reconciler" "github.com/cloudogu/k8s-blueprint-operator/pkg/config" - //+kubebuilder:scaffold:imports + // +kubebuilder:scaffold:imports ) var ( @@ -49,7 +49,7 @@ func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) utilruntime.Must(k8sv1.AddToScheme(scheme)) - //+kubebuilder:scaffold:scheme + // +kubebuilder:scaffold:scheme } func main() { From 27cfc01ece1c2f244e753baebfc5acd3036732f5 Mon Sep 17 00:00:00 2001 From: Robert Auer Date: Wed, 20 Mar 2024 13:18:05 +0100 Subject: [PATCH 2/3] Bump version --- Dockerfile | 2 +- Makefile | 2 +- k8s/helm/component-patch-tpl.yaml | 2 +- k8s/helm/values.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index c499cefa..85dd724b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ RUN make compile-generic FROM gcr.io/distroless/static:nonroot LABEL maintainer="hello@cloudogu.com" \ NAME="k8s-blueprint-operator" \ - VERSION="0.1.0" + VERSION="0.2.0" WORKDIR / COPY --from=builder /workspace/target/k8s-blueprint-operator . diff --git a/Makefile b/Makefile index 082ca979..7411c00e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Set these to the desired values ARTIFACT_ID=k8s-blueprint-operator -VERSION=0.1.0 +VERSION=0.2.0 IMAGE=cloudogu/${ARTIFACT_ID}:${VERSION} GOTAG=1.21 MAKEFILES_VERSION=9.0.1 diff --git a/k8s/helm/component-patch-tpl.yaml b/k8s/helm/component-patch-tpl.yaml index 278934ee..56d7f992 100644 --- a/k8s/helm/component-patch-tpl.yaml +++ b/k8s/helm/component-patch-tpl.yaml @@ -1,7 +1,7 @@ apiVersion: v1 values: images: - blueprintOperator: cloudogu/k8s-blueprint-operator:0.1.0 + blueprintOperator: cloudogu/k8s-blueprint-operator:0.2.0 kubeRbacProxy: gcr.io/kubebuilder/kube-rbac-proxy:v0.15.0 patches: values.yaml: diff --git a/k8s/helm/values.yaml b/k8s/helm/values.yaml index ee524550..1e52e529 100644 --- a/k8s/helm/values.yaml +++ b/k8s/helm/values.yaml @@ -2,7 +2,7 @@ manager: replicas: 1 image: repository: cloudogu/k8s-blueprint-operator - tag: 0.1.0 + tag: 0.2.0 imagePullPolicy: IfNotPresent env: logLevel: info From b5c7903bca82667203c39a39f52fa514fceab81b Mon Sep 17 00:00:00 2001 From: Robert Auer Date: Wed, 20 Mar 2024 13:18:24 +0100 Subject: [PATCH 3/3] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c4f1c8..577f6e85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] + +## [v0.2.0] - 2024-03-20 ### Added - [71] Add optional volume mount for self-signed certificate for the dogu registry.