bf4d7e8efc
complete the implementation of puppet in kubernetes, taking many features from the openvox helm chart and improving on them. changes from helm are: - using vault for storing secrets - using g10k instead of r10k - using a single shared g10k cronjob for all masters/compilers - using a single shared /etc/puppetlabs/code directory (shared, cephfs) changes: - deploy puppet master and compiler servers with statefulset/deployment - deploy puppetdb with postgresql backend, taking advantage of cnpg cluster and pooler - deploy puppetboard - all supporting configmaps, services, ingresses, and hpas - added vaultstaticsecret for eyaml private keys - configured secure mounting of eyaml keys at /var/lib/puppet/keys/ - updated base kustomization to include all 23 new puppet resource files
152 lines
4.4 KiB
YAML
152 lines
4.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/component: puppetdb
|
|
app.kubernetes.io/instance: puppetserver
|
|
app.kubernetes.io/name: puppetserver
|
|
app.kubernetes.io/version: 8.8.0
|
|
name: puppetdb
|
|
namespace: puppet
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/component: puppetdb
|
|
app.kubernetes.io/name: puppetserver
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxUnavailable: 1
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
reloader.stakater.com/auto: "true"
|
|
labels:
|
|
app.kubernetes.io/component: puppetdb
|
|
app.kubernetes.io/instance: puppetserver
|
|
app.kubernetes.io/name: puppetserver
|
|
app.kubernetes.io/version: 8.8.0
|
|
spec:
|
|
hostname: puppetdb
|
|
imagePullSecrets: null
|
|
containers:
|
|
- name: puppetdb
|
|
image: ghcr.io/openvoxproject/openvoxdb:8.9.0-main
|
|
imagePullPolicy: IfNotPresent
|
|
resources:
|
|
limits:
|
|
cpu: 1
|
|
memory: 1536Mi
|
|
requests:
|
|
cpu: 250m
|
|
memory: 512Mi
|
|
ports:
|
|
- containerPort: 8080
|
|
name: pdb-http
|
|
- containerPort: 8081
|
|
name: pdb-https
|
|
envFrom:
|
|
- configMapRef:
|
|
name: puppetdb-config
|
|
env:
|
|
- name: OPENVOXDB_POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: password
|
|
name: postgres-credentials
|
|
- name: OPENVOXDB_POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
key: username
|
|
name: postgres-credentials
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
capabilities:
|
|
add:
|
|
- CAP_FOWNER
|
|
- CAP_CHOWN
|
|
- CAP_SETUID
|
|
- CAP_SETGID
|
|
- CAP_DAC_OVERRIDE
|
|
- FOWNER
|
|
- CHOWN
|
|
- SETUID
|
|
- SETGID
|
|
- DAC_OVERRIDE
|
|
drop:
|
|
- all
|
|
volumeMounts:
|
|
- mountPath: /opt/puppetlabs/server/data/puppetdb
|
|
name: puppetdb-storage
|
|
initContainers:
|
|
- name: create-log-dir
|
|
image: docker.io/busybox:1.37
|
|
command:
|
|
- sh
|
|
- -c
|
|
- mkdir -p /opt/puppetlabs/server/data/puppetdb/logs && chown 999:999 /opt/puppetlabs/server/data/puppetdb/logs
|
|
volumeMounts:
|
|
- mountPath: /opt/puppetlabs/server/data/puppetdb
|
|
name: puppetdb-storage
|
|
securityContext:
|
|
runAsUser: 0
|
|
resources:
|
|
limits:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
requests:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
- command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
echo 'Waiting for PostgreSQL to become ready...'
|
|
until printf "." && nc -z -w 2 puppet-postgres-pooler 5432; do
|
|
sleep 2;
|
|
done;
|
|
echo 'PostgreSQL OK ✓'
|
|
image: docker.io/busybox:1.37
|
|
imagePullPolicy: IfNotPresent
|
|
name: pgchecker
|
|
resources:
|
|
limits:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
requests:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
runAsGroup: 1000
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
- command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
echo 'Waiting for puppetserver to become ready...'
|
|
until printf "." && curl --silent --fail --insecure 'https://puppetserver-puppet:8140/status/v1/simple' | grep -q '^running$'; do
|
|
sleep 2;
|
|
done;
|
|
echo 'Puppetserver OK ✓'
|
|
image: curlimages/curl:8.11.1
|
|
imagePullPolicy: IfNotPresent
|
|
name: wait-puppetserver
|
|
resources:
|
|
limits:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
requests:
|
|
cpu: 20m
|
|
memory: 32Mi
|
|
securityContext:
|
|
allowPrivilegeEscalation: false
|
|
runAsGroup: 1000
|
|
runAsNonRoot: true
|
|
runAsUser: 1000
|
|
volumes:
|
|
- name: puppetdb-storage
|
|
persistentVolumeClaim:
|
|
claimName: puppetserver-puppetdb-claim
|