1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Added kubernetes manifests

This commit is contained in:
2019-03-27 17:13:13 +00:00
parent 293dc87984
commit e16e807b54
5 changed files with 239 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: wrestlingdev-app-ingress
spec:
rules:
- host: kube.wrestlingdev.com
http:
paths:
- path: /
backend:
serviceName: wrestlingdev-app
servicePort: 80
tls:
- hosts:
- kube.wrestlingdev.com

View File

@@ -0,0 +1,43 @@
apiVersion: v1
kind: Service
metadata:
name: wrestlingdev-memcached
labels:
app: wrestlingdev
spec:
ports:
- port: 11211
selector:
app: wrestlingdev
tier: memcached
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wrestlingdev-memcached-deployment
labels:
app: wrestlingdev
spec:
replicas: 1
selector:
matchLabels:
app: wrestlingdev
template:
metadata:
labels:
app: wrestlingdev
tier: memcached
spec:
containers:
- name: wrestlingdev-memcached
image: memcached
ports:
- containerPort: 11211
resources:
limits:
cpu: "0.2"
memory: "64Mi"
requests:
memory: "64Mi"
cpu: "0.1"

View File

@@ -0,0 +1,66 @@
apiVersion: v1
kind: Service
metadata:
name: wrestlingdev-mysql
labels:
app: wrestlingdev
spec:
ports:
- port: 3306
selector:
app: wrestlingdev
tier: mysql
clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: wrestlingdev-mysql-pv-claim
labels:
app: wrestlingdev
spec:
storageClassName: standard
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: wrestlingdev-mysql
labels:
app: wrestlingdev
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: wrestlingdev
tier: mysql
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: password
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: wrestlingdev-mysql-persistent-storage
mountPath: /var/lib/mysql
resources:
limits:
cpu: "0.5"
memory: "512Mi"
requests:
memory: "256Mi"
cpu: "0.2"
volumes:
- name: wrestlingdev-mysql-persistent-storage
persistentVolumeClaim:
claimName: wrestlingdev-mysql-pv-claim

View File

@@ -0,0 +1,113 @@
apiVersion: v1
kind: Service
metadata:
name: wrestlingdev-app
labels:
app: wrestlingdev
spec:
ports:
- port: 80
selector:
app: wrestlingdev
tier: frontend
clusterIP: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wrestlingdev-app-deployment
labels:
app: wrestlingdev
spec:
replicas: 3
selector:
matchLabels:
app: wrestlingdev
template:
metadata:
labels:
app: wrestlingdev
tier: frontend
spec:
containers:
- name: wrestlingdev-app
image: jcwimer/wrestlingdev:prod
imagePullPolicy: Always
ports:
- containerPort: 80
env:
- name: RAILS_ENV
value: production
- name: WRESTLINGDEV_DB_NAME
value: wrestlingtourneyprod
- name: WRESTLINGDEV_DB_USR
value: root
- name: WRESTLINGDEV_DB_PWD
value: password
- name: WRESTLINGDEV_DB_PORT
value: "3306"
- name: MEMCACHIER_SERVERS
value: wrestlingdev-memcached:11211
- name: WRESTLINGDEV_DB_HOST
value: wrestlingdev-mysql
- name: WRESTLINGDEV_DEVISE_SECRET_KEY
value: 2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa
- name: WRESTLINGDEV_SECRET_KEY_BASE
value: 077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2
resources:
limits:
cpu: "0.5"
memory: "512Mi"
requests:
memory: "512Mi"
cpu: "0.2"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wrestlingdev-worker-deployment
labels:
app: wrestlingdev
spec:
replicas: 1
selector:
matchLabels:
app: wrestlingdev
template:
metadata:
labels:
app: wrestlingdev
tier: worker
spec:
containers:
- name: wrestlingdev-worker
image: jcwimer/wrestlingdev:prod
imagePullPolicy: Always
env:
- name: RAILS_ENV
value: production
- name: WRESTLINGDEV_DB_NAME
value: wrestlingtourneyprod
- name: WRESTLINGDEV_DB_USR
value: root
- name: WRESTLINGDEV_DB_PWD
value: password
- name: WRESTLINGDEV_DB_PORT
value: "3306"
- name: MEMCACHIER_SERVERS
value: wrestlingdev-memcached:11211
- name: WRESTDEV_DB_HOST
value: wrestlingdev-mysql
- name: WRESTLINGDEV_DEVISE_SECRET_KEY
value: 2f29d49db6704377ba263f7cb9db085b386bcb301c0cd501126a674686ab1a109754071165b08cd72af03cec4642a4dd04361c994462254dd5d85e9594e8b9aa
- name: WRESTLINGDEV_SECRET_KEY_BASE
value: 077cdbef5c2ccf22543fb17a67339f234306b7fa2e1e4463d851c444c10a5611829a2290b253da78339427f131571fac9a42c83d960b2d25ecc10a4a0a7ce1a2
command: ["bundle"]
args: ["exec", "bin/delayed_job", "-n", "1", "run"]
resources:
limits:
cpu: "0.5"
memory: "512Mi"
requests:
memory: "512Mi"
cpu: "0.2"

View File

@@ -1,6 +1,6 @@
FROM ruby:2.5.1-slim
HEALTHCHECK --start-period=60s CMD curl http://127.0.0.1/
#HEALTHCHECK --start-period=60s CMD curl http://127.0.0.1/
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini