Skip to content

Commit

Permalink
Fix csr_attributes to use env variable
Browse files Browse the repository at this point in the history
This branch is currently pending a PR before merging

voxpupuli/container-puppetserver#69
  • Loading branch information
mdechiaro committed Feb 10, 2024
1 parent 6e4680a commit 6f99f76
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 56 deletions.
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
31 changes: 3 additions & 28 deletions puppet/puppetca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <<EOF>> /etc/puppetlabs/puppet/csr_attributes.yaml
---
extension_requests:
pp_apptier: prd
pp_role: puppetca
EOF
---
# puppetca deployment
apiVersion: apps/v1
Expand All @@ -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:
Expand All @@ -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
10 changes: 3 additions & 7 deletions puppet/puppetdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
22 changes: 3 additions & 19 deletions puppet/puppetserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 6f99f76

Please sign in to comment.