add a reverse proxy container

This commit is contained in:
cloudymax 2025-09-29 12:56:16 +02:00
parent 748c356017
commit 054a95c604
No known key found for this signature in database
4 changed files with 89 additions and 0 deletions

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,10 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-conf
data:
nginx.conf: |
{{- .Files.Get "files/nginx.conf" | nindent 4 }}

View file

@ -0,0 +1,48 @@
---
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

View file

@ -0,0 +1,16 @@
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:
- port: nginx
targetPort: 80
protocol: TCP
name: http
selector:
{{- include "ghost.selectorLabels" . | nindent 4 }}