1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
pterodactyl-on-k8s/charts/pterodactyl-panel/templates/nginx/deployment.yaml
Vojtech Mares eeada0e25d
Some checks are pending
Release Docs / Release Docs (push) Waiting to run
Release / Build and publish a Docker image / build-and-push-image (push) Waiting to run
chore: wip
2024-05-01 07:47:42 +02:00

108 lines
2.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "pterodactyl-panel.fullname" . }}--nginx
labels:
app.kubernetes.io/name: nginx
app.kubernetes.io/version: "{{ .Values.nginx.image.tag }}"
app.kubernetes.io/component: reverse-proxy
app.kubernetes.io/part-of: pterodactyl-panel
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.nginx.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "pterodactyl-panel.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.nginx.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pterodactyl-panel.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.nginx.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "pterodactyl-panel.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.nginx.podSecurityContext | nindent 8 }}
terminationGracePeriodSeconds: 30
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.nginx.securityContext | nindent 12 }}
image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}"
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
args:
- /bin/sh
- -c
- |
nginx -g "daemon off";
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- sleep 5 && /usr/sbin/nginx
- -s
- quit
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
exec:
command:
- /bin/sh
- -c
- "[ -f /var/run/nginx.pid ] && ps -A | grep nginx"
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.nginx.resources | nindent 12 }}
volumeMounts:
- mountPath: /var/cache/nginx
name: cache
- mountPath: /var/run
name: pid
volumes:
- name: cache
emptyDir: {}
- name: pid
emptyDir: {}
{{- with .Values.nginx.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nginx.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nginx.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}