Skip to content

Instantly share code, notes, and snippets.

@nimboya
Last active August 15, 2023 08:47
Show Gist options
  • Save nimboya/09c38c942ffa92223b7710f201d2d6b1 to your computer and use it in GitHub Desktop.
Save nimboya/09c38c942ffa92223b7710f201d2d6b1 to your computer and use it in GitHub Desktop.
Kubernetes Deployment File
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
selector:
matchLabels:
app: nginxdemo
replicas: 3
template:
metadata:
labels:
app: nginxdemo
spec:
containers:
- name: nginxdemo
image: nginxdemos/hello
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginxdemo-svc
spec:
selector:
app: nginxdemo
ports:
- name: http
protocol: TCP
port: 80
targetPort: 80
type: LoadBalancer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment