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

Add yamls of homework #13

Closed
wants to merge 4 commits into from
Closed
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
25 changes: 25 additions & 0 deletions example/ymh-webapp/backend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ymh-backend
namespace: ymh-webapp
spec:
replicas: 1
template:
metadata:
labels:
app: ymh-backend
spec:
initContainers:
- name: ymh-initcontainer
image: ymh636/ymh-backend
command: ['sh', '-c', 'alembic upgrade head && python3 addUser.py']
containers:
- name: ymh-backend
image: ymh636/ymh-backend
ports:
- containerPort: 8000
selector:
matchLabels:
app: ymh-backend

15 changes: 15 additions & 0 deletions example/ymh-webapp/backend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: ymh-backend
namespace: ymh-webapp
spec:
selector:
app: ymh-backend
type: NodePort
ports:
- protocol: TCP
port: 8000
targetPort: 8000
nodePort: 31426

20 changes: 20 additions & 0 deletions example/ymh-webapp/frontend_deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ymh-frontend
namespace: ymh-webapp
spec:
replicas: 1
template:
metadata:
labels:
app: ymh-frontend
spec:
containers:
- name: ymh-frontend
image: ymh636/ymh-frontend
ports:
- containerPort: 3000
selector:
matchLabels:
app: ymh-frontend
14 changes: 14 additions & 0 deletions example/ymh-webapp/frontend_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: ymh-frontend
namespace: ymh-webapp
spec:
selector:
app: ymh-frontend
type: NodePort
ports:
- protocol: TCP
port: 3000
targetPort: 3000
nodePort: 31425
Loading