Skip to content

Instantly share code, notes, and snippets.

@fabiante
Last active February 28, 2022 21:02
Show Gist options
  • Save fabiante/16468daf665357da49d0f79fc8928f7c to your computer and use it in GitHub Desktop.
Save fabiante/16468daf665357da49d0f79fc8928f7c to your computer and use it in GitHub Desktop.
Kubernetes Ingress Test
apiVersion: apps/v1
kind: Deployment
metadata:
name: ingress-test
labels:
app: ingress-test
spec:
replicas: 1
selector:
matchLabels:
app: ingress-test
template:
metadata:
labels:
app: ingress-test
spec:
containers:
- name: ingress-test
image: nginx:1.14.2
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: ingress-test
spec:
selector:
app: ingress-test
ports:
- protocol: TCP
port: 80
targetPort: 80
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-test
spec:
rules:
- http:
paths:
- path: /ingress-test
pathType: Prefix
backend:
service:
name: ingress-test
port:
number: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment