103 lines
2.3 KiB
Plaintext
103 lines
2.3 KiB
Plaintext
apiVersion: v1
|
|
data:
|
|
config.toml: |
|
|
title = "Tweet Service Configuration"
|
|
# address
|
|
address = ":9090"
|
|
# redis
|
|
[redis]
|
|
address = "redis.staging:6379"
|
|
db = 0
|
|
pass = ""
|
|
# context
|
|
[context]
|
|
timeout = 2
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: configmap-nginx
|
|
namespace: reverse-proxy
|
|
|
|
---
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: reverse-proxy
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: reverse-proxy
|
|
namespace: reverse-proxy
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: reverse-proxy
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: reverse-proxy
|
|
spec:
|
|
containers:
|
|
- image: nginx:alpine
|
|
imagePullPolicy: IfNotPresent
|
|
name: reverse-proxy
|
|
ports:
|
|
- containerPort: 80
|
|
name: rp-port-http
|
|
- containerPort: 443
|
|
name: rp-port-https
|
|
volumeMounts:
|
|
- name: reverse-proxy-conf
|
|
mountPath: /etc/nginx/conf.d/
|
|
- name: reverse-proxy-ssl
|
|
mountPath: /etc/nginx/ssl/
|
|
# - name: config
|
|
# mountPath: /etc/nginx/nginx.conf
|
|
# subPath: nginx.conf
|
|
# - name: configs
|
|
# mountPath: /app/config.toml
|
|
# subPath: config.toml
|
|
- mountPath: /etc/nginx/nginx.conf
|
|
name: example-volume
|
|
volumes:
|
|
# - name: configs
|
|
# configMap:
|
|
# name: configmap-nginx
|
|
- name: reverse-proxy-conf
|
|
hostPath:
|
|
path: /opt/kubernetes/Nginx_kube/conf.d
|
|
- name: reverse-proxy-ssl
|
|
hostPath:
|
|
path: /opt/kubernetes/Nginx_kube/certbot/conf/
|
|
# - name: config
|
|
# configMap:
|
|
# name: nginx-config
|
|
- name: example-volume
|
|
# mount /data/foo, but only if that directory already exists
|
|
hostPath:
|
|
path: /opt/kubernetes/Nginx_kube/nginx.conf # directory location on host
|
|
type: File # this field is optional
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: reverse-proxy
|
|
namespace: reverse-proxy
|
|
spec:
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
targetPort: rp-port-http
|
|
protocol: TCP
|
|
nodePort: 30080
|
|
- name: https
|
|
port: 443
|
|
targetPort: rp-port-https
|
|
protocol: TCP
|
|
nodePort: 30443
|
|
|
|
type: NodePort
|
|
selector:
|
|
app: reverse-proxy
|