refactor: convert puppetserver compilers to deployment with configmap integration
- Convert StatefulSet to Deployment for better scaling flexibility - Add initContainer to copy configmaps to shared RWX volume (10GB) - Integrate puppetserver-compiler-config configmap for environment variables - Configure configMapGenerator with stable names (disableNameSuffixHash) - Update HPA to target Deployment instead of StatefulSet - Simplify puppetboard SSL config to skip verification for internal connections
This commit is contained in:
@@ -39,26 +39,14 @@ spec:
|
||||
ports:
|
||||
- containerPort: 8140
|
||||
name: puppetserver
|
||||
envFrom: null
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: puppetserver-compiler-config
|
||||
env:
|
||||
- name: OPENVOXSERVER_HOSTNAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: OPENVOXSERVER_PORT
|
||||
value: "8140"
|
||||
- name: DNS_ALT_NAMES
|
||||
value: puppetserver-compiler-0,puppetserver-compiler-1,puppetserver-compiler-2,puppetserver-compiler-3,puppetserver-compiler-4,puppet-headless,puppet,puppet.k8s.syd1.au.unkin.net
|
||||
- name: OPENVOXDB_SERVER_URLS
|
||||
value: https://puppetdb:8081
|
||||
- name: CA_ENABLED
|
||||
value: "false"
|
||||
- name: CA_HOSTNAME
|
||||
value: puppetca
|
||||
- name: CA_PORT
|
||||
value: "8140"
|
||||
- name: PUPPETSERVER_JAVA_ARGS
|
||||
value: -Xms1024m -Xmx3072m -Dcom.sun.management.jmxremote.port=31000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
periodSeconds: 30
|
||||
@@ -107,6 +95,36 @@ spec:
|
||||
name: eyaml-keys
|
||||
readOnly: true
|
||||
initContainers:
|
||||
- name: copy-configmaps
|
||||
image: busybox:1.35
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
args:
|
||||
- |
|
||||
echo "Copying configmap files to shared volume..."
|
||||
mkdir -p /etc/puppetlabs/puppet
|
||||
cp /configmaps/puppet.conf /etc/puppetlabs/puppet/puppet.conf
|
||||
cp /configmaps/puppetdb.conf /etc/puppetlabs/puppet/puppetdb.conf
|
||||
cp /configmaps/autosign.conf /etc/puppetlabs/puppet/autosign.conf
|
||||
cp /configmaps/cobbler-enc /etc/puppetlabs/puppet/cobbler-enc
|
||||
chmod +x /etc/puppetlabs/puppet/cobbler-enc
|
||||
echo "Configmap files copied successfully"
|
||||
volumeMounts:
|
||||
- mountPath: /etc/puppetlabs/puppet/
|
||||
name: puppet-puppet-volume
|
||||
- mountPath: /configmaps/puppet.conf
|
||||
name: compiler-puppet-conf
|
||||
subPath: puppet.conf
|
||||
- mountPath: /configmaps/puppetdb.conf
|
||||
name: compiler-puppetdb-conf
|
||||
subPath: puppetdb.conf
|
||||
- mountPath: /configmaps/autosign.conf
|
||||
name: compiler-autosign-conf
|
||||
subPath: autosign.conf
|
||||
- mountPath: /configmaps/cobbler-enc
|
||||
name: puppet-cobbler-enc
|
||||
subPath: cobbler-enc
|
||||
- args:
|
||||
- mkdir -p /etc/puppetlabs/puppet/eyaml/keys;
|
||||
mkdir -p /etc/puppetlabs/code/environments;
|
||||
@@ -170,5 +188,17 @@ spec:
|
||||
secret:
|
||||
secretName: eyaml-keys
|
||||
defaultMode: 0600
|
||||
- name: compiler-puppet-conf
|
||||
configMap:
|
||||
name: compiler-puppet.conf
|
||||
- name: compiler-puppetdb-conf
|
||||
configMap:
|
||||
name: compiler-puppetdb.conf
|
||||
- name: compiler-autosign-conf
|
||||
configMap:
|
||||
name: compiler-autosign.conf
|
||||
- name: puppet-cobbler-enc
|
||||
configMap:
|
||||
name: puppet-cobbler-enc
|
||||
strategy:
|
||||
type: RollingUpdate
|
||||
|
||||
Reference in New Issue
Block a user