Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

done #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

done #31

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions base/deployment-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: todonodejs
name: frontend
namespace: mysql
spec:
replicas: 1
selector:
matchLabels:
app: todonodejs
name: frontend
template:
metadata:
labels:
app: todonodejs
name: frontend
spec:
containers:
- resources:
limits:
cpu: '0.5'
image: quay.io/redhattraining/todo-single:v1.0
name: todonodejs
ports:
- containerPort: 8080
name: nodejs-http
env:
- name: MYSQL_ENV_MYSQL_DATABASE
value: items
- name: MYSQL_ENV_MYSQL_USER
value: user1
- name: MYSQL_ENV_MYSQL_PASSWORD
value: mypa55
- name: APP_PORT
value: '8080'
---
46 changes: 46 additions & 0 deletions base/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql
labels:
app: todonodejs
name: mysql
spec:
replicas: 1
selector:
matchLabels:
app: todonodejs
name: mysql
template:
metadata:
labels:
app: todonodejs
name: mysql
spec:
containers:
- image: registry.redhat.io/rhel8/mysql-80:latest
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: r00tpa55
- name: MYSQL_USER
value: user1
- name: MYSQL_PASSWORD
value: mypa55
- name: MYSQL_DATABASE
value: items
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- mountPath: "/var/lib/mysql"
name: db-volume
volumes:
- name: db-volume
emptyDir: {}
- name: db-init
emptyDir: {}
- name: db-volume
persistentVolumeClaim:
claimName: mysql-pv-claim
7 changes: 7 additions & 0 deletions base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Kustomization

resources:
- deployment-frontend.yaml
- deployment.yaml
- service.yaml
- service-frontend.yaml
12 changes: 12 additions & 0 deletions base/service-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: todonodejs
name: frontend
name: frontend
spec:
ports:
- port: 8080
selector:
name: frontend
12 changes: 12 additions & 0 deletions base/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: todonodejs
name: mysql
name: mysql
spec:
ports:
- port: 3306
selector:
name: mysql
2 changes: 1 addition & 1 deletion mysql/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
name: mysql
spec:
containers:
- image: registry.redhat.io/rhel8/mysql-80:1-152
- image: registry.redhat.io/rhel8/mysql-80:latest
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
Expand Down
11 changes: 11 additions & 0 deletions overlays/development/dbclaim-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Mi
storageClassName: nfs-storage
9 changes: 9 additions & 0 deletions overlays/development/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
kind: Kustomization

bases:
- ../../base

resources:
- dbclaim-pvc.yaml
- route.yaml
namePrefix: dev-
16 changes: 16 additions & 0 deletions overlays/development/route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: todonodejs
name: route-frontend
name: frontend
namespace: mysql
spec:
host: todo.apps.ocp4.example.com
path: "/todo"
to:
kind: Service
name: frontend
weight: 100
wildcardPolicy: None