Skip to content

Instantly share code, notes, and snippets.

@discdiver
Last active April 5, 2019 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save discdiver/ad363bcf98ef096b841669d9f81c4fa4 to your computer and use it in GitHub Desktop.
Save discdiver/ad363bcf98ef096b841669d9f81c4fa4 to your computer and use it in GitHub Desktop.
Specification for a Kubernetes Deployment and Service
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-deployment
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-container
image: gcr.io/hello-minikube-zero-install/hello-node
---
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: my-app
ports:
- port: 8080
type: LoadBalancer
@discdiver
Copy link
Author

To see a line-by-line explanation, see this Gist.
This Gist is used in a Medium article on getting started with K8s.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment