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:
@@ -12,9 +12,7 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
PUPPETDB_HOST: "puppetdb"
|
PUPPETDB_HOST: "puppetdb"
|
||||||
PUPPETDB_PORT: "8081"
|
PUPPETDB_PORT: "8081"
|
||||||
PUPPETDB_SSL_VERIFY: "/opt/puppetboard/ssl/ca.pem"
|
PUPPETDB_SSL_SKIP_VERIFY: "True"
|
||||||
PUPPETDB_KEY: "/opt/puppetboard/ssl/puppetboard.key"
|
|
||||||
PUPPETDB_CERT: "/opt/puppetboard/ssl/puppetboard.pem"
|
|
||||||
LOGLEVEL: "debug"
|
LOGLEVEL: "debug"
|
||||||
PUPPETDB_TIMEOUT: "20"
|
PUPPETDB_TIMEOUT: "20"
|
||||||
UNRESPONSIVE_HOURS: "3"
|
UNRESPONSIVE_HOURS: "3"
|
||||||
|
|||||||
@@ -39,26 +39,14 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8140
|
- containerPort: 8140
|
||||||
name: puppetserver
|
name: puppetserver
|
||||||
envFrom: null
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: puppetserver-compiler-config
|
||||||
env:
|
env:
|
||||||
- name: OPENVOXSERVER_HOSTNAME
|
- name: OPENVOXSERVER_HOSTNAME
|
||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.name
|
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:
|
livenessProbe:
|
||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
periodSeconds: 30
|
periodSeconds: 30
|
||||||
@@ -107,6 +95,36 @@ spec:
|
|||||||
name: eyaml-keys
|
name: eyaml-keys
|
||||||
readOnly: true
|
readOnly: true
|
||||||
initContainers:
|
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:
|
- args:
|
||||||
- mkdir -p /etc/puppetlabs/puppet/eyaml/keys;
|
- mkdir -p /etc/puppetlabs/puppet/eyaml/keys;
|
||||||
mkdir -p /etc/puppetlabs/code/environments;
|
mkdir -p /etc/puppetlabs/code/environments;
|
||||||
@@ -170,5 +188,17 @@ spec:
|
|||||||
secret:
|
secret:
|
||||||
secretName: eyaml-keys
|
secretName: eyaml-keys
|
||||||
defaultMode: 0600
|
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:
|
strategy:
|
||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
scaleTargetRef:
|
scaleTargetRef:
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: Deployment
|
||||||
name: puppetserver-compiler
|
name: puppetserver-compiler
|
||||||
minReplicas: 2
|
minReplicas: 2
|
||||||
maxReplicas: 5
|
maxReplicas: 5
|
||||||
|
|||||||
@@ -37,12 +37,20 @@ configMapGenerator:
|
|||||||
- name: compiler-autosign.conf
|
- name: compiler-autosign.conf
|
||||||
files:
|
files:
|
||||||
- resources/compiler/autosign.conf
|
- resources/compiler/autosign.conf
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
- name: compiler-puppet.conf
|
- name: compiler-puppet.conf
|
||||||
files:
|
files:
|
||||||
- resources/compiler/puppet.conf
|
- resources/compiler/puppet.conf
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
- name: compiler-puppetdb.conf
|
- name: compiler-puppetdb.conf
|
||||||
files:
|
files:
|
||||||
- resources/compiler/puppetdb.conf
|
- resources/compiler/puppetdb.conf
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
- name: puppet-cobbler-enc
|
- name: puppet-cobbler-enc
|
||||||
files:
|
files:
|
||||||
- resources/cobbler-enc
|
- resources/cobbler-enc
|
||||||
|
options:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
|||||||
Reference in New Issue
Block a user