Skip to content

Instantly share code, notes, and snippets.

@fjrti
Created August 11, 2021 13:11
Show Gist options
  • Save fjrti/6ebad7d79c2a84d8cce18c4806735197 to your computer and use it in GitHub Desktop.
Save fjrti/6ebad7d79c2a84d8cce18c4806735197 to your computer and use it in GitHub Desktop.
k8s service yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-dp
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:alpine
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
spec:
selector:
app: nginx
ports:
- protocol: TCP
port: 80
targetPort: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment