Created
March 27, 2020 17:56
-
-
Save junoteam/3244c87acdfa447988acc56dff28a0be to your computer and use it in GitHub Desktop.
Kubernetes deployment file for Go application
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: v1 | |
kind: List | |
items: | |
- apiVersion: v1 | |
kind: Service # K8s Service | |
metadata: | |
name: simple-web-app-svc | |
labels: | |
app: simple-web-app | |
spec: | |
type: NodePort | |
selector: | |
app: simple-web-app | |
color: blue # labels for blue / green deployments | |
ports: | |
- protocol: TCP | |
name: http | |
port: 8080 | |
targetPort: 8080 | |
# nodePort: 30000 # setup of static nodePort | |
- apiVersion: apps/v1 | |
kind: Deployment # K8s Deployment | |
metadata: | |
name: simple-web-app | |
labels: | |
app: simple-web-app | |
spec: | |
replicas: 3 | |
selector: | |
matchLabels: | |
app: simple-web-app | |
progressDeadlineSeconds: 120 | |
template: | |
metadata: | |
labels: | |
app: simple-web-app | |
color: blue # labels for blue / green deployments | |
spec: | |
containers: | |
- name: simple-web-app | |
image: mothes/simplewebapp | |
imagePullPolicy: Always | |
ports: | |
- containerPort: 8080 | |
livenessProbe: | |
httpGet: | |
path: /ping | |
port: 8080 | |
readinessProbe: | |
httpGet: | |
path: /ping | |
port: 8080 | |
env: | |
- name: ENV | |
value: "dev" | |
resources: | |
requests: | |
cpu: "100m" | |
memory: "128Mi" | |
limits: | |
cpu: "200m" | |
memory: "256Mi" | |
imagePullSecrets: | |
- name: regcred | |
restartPolicy: Always |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment