frp/charts/frpc/templates/deployment.yaml
2024-04-16 08:30:28 +00:00

86 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "frpc.fullname" . }}
labels:
{{- include "frpc.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "frpc.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "frpc.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "frpc.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-c"
- "/var/frp/conf/frpc.yaml"
ports:
- name: dashboard
containerPort: {{ .Values.config.webServer.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
- mountPath: /var/frp/conf
name: config
{{- if ne .Values.mTLS.trustedCA "" }}
- mountPath: /var/frp/tls
name: tls
{{- end }}
{{- if .Values.mTLS.enabled}}
- mountPath: /var/frp/mtls
name: mtls
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "frpc.fullname" . }}
{{- if ne .Values.mTLS.trustedCA "" }}
- name: tls
secret:
secretName: {{ printf "%s-ca" (include "frpc.fullname" .) }}
{{- end }}
{{- if .Values.mTLS.enabled}}
- name: mtls
secret:
secretName: {{ .Values.mTLS.existingSecret | default (printf "%s-client-ca" (include "frpc.fullname" .)) }}
items:
- key: tls.crt
path: tls.crt
- key: tls.key
path: tls.key
{{- end }}