helm: use deployment instead of pod template

This commit is contained in:
Jeff Mahoney 2024-08-27 10:15:11 -04:00
parent d6bdf80fdb
commit 12da0fcfe3
2 changed files with 57 additions and 35 deletions

View File

@ -0,0 +1,57 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: radvd-deployment-{{ .Release.Name }}
labels:
app: radvd-{{ .Release.Name }}
spec:
replicas: 1
selector:
matchLabels:
app: radvd-{{ .Release.Name }}
template:
metadata:
labels:
app: radvd-{{ .Release.Name }}
annotations: # Forces pod recreation on upgrade with changes
checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
spec:
hostNetwork: true
containers:
- name: radvd
image: registry.opensuse.org/home/jeff_mahoney/containers/15.6/radvd:2.17
command:
- "/usr/sbin/radvd"
- "-n"
- "-C"
- "/etc/radvd/radvd.conf"
- "-m"
- "stderr"
- "-d"
{{- if .Values.debugLevel }}
- {{ .Values.debugLevel | quote }}
{{ else }}
- "1"
{{- end }}
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
- NET_RAW
volumeMounts:
- name: config
mountPath: /etc/radvd
readOnly: true
volumes:
- name: config
configMap:
# Provide the name of the ConfigMap containing the files you want
# to add to the container
name: {{ .Chart.Name}}-config-{{ .Release.Name }}
items:
- key: config
path: radvd.conf
{{- if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 4 }}
{{- end }}

View File

@ -1,35 +0,0 @@
apiVersion: v1
kind: Pod
metadata:
name: radvd
spec:
hostNetwork: true
containers:
- name: radvd
image: radvd
command:
- "/usr/bin/radvd"
- "-C"
- "/etc/radvd.conf"
{{- if .Values.debugLevel }}
- "-d"
- {{- .Values.debugLevel | quote }}
{{- end }}
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
- NET_RAW
volumeMounts:
- name: config-volume
mountPath: /etc/radvd.conf
volumes:
- name: config-volume
configMap:
# Provide the name of the ConfigMap containing the files you want
# to add to the container
name: {{ .Chart.Name}}-config-{{ .Release.Name }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{- .Values.nodeSelector | toYaml | nindent 4 }}
{{- end }}