Skip to content

Commit

Permalink
Add extra k8s deployment files
Browse files Browse the repository at this point in the history
  • Loading branch information
kooixh committed Jul 8, 2020
1 parent fce927c commit fdae8ed
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 128 deletions.
63 changes: 0 additions & 63 deletions k8s/ReadMe.md

This file was deleted.

65 changes: 0 additions & 65 deletions k8s/application.yml

This file was deleted.

7 changes: 7 additions & 0 deletions k8s/configmap/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: road-review-configmap
namespace: road-review-namespace
data:
NODE_ENV: development
93 changes: 93 additions & 0 deletions k8s/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: road-review-deployment
namespace: road-review-namespace
labels:
app: road-review-backend
spec:
replicas: 1
selector:
matchLabels:
app: road-review-backend
template:
metadata:
labels:
app: road-review-backend
spec:
containers:
- name: road-review-backend
image: road-review-backend:$VERSION_NUM
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 3000
resources:
limits:
cpu: 1
memory: "1Gi"
requests:
cpu: 0.5
memory: "500Mi"
envFrom:
- configMapRef:
name: road-review-configmap
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-pass
key: password
- name: REDIS_HOST
valueFrom:
secretKeyRef:
name: redis-host
key: host
- name: REDIS_PORT
valueFrom:
secretKeyRef:
name: redis-host
key: port
- name: REDIS_DB_ID
valueFrom:
secretKeyRef:
name: redis-host
key: db-id
- name: DB_USER
valueFrom:
secretKeyRef:
name: mysql
key: mysql-user-name
- name: DB_HOST
valueFrom:
secretKeyRef:
name: mysql
key: mysql-host
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: mysql
key: mysql-password
- name: DB_NAME
valueFrom:
secretKeyRef:
name: mysql
key: mysql-db-name
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: road-review-backend
labels:
app: road-review-backend
spec:
type: NodePort
selector:
app: road-review-backend
ports:
- name: http
port: 3000
targetPort: 3000
protocol: TCP
13 changes: 13 additions & 0 deletions k8s/ingress/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: road-review-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "road-review-static-ip"
kubernetes.io/ingress.allow-http: "false
spec:
backend:
serviceName: road-review-backend
servicePort: 3000
tls:
- secretName: road-review-tls-cert

0 comments on commit fdae8ed

Please sign in to comment.