Last active
December 26, 2023 12:52
-
-
Save ignj/74f2216dbe738b945311709dcbe2e7e4 to your computer and use it in GitHub Desktop.
Reverse proxy + Jumpbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test with Bitnami chart. helm install psql --set auth.postgresPassword=postgres oci://registry-1.docker.io/bitnamicharts/postgresql | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: rp-jb-nginx | |
data: | |
nginx.conf: | | |
events {} | |
http { | |
server { | |
listen 80; | |
location /healthcheck { | |
return 200; | |
} | |
} | |
} | |
stream { | |
server { | |
listen 8000; | |
proxy_connect_timeout 60s; | |
proxy_socket_keepalive on; | |
proxy_pass psql-postgresql:5432; | |
} | |
} | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: rp-jb-nginx | |
labels: | |
app: rp-jb-nginx | |
spec: | |
selector: | |
matchLabels: | |
app: rp-jb-nginx | |
replicas: 1 | |
template: | |
metadata: | |
labels: | |
app: rp-jb-nginx | |
spec: | |
containers: | |
- name: nginx | |
image: nginx:alpine | |
ports: | |
- containerPort: 80 | |
- containerPort: 8000 | |
livenessProbe: | |
httpGet: | |
path: /healthcheck | |
port: 80 | |
volumeMounts: | |
- name: nginx-config | |
mountPath: /etc/nginx/nginx.conf | |
subPath: nginx.conf | |
volumes: | |
- name: nginx-config | |
configMap: | |
name: rp-jb-nginx | |
--- | |
kind: Service | |
apiVersion: v1 | |
metadata: | |
name: rp-jb-nginx | |
spec: | |
selector: | |
app: rp-jb-nginx | |
ports: | |
- protocol: TCP | |
port: 80 | |
targetPort: 80 | |
name: rp-jb-nginx | |
- protocol: TCP | |
port: 8000 | |
targetPort: 8000 | |
name: psql-db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment