Skip to content

Commit

Permalink
split up kubernetes files and force https
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Fuller committed Feb 9, 2019
1 parent df87cd6 commit 3f17e92
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 110 deletions.
27 changes: 27 additions & 0 deletions k8s/backend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: pong-backend
labels:
app: pong-backend
spec:
replicas: 1
selector:
matchLabels:
app: pong-backend
template:
metadata:
labels:
app: pong-backend
spec:
containers:
- name: queue-backend
image: benjamintf1/queue-backend:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: RESOURCE_COUNT
value: "2"
- name: PORT
value: "8080"
16 changes: 16 additions & 0 deletions k8s/backend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
kind: Service
apiVersion: v1
metadata:
name: pong-backend
annotations:
cloud.google.com/app-protocols: '{"frontend":"HTTPS","frontend":"HTTP"}'
service.alpha.kubernetes.io/app-protocols: '{"frontend":"HTTPS","frontend":"HTTP"}'
spec:
type: NodePort
selector:
app: pong-backend
ports:
- name: backend
protocol: TCP
port: 8080
targetPort: 8080
110 changes: 0 additions & 110 deletions k8s/deployment.yml

This file was deleted.

27 changes: 27 additions & 0 deletions k8s/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: pong-frontend
labels:
app: pong-frontend
spec:
replicas: 1
selector:
matchLabels:
app: pong-frontend
template:
metadata:
labels:
app: pong-frontend
spec:
containers:
- name: queue-frontend
image: benjamintf1/queue-frontend:latest
imagePullPolicy: Always
ports:
- containerPort: 3000
env:
- name: REACT_APP_SHOW_TIME_STARTED
value: "true"
- name: REACT_APP_HIGHLIGHT_TIME_STARTED_AFTER
value: "20"
16 changes: 16 additions & 0 deletions k8s/frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
kind: Service
apiVersion: v1
metadata:
name: pong-frontend
annotations:
cloud.google.com/app-protocols: '{"frontend":"HTTPS","frontend":"HTTP"}'
service.alpha.kubernetes.io/app-protocols: '{"frontend":"HTTPS","frontend":"HTTP"}'
spec:
type: NodePort
selector:
app: pong-frontend
ports:
- name: frontend
protocol: TCP
port: 8080
targetPort: 3000
21 changes: 21 additions & 0 deletions k8s/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pong-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: pong-ip
kubernetes.io/ingress.allow-http: "false"
spec:
tls:
- secretName: tls-secret
rules:
- http:
paths:
- path: /*
backend:
serviceName: pong-frontend
servicePort: 8080
- path: /backend/*
backend:
serviceName: pong-backend
servicePort: 8080

0 comments on commit 3f17e92

Please sign in to comment.