add a reverse proxy container
This commit is contained in:
parent
748c356017
commit
054a95c604
4 changed files with 89 additions and 0 deletions
15
charts/ghost/files/nginx.conf
Normal file
15
charts/ghost/files/nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
10
charts/ghost/templates/nginx-config.yaml
Normal file
10
charts/ghost/templates/nginx-config.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: nginx-conf
|
||||
data:
|
||||
nginx.conf: |
|
||||
{{- .Files.Get "files/nginx.conf" | nindent 4 }}
|
||||
|
||||
|
48
charts/ghost/templates/proxy-deployment.yaml
Normal file
48
charts/ghost/templates/proxy-deployment.yaml
Normal 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
|
16
charts/ghost/templates/proxy-service.yaml
Normal file
16
charts/ghost/templates/proxy-service.yaml
Normal 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 }}
|
Loading…
Add table
Add a link
Reference in a new issue