Merge pull request #7 from small-hack/proxied

Add embeded reverse proxy
This commit is contained in:
Max! 2025-09-29 13:09:02 +02:00 committed by GitHub
commit babf8fabec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 104 additions and 3 deletions

View file

@ -18,7 +18,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.9.1
version: 1.10.0
# renovate: image=docker.io/ghost
appVersion: "6.0.10"

View file

@ -1,6 +1,6 @@
# ghost
![Version: 1.9.1](https://img.shields.io/badge/Version-1.9.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.0.10](https://img.shields.io/badge/AppVersion-6.0.10-informational?style=flat-square)
![Version: 1.10.0](https://img.shields.io/badge/Version-1.10.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.0.10](https://img.shields.io/badge/AppVersion-6.0.10-informational?style=flat-square)
A Helm chart for deploying Ghost on Kubernetes
@ -110,6 +110,8 @@ A Helm chart for deploying Ghost on Kubernetes
| podAnnotations | object | `{}` | This is for setting Kubernetes Annotations to a Pod. For more info checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ |
| podLabels | object | `{}` | This is for setting Kubernetes Labels to a Pod. For more info checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ |
| podSecurityContext | object | `{}` | Configure Pods Security Context ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod |
| proxy | object | `{"enabled":true}` | Options for embedded nginx reverse-proxy |
| proxy.enabled | bool | `true` | enable/disable the embedded proxy |
| readinessProbe.httpGet.path | string | `"/"` | |
| readinessProbe.httpGet.port | string | `"http"` | |
| replicaCount | int | `1` | This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ |
@ -127,4 +129,4 @@ A Helm chart for deploying Ghost on Kubernetes
| volumes | list | `[]` | Additional volumes on the output Deployment definition. |
----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)

View file

@ -0,0 +1,15 @@
user nginx;
worker_processes 1;
events {
worker_connections 10240;
}
http {
server {
listen 80;
server_name 0.0.0.0;
location / {
root /usr/share/nginx/html; #Change this line
index index.html index.htm;
}
}
}

View file

@ -0,0 +1,11 @@
{{- if eq .Values.proxy.enabled true }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
{{- .Files.Get "files/nginx.conf" | nindent 4 }}
{{- end }}

View file

@ -0,0 +1,50 @@
{{- if .Values.proxy.enabled }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ghost-nginx-proxy
spec:
selector:
matchLabels:
{{- include "ghost.selectorLabels" . | nindent 4 }}
replicas: 1
template:
metadata:
labels:
app.kubernetes.io/component: ghost
{{- include "ghost.labels" . | nindent 4 }}
spec:
containers:
- name: nginx
image: nginx
ports:
- name: nginx
containerPort: 80
volumeMounts:
- name: nginx-conf
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
readOnly: true
resources:
requests:
memory: 100Mi
cpu: 100m
limits:
memory: 256Mi
cpu: 1000m
livenessProbe:
httpGet:
path: /
port: 80
httpHeaders: []
initialDelaySeconds: 3
periodSeconds: 3
volumes:
- name: nginx-conf
configMap:
name: nginx-conf
items:
- key: nginx.conf
path: nginx.conf
{{- end }}

View file

@ -0,0 +1,18 @@
{{- if .Values.proxy.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "ghost.fullname" . }}-proxy
labels:
app.kubernetes.io/component: ghost
{{- include "ghost.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: nginx
port: 80
targetPort: 80
protocol: TCP
selector:
{{- include "ghost.selectorLabels" . | nindent 4 }}
{{- end }}

View file

@ -353,3 +353,8 @@ activity_pub:
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# -- Options for embedded nginx reverse-proxy
proxy:
# -- enable/disable the embedded proxy
enabled: true