Last active
April 5, 2019 21:29
-
-
Save discdiver/ad363bcf98ef096b841669d9f81c4fa4 to your computer and use it in GitHub Desktop.
Specification for a Kubernetes Deployment and Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To see a line-by-line explanation, see this Gist.
This Gist is used in a Medium article on getting started with K8s.