chore: wip
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
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
This commit is contained in:
parent
491a9cc294
commit
eeada0e25d
17 changed files with 674 additions and 0 deletions
43
charts/pterodactyl-panel/templates/nginx/configmap.yaml
Normal file
43
charts/pterodactyl-panel/templates/nginx/configmap.yaml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nginx-conf
|
||||
data:
|
||||
nginx.conf: |
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /dev/stdout warn;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
log_format json_combined escape=json
|
||||
'{'
|
||||
'"time_local":"$time_local",'
|
||||
'"remote_addr":"$remote_addr",'
|
||||
'"remote_user":"$remote_user",'
|
||||
'"request":"$request",'
|
||||
'"status": "$status",'
|
||||
'"body_bytes_sent":"$body_bytes_sent",'
|
||||
'"request_time":"$request_time",'
|
||||
'"http_referrer":"$http_referer",'
|
||||
'"http_user_agent":"$http_user_agent"'
|
||||
'}';
|
||||
|
||||
access_log /dev/stdout main;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
location / {
|
||||
root html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
}
|
||||
|
||||
include /etc/nginx/virtualhost/virtualhost.conf;
|
||||
}
|
||||
108
charts/pterodactyl-panel/templates/nginx/deployment.yaml
Normal file
108
charts/pterodactyl-panel/templates/nginx/deployment.yaml
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
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 }}
|
||||
28
charts/pterodactyl-panel/templates/nginx/hpa.yaml
Normal file
28
charts/pterodactyl-panel/templates/nginx/hpa.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}--nginx
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}--nginx
|
||||
minReplicas: {{ .Values.nginx.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.nginx.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.nginx.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ .Values.nginx.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.nginx.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ .Values.nginx.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
15
charts/pterodactyl-panel/templates/nginx/service.yaml
Normal file
15
charts/pterodactyl-panel/templates/nginx/service.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}--nginx
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.nginx.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.nginx.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "pterodactyl-panel.selectorLabels" . | nindent 4 }}
|
||||
Reference in a new issue