hinzugefügt Deployment und NodePort Service mit dem anpassenden reactjs App Image

This commit is contained in:
David 2022-11-22 19:22:27 +01:00
parent e1c65e8b46
commit bd749affbe
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,19 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend-deployment
spec:
replicas: 1
selector:
matchLabels:
app: reactjs
template:
metadata:
labels:
app: reactjs
spec:
containers:
- name: reactjs-app
image: syntax64/reactjs-app
ports:
- containerPort: 3000

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: reactjs-app-node-port
spec:
type: NodePort
ports:
- port: 3050 # die anderen Pods zugreiffen zu diesem Port, die unser port mit label component:web verbinden können
targetPort: 3000 # Das ist das Port vom targetPort component:web
nodePort: 31187 # Port, der uns von außer, Verbindung ermöglicht
selector:
app: reactjs