Skip to content

Instantly share code, notes, and snippets.

@alessandrobologna
Last active February 24, 2018 22:36
Show Gist options
  • Save alessandrobologna/4c575d3991f08debb5901bd705aebb3a to your computer and use it in GitHub Desktop.
Save alessandrobologna/4c575d3991f08debb5901bd705aebb3a to your computer and use it in GitHub Desktop.
Minimal Kubernetes Deployment
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{APPNAME}}
namespace: {{NAMESPACE}}
spec:
replicas: 3
template:
metadata:
labels:
name: {{APPNAME}}
spec:
containers:
- name: {{APPNAME}}
image: {{IMAGE}}
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /healthcheck
port: 80
scheme: HTTP
initialDelaySeconds: 180
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources:
requests:
memory: 1048Mi
cpu: 1000m
limits:
memory: 2096Mi
cpu: 2000m
env:
- name: CLUSTER
value: {{CLUSTER}}
- name: STAGE
value: {{STAGE}}
---
apiVersion: v1
kind: Service
metadata:
name: {{APPNAME}}
namespace: {{NAMESPACE}}
annotations:
service.beta.kubernetes.io/aws-load-balancer-external: 0.0.0.0/0
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{CERTIFICATE_ARN}}
dns.alpha.kubernetes.io/internal: "{{APPNAME}}.{{NAMESPACE}}.{{CLUSTER}}"
spec:
type: LoadBalancer
ports:
- name: https
port: 443
targetPort: 8080
selector:
name: {{APPNAME}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment