Compare commits
10 commits
041f5e2a3c
...
eeada0e25d
| Author | SHA1 | Date | |
|---|---|---|---|
| eeada0e25d | |||
| 491a9cc294 | |||
| 311f4fd6d1 | |||
| a27c0b5e9b | |||
| 4553406ee8 | |||
| 7ecb1de169 | |||
| 98d73f01bf | |||
| 78e42f59a9 | |||
| 849766ce8f | |||
| 910b6a5887 |
24 changed files with 799 additions and 17 deletions
6
.github/workflows/docs.yml
vendored
6
.github/workflows/docs.yml
vendored
|
|
@ -30,6 +30,12 @@ jobs:
|
|||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
- name: build and push
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: |
|
||||
mike deploy ${{ github.ref_name }} latest --push --update-aliases
|
||||
mike set-default --push latest
|
||||
- name: build and push
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
run: |
|
||||
mike deploy dev --push --update-aliases
|
||||
mike set-default --push dev
|
||||
|
|
|
|||
42
.github/workflows/nightly.yml
vendored
Normal file
42
.github/workflows/nightly.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
name: Nightly / Build and publish a Docker image
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: acaslab/pterodactyl-panel
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 4 * * *'
|
||||
|
||||
jobs:
|
||||
build-and-push-image:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.nightly
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
name: Create and publish a Docker image
|
||||
name: Release / Build and publish a Docker image
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
|
|
@ -23,7 +23,7 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
|
|
@ -31,7 +31,7 @@ jobs:
|
|||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
|
|
@ -39,6 +39,7 @@ jobs:
|
|||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.release
|
||||
push: true
|
||||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
63
Dockerfile.nightly
Normal file
63
Dockerfile.nightly
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
FROM ubuntu:22.04 as base
|
||||
|
||||
RUN apt update && apt -y install \
|
||||
software-properties-common \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
gnupg \
|
||||
curl
|
||||
|
||||
# Add Ondrej Sury's PPA for PHP
|
||||
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
|
||||
&& apt update
|
||||
|
||||
# Install PHP 8.1
|
||||
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt -y install \
|
||||
php8.1 \
|
||||
php8.1-common \
|
||||
php8.1-cli \
|
||||
php8.1-gd \
|
||||
php8.1-mysql \
|
||||
php8.1-mbstring \
|
||||
php8.1-bcmath \
|
||||
php8.1-xml \
|
||||
php8.1-fpm \
|
||||
php8.1-curl \
|
||||
php8.1-zip \
|
||||
unzip \
|
||||
tar \
|
||||
git
|
||||
|
||||
FROM base as builder
|
||||
|
||||
# Add Node.js 18.x PPA
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | sh -
|
||||
|
||||
# Install Node.js & Yarn to build assets
|
||||
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install nodejs -y && npm i -g yarn
|
||||
|
||||
RUN rm -rf /var/lib/apt && \
|
||||
rm -rf /var/lib/dpkg && \
|
||||
rm -rf /var/lib/cache && \
|
||||
rm -rf /var/lib/log
|
||||
|
||||
# Install composer
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
# Download the Pterodactyl Panel
|
||||
RUN git clone https://github.com/pterodactyl/panel.git /var/www/pterodactyl
|
||||
|
||||
WORKDIR /var/www/pterodactyl
|
||||
|
||||
# Install Node.js dependencies & build assets
|
||||
RUN yarn install --frozen-lockfile && yarn run build
|
||||
|
||||
# Install PHP dependencies
|
||||
RUN composer install --no-dev --optimize-autoloader
|
||||
|
||||
FROM base as app
|
||||
|
||||
WORKDIR /var/www/pterodactyl
|
||||
USER www-data
|
||||
|
||||
COPY --from=builder --chown=www-data:www-data /var/www/pterodactyl /var/www/pterodactyl
|
||||
|
|
@ -2,14 +2,14 @@ FROM ubuntu:22.04 as base
|
|||
|
||||
RUN apt update && apt -y install \
|
||||
software-properties-common \
|
||||
curl apt-transport-https \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
gnupg
|
||||
gnupg \
|
||||
curl
|
||||
|
||||
# Add Ondrej Sury's PPA for PHP
|
||||
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php
|
||||
|
||||
RUN apt update
|
||||
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php \
|
||||
&& apt update
|
||||
|
||||
# Install PHP 8.1
|
||||
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt -y install \
|
||||
|
|
@ -24,8 +24,8 @@ RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt -y install \
|
|||
php8.1-fpm \
|
||||
php8.1-curl \
|
||||
php8.1-zip \
|
||||
tar \
|
||||
unzip \
|
||||
tar \
|
||||
git
|
||||
|
||||
RUN rm -rf /var/lib/apt && \
|
||||
|
|
@ -53,12 +53,9 @@ RUN tar -xzvf panel.tar.gz
|
|||
# Install dependencies
|
||||
RUN composer install --no-dev --optimize-autoloader
|
||||
|
||||
# Change the owner of the files, recursively
|
||||
RUN chown -R www-data:www-data /var/www/pterodactyl
|
||||
|
||||
FROM base as app
|
||||
|
||||
WORKDIR /var/www/pterodactyl
|
||||
USER www-data
|
||||
|
||||
COPY --from=builder /var/www/pterodactyl /var/www/ptereodactyl
|
||||
COPY --from=builder --chown=www-data:www-data /var/www/pterodactyl /var/www/pterodactyl
|
||||
|
|
@ -8,4 +8,4 @@ Currently this project is work-in-progress and is not considered production read
|
|||
|
||||
## Docs
|
||||
|
||||
https://docs.acaslab.com/pterodactyl-on-k8s
|
||||
https://acaslab.github.io/pterodactyl-on-k8s/
|
||||
|
|
|
|||
23
charts/pterodactyl-panel/.helmignore
Normal file
23
charts/pterodactyl-panel/.helmignore
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
7
charts/pterodactyl-panel/Chart.yaml
Normal file
7
charts/pterodactyl-panel/Chart.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
apiVersion: v2
|
||||
name: pterodactyl-panel
|
||||
description: Pterodactyl Panel Helm chart
|
||||
kubeVersion: ">=1.24.0"
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.10.1"
|
||||
22
charts/pterodactyl-panel/templates/NOTES.txt
Normal file
22
charts/pterodactyl-panel/templates/NOTES.txt
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "pterodactyl-panel.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "pterodactyl-panel.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "pterodactyl-panel.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "pterodactyl-panel.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||
{{- end }}
|
||||
62
charts/pterodactyl-panel/templates/_helpers.tpl
Normal file
62
charts/pterodactyl-panel/templates/_helpers.tpl
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "pterodactyl-panel.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "pterodactyl-panel.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "pterodactyl-panel.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "pterodactyl-panel.labels" -}}
|
||||
helm.sh/chart: {{ include "pterodactyl-panel.chart" . }}
|
||||
{{ include "pterodactyl-panel.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "pterodactyl-panel.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "pterodactyl-panel.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "pterodactyl-panel.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "pterodactyl-panel.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
44
charts/pterodactyl-panel/templates/cron/cronjob.yaml
Normal file
44
charts/pterodactyl-panel/templates/cron/cronjob.yaml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: php-cli
|
||||
app.kubernetes.io/version: "{{ .Values.phpfpm.image.tag | default .Chart.AppVersion }}"
|
||||
app.kubernetes.io/component: backend-cronjob
|
||||
app.kubernetes.io/part-of: pterodactyl-panel
|
||||
|
||||
spec:
|
||||
schedule: "* * * * *"
|
||||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 4
|
||||
activeDeadlineSeconds: 60
|
||||
ttlSecondsAfterFinished: 900
|
||||
|
||||
template:
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "pterodactyl-panel.serviceAccountName" . }}
|
||||
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
resources:
|
||||
{{- toYaml .Values.cron.resources | nindent 14 }}
|
||||
command: ["php"]
|
||||
args:
|
||||
- /var/www/pterodactyl/artisan
|
||||
- schedule:run
|
||||
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}-config
|
||||
- secretRef:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}-credentials
|
||||
|
||||
restartPolicy: OnFailure
|
||||
41
charts/pterodactyl-panel/templates/ingress.yaml
Normal file
41
charts/pterodactyl-panel/templates/ingress.yaml
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "pterodactyl-panel.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ .path }}
|
||||
pathType: {{ .pathType }}
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}--nginx
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
0
charts/pterodactyl-panel/templates/migration/job.yaml
Normal file
0
charts/pterodactyl-panel/templates/migration/job.yaml
Normal file
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 }}
|
||||
85
charts/pterodactyl-panel/templates/php-fpm/deployment.yaml
Normal file
85
charts/pterodactyl-panel/templates/php-fpm/deployment.yaml
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}--php-fpm
|
||||
labels:
|
||||
app.kubernetes.io/name: php-fpm
|
||||
app.kubernetes.io/version: "{{ .Values.phpfpm.image.tag | default .Chart.AppVersion }}"
|
||||
app.kubernetes.io/component: backend
|
||||
app.kubernetes.io/part-of: pterodactyl-panel
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
|
||||
spec:
|
||||
{{- if not .Values.autoscaling.enabled }}
|
||||
replicas: {{ .Values.phpFpm.replicaCount }}
|
||||
{{- end }}
|
||||
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "pterodactyl-panel.selectorLabels" . | nindent 6 }}
|
||||
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.phpFpm.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.selectorLabels" . | nindent 8 }}
|
||||
|
||||
spec:
|
||||
{{- with .Values.phpFpm.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "pterodactyl-panel.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.phpFpm.podSecurityContext | nindent 8 }}
|
||||
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.phpFpm.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.phpFpm.image.repository }}:{{ .Values.phpFpm.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.phpFpm.image.pullPolicy }}
|
||||
|
||||
lifecycle:
|
||||
preStop:
|
||||
exec:
|
||||
command:
|
||||
- /bin/sh
|
||||
- '-c'
|
||||
- sleep 5 && kill -SIGQUIT 1
|
||||
|
||||
ports:
|
||||
- name: fastcgi
|
||||
containerPort: 9000
|
||||
protocol: TCP
|
||||
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: 9000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: 9000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
|
||||
resources:
|
||||
{{- toYaml .Values.phpFpm.resources | nindent 12 }}
|
||||
|
||||
{{- with .Values.phpFpm.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.phpFpm.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.phpFpm.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
28
charts/pterodactyl-panel/templates/php-fpm/hpa.yaml
Normal file
28
charts/pterodactyl-panel/templates/php-fpm/hpa.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{{- if .Values.autoscaling.enabled }}
|
||||
apiVersion: autoscaling/v2beta1
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}--php-fpm
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}
|
||||
minReplicas: {{ .Values.autoscaling.minReplicas }}
|
||||
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
15
charts/pterodactyl-panel/templates/php-fpm/service.yaml
Normal file
15
charts/pterodactyl-panel/templates/php-fpm/service.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.fullname" . }}--php-fpm
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: fastcgi
|
||||
protocol: TCP
|
||||
name: fastcgi
|
||||
selector:
|
||||
{{- include "pterodactyl-panel.selectorLabels" . | nindent 4 }}
|
||||
12
charts/pterodactyl-panel/templates/serviceaccount.yaml
Normal file
12
charts/pterodactyl-panel/templates/serviceaccount.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "pterodactyl-panel.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "pterodactyl-panel.fullname" . }}-test-connection"
|
||||
labels:
|
||||
{{- include "pterodactyl-panel.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "pterodactyl-panel.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
||||
126
charts/pterodactyl-panel/values.yaml
Normal file
126
charts/pterodactyl-panel/values.yaml
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
autoscaling:
|
||||
enabled: false
|
||||
|
||||
nginx:
|
||||
imagePullSecrets: []
|
||||
|
||||
image:
|
||||
repository: nginx
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "1.23.1"
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
autoscaling:
|
||||
minReplicas: 2
|
||||
maxReplicas: 10
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 8080
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu: 250m
|
||||
memory: 512Mi
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext:
|
||||
readOnlyRootFilesystem: true
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
- NET_RAW
|
||||
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 10014
|
||||
runAsGroup: 10014
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
phpFpm:
|
||||
imagePullSecrets: []
|
||||
|
||||
image:
|
||||
repository: ghcr.io/acaslab/pterodactyl-panel
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: ""
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
autoscaling:
|
||||
minReplicas: 2
|
||||
maxReplicas: 10
|
||||
targetCPUUtilizationPercentage: 80
|
||||
# targetMemoryUtilizationPercentage: 80
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 9000
|
||||
|
||||
resources:
|
||||
limits:
|
||||
cpu: 400m
|
||||
memory: 256Mi
|
||||
requests:
|
||||
cpu: 600m
|
||||
memory: 512Mi
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
annotations: {}
|
||||
hosts:
|
||||
- host: example.com
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
# - secretName: example-tls
|
||||
# hosts:
|
||||
# - example.com
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
site_name: Pterodactyl on Kubernetes Docs
|
||||
site_url: https://docs.acaslab.com/pterodactyl-on-k8s/
|
||||
site_dir: pterodactyl-on-k8s
|
||||
site_url: https://acaslab.github.io/pterodactyl-on-k8s/
|
||||
|
||||
repo_url: https://github.com/acaslab/pterodactyl-on-k8s/
|
||||
repo_name: acaslab/pterodactyl-on-k8s
|
||||
|
|
@ -40,4 +39,4 @@ markdown_extensions:
|
|||
|
||||
plugins:
|
||||
- mike:
|
||||
deploy_prefix: 'pterodactyl-on-k8s'
|
||||
deploy_prefix: '/pterodactyl-on-k8s/'
|
||||
|
|
|
|||
Reference in a new issue