Skip to content

Instantly share code, notes, and snippets.

@shyam
Created June 14, 2018 07:43
Show Gist options
  • Save shyam/17cf6b5d9acd315110ce2ae84d4e953f to your computer and use it in GitHub Desktop.
Save shyam/17cf6b5d9acd315110ce2ae84d4e953f to your computer and use it in GitHub Desktop.
k8s - test deployment, service and nginx ingress
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: helloworld-deployment
spec:
selector:
matchLabels:
app: helloworld
replicas: 4
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: helloworld
image: shyam/helloworld:v1
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: helloworld-svc
spec:
selector:
app: helloworld
ports:
- name: http
protocol: TCP
port: 80
targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: helloworld-ingress
spec:
rules:
- host: test-helloworld-svc.testserver.de
http:
paths:
- path: /
backend:
serviceName: helloworld-svc
servicePort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment