From 6f99f76b0259ade868bb4d57d521b8cc85dc0972 Mon Sep 17 00:00:00 2001 From: Mark Dechiaro Date: Sat, 10 Feb 2024 10:12:02 -0600 Subject: [PATCH] Fix csr_attributes to use env variable This branch is currently pending a PR before merging https://github.com/voxpupuli/container-puppetserver/pull/69 --- README | 4 ++-- puppet/puppetca.yaml | 31 +++---------------------------- puppet/puppetdb.yaml | 10 +++------- puppet/puppetserver.yaml | 22 +++------------------- 4 files changed, 11 insertions(+), 56 deletions(-) diff --git a/README b/README index ac425fd..9bb2d3f 100644 --- a/README +++ b/README @@ -31,8 +31,8 @@ default puppetserver-6d56786d58-qc2x5 1/1 Running 0 ``` minikube image load registry.k8s.io/e2e-test-images/jessie-dnsutils:1.3 -minikube image load ghcr.io/voxpupuli/container-puppetdb -minikube image load ghcr.io/voxpupuli/container-puppetserver +minikube image load ghcr.io/voxpupuli/container-puppetdb:8.3.0-latest +minikube image load ghcr.io/voxpupuli/container-puppetserver:8.4.0-latest minikube image load postgres ``` diff --git a/puppet/puppetca.yaml b/puppet/puppetca.yaml index 98ffb4b..55f1de4 100644 --- a/puppet/puppetca.yaml +++ b/puppet/puppetca.yaml @@ -13,18 +13,6 @@ spec: port: 8140 type: LoadBalancer --- -# workaround for https://github.com/voxpupuli/container-puppetserver/issues/50 -apiVersion: v1 -kind: ConfigMap -metadata: - name: csr-attributes-yaml-configmap -data: - csr_attributes.yaml: | - --- - extension_requests: - pp_apptier: prd - pp_role: puppetca ---- # puppetca init scripts configmap apiVersion: v1 kind: ConfigMap @@ -35,15 +23,6 @@ data: #!/usr/bin/env bash # workaround for https://github.com/voxpupuli/container-puppetserver/issues/51 /opt/puppetlabs/bin/puppet config set server "puppet.default.svc.cluster.local" - 50-setup-csr-attributes.sh: | - #!/usr/bin/env bash - - cat <> /etc/puppetlabs/puppet/csr_attributes.yaml - --- - extension_requests: - pp_apptier: prd - pp_role: puppetca - EOF --- # puppetca deployment apiVersion: apps/v1 @@ -64,7 +43,7 @@ spec: spec: containers: - name: puppetca - image: ghcr.io/voxpupuli/container-puppetserver + image: ghcr.io/voxpupuli/container-puppetserver:8.4.0-latest env: - name: POD_METADATA_NAME valueFrom: @@ -82,20 +61,16 @@ spec: value: puppetca.default.svc.cluster.local - name: PUPPETSERVER_HOSTNAME value: "$(POD_METADATA_NAME).default.svc.cluster.local" + - name: CSR_ATTRIBUTES + value: '{"extension_requests": { "pp_apptier": "prd", "pp_role": "puppetca" } }' ports: - name: puppetca containerPort: 8140 volumeMounts: - name: docker-entrypoint-configmap mountPath: /docker-custom-entrypoint.d - - name: setup-csr-attributes-yaml - mountPath: /etc/puppetlabs/puppet/csr_attributes.yaml - subPath: csr_attributes.yaml volumes: - name: docker-entrypoint-configmap configMap: name: puppetca-docker-entrypoint-configmap defaultMode: 0500 - - name: setup-csr-attributes-yaml - configMap: - name: csr-attributes-yaml-configmap diff --git a/puppet/puppetdb.yaml b/puppet/puppetdb.yaml index 84dd8a5..5f084b0 100644 --- a/puppet/puppetdb.yaml +++ b/puppet/puppetdb.yaml @@ -63,7 +63,7 @@ spec: spec: containers: - name: puppetdb - image: ghcr.io/voxpupuli/container-puppetdb + image: ghcr.io/voxpupuli/container-puppetdb:8.3.0-latest env: - name: POD_METADATA_NAME valueFrom: @@ -77,20 +77,16 @@ spec: value: puppetdb.default.svc.cluster.local - name: PUPPETDB_JAVA_ARGS value: -Djava.net.preferIPv4Stack=true -Xms256m -Xmx256m -XX:+UseParallelGC -Xlog:gc:/opt/puppetlabs/server/data/puppetdb/puppetdb_gc.log -Djdk.tls.ephemeralDHKeySize=2048 + - name: CSR_ATTRIBUTES + value: '{"extension_requests": { "pp_apptier": "prd", "pp_role": "puppetdb" } }' ports: - name: puppetdb-https containerPort: 8081 volumeMounts: - name: docker-entrypoint-configmap mountPath: /docker-custom-entrypoint.d - - name: setup-csr-attributes-yaml - mountPath: /etc/puppetlabs/puppet/csr_attributes.yaml - subPath: csr_attributes.yaml volumes: - name: docker-entrypoint-configmap configMap: name: puppetdb-docker-entrypoint-configmap defaultMode: 0500 - - name: setup-csr-attributes-yaml - configMap: - name: csr-attributes-yaml-configmap diff --git a/puppet/puppetserver.yaml b/puppet/puppetserver.yaml index 2866484..508773e 100644 --- a/puppet/puppetserver.yaml +++ b/puppet/puppetserver.yaml @@ -13,18 +13,6 @@ spec: port: 8140 type: LoadBalancer --- -# workaround for https://github.com/voxpupuli/container-puppetserver/issues/50 -apiVersion: v1 -kind: ConfigMap -metadata: - name: csr-attributes-yaml-configmap -data: - csr_attributes.yaml: | - --- - extension_requests: - pp_apptier: prd - pp_role: puppetserver ---- # puppetserver init scripts configmap apiVersion: v1 kind: ConfigMap @@ -69,7 +57,7 @@ spec: spec: containers: - name: puppetserver - image: ghcr.io/voxpupuli/container-puppetserver + image: ghcr.io/voxpupuli/container-puppetserver:8.4.0-latest env: - name: POD_METADATA_NAME valueFrom: @@ -85,20 +73,16 @@ spec: value: puppet.default.svc.cluster.local - name: PUPPETSERVER_HOSTNAME value: "$(POD_METADATA_NAME).default.svc.cluster.local" + - name: CSR_ATTRIBUTES + value: '{"extension_requests": { "pp_apptier": "prd", "pp_role": "puppetserver" } }' ports: - name: puppetserver containerPort: 8140 volumeMounts: - name: docker-entrypoint-configmap mountPath: /docker-custom-entrypoint.d - - name: setup-csr-attributes-yaml - mountPath: /etc/puppetlabs/puppet/csr_attributes.yaml - subPath: csr_attributes.yaml volumes: - name: docker-entrypoint-configmap configMap: name: puppetserver-docker-entrypoint-configmap defaultMode: 0500 - - name: setup-csr-attributes-yaml - configMap: - name: csr-attributes-yaml-configmap