Skip to content

Instantly share code, notes, and snippets.

@BrianKopp
Created June 13, 2019 20:53
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 BrianKopp/65c22cfdb517b21538ca3368900bc836 to your computer and use it in GitHub Desktop.
Save BrianKopp/65c22cfdb517b21538ca3368900bc836 to your computer and use it in GitHub Desktop.
Basic Kubernetes hello world deployment and service
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-world
labels:
app: hello-world-app
spec:
replicas: 1
selector:
matchLabels:
app: hello-world-app
template:
metadata:
labels:
app: hello-world-app
spec:
containers:
- name: hello-world
image: gcr.io/google-samples/hello-app:1.0
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: hello-world-service
spec:
selector:
app: hello-world-app
ports:
- protocol: TCP
port: 8080
targetPort: 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment