Skip to content

Instantly share code, notes, and snippets.

@mousetree
Created July 10, 2018 17:00
Show Gist options
  • Save mousetree/099f40576c2e290283298d53c11422c3 to your computer and use it in GitHub Desktop.
Save mousetree/099f40576c2e290283298d53c11422c3 to your computer and use it in GitHub Desktop.
Kubernetes deployment and service template
kind: Service
apiVersion: v1
metadata:
name: ${PROJECT_NAME}
spec:
selector:
app: ${PROJECT_NAME}
ports:
- protocol: TCP
port: 80
targetPort: 3000
type: LoadBalancer
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: ${PROJECT_NAME}
labels:
app: ${PROJECT_NAME}
spec:
replicas: 2
selector:
matchLabels:
app: ${PROJECT_NAME}
template:
metadata:
labels:
app: ${PROJECT_NAME}
spec:
containers:
- name: ${PROJECT_NAME}
image: eu.gcr.io/${GOOGLE_PROJECT_ID}/${PROJECT_NAME}:${CIRCLE_SHA1}
ports:
- name: http
containerPort: 3000
protocol: TCP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment