Skip to content

Instantly share code, notes, and snippets.

@Neutrollized
Created June 3, 2022 15:34
Show Gist options
  • Save Neutrollized/d4a827d321608981398e9da8b86d938a to your computer and use it in GitHub Desktop.
Save Neutrollized/d4a827d321608981398e9da8b86d938a to your computer and use it in GitHub Desktop.
Medium: NGINX Ingress or GKE Ingress
---
apiVersion: v1
kind: Service
metadata:
labels:
app: web
name: web
annotations:
cloud.google.com/neg: '{"ingress": true}'
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 8080
selector:
app: web
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: web
name: web
spec:
replicas: 2
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- env:
- name: "LISTEN_ADDR"
value: "0.0.0.0:8080"
- name: "SERVER_TYPE"
value: "http"
- name: "NAME"
value: "web"
- name: "MESSAGE"
value: "Response from web"
- name: KUBERNETES_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
image: nicholasjackson/fake-service:v0.22.9
imagePullPolicy: IfNotPresent
name: web
ports:
- containerPort: 8080
name: http
protocol: TCP
securityContext:
privileged: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment