97 lines
1.9 KiB
YAML
97 lines
1.9 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ptp-chat-backend
|
|
namespace: ptp-chat
|
|
labels:
|
|
app: ptp-chat-backend
|
|
spec:
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
targetPort: 8081
|
|
selector:
|
|
app: ptp-chat-backend
|
|
type: NodePort
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ptp-chat-frontend
|
|
namespace: ptp-chat
|
|
labels:
|
|
app: ptp-chat-frontend
|
|
spec:
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
targetPort: 80
|
|
selector:
|
|
app: ptp-chat-frontend
|
|
type: NodePort
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: ptp-chat-db
|
|
namespace: ptp-chat
|
|
labels:
|
|
app: ptp-chat-db
|
|
spec:
|
|
ports:
|
|
- name: http
|
|
port: 5432
|
|
targetPort: 5432
|
|
selector:
|
|
app: ptp-chat-db
|
|
type: NodePort
|
|
---
|
|
apiVersion: networking.istio.io/v1beta1
|
|
kind: Gateway
|
|
metadata:
|
|
name: ptp-chat-gateway
|
|
namespace: ptp-chat
|
|
spec:
|
|
selector:
|
|
istio: ingressgateway # Holt sich das Standard-Ingress-Gateway
|
|
servers:
|
|
- port:
|
|
number: 443
|
|
name: https-ptpchat
|
|
protocol: HTTPS
|
|
hosts:
|
|
- ptp-chat.k8s.bittehackmichnicht.de
|
|
tls:
|
|
mode: SIMPLE # TLS-Termination am Gateway, damit der VirtualService den Traffic aufteilen kann
|
|
credentialName: istio-cert # Name des TLS-Zertifikats in Kubernetes, das für die Verschlüsselung verwendet wird
|
|
---
|
|
apiVersion: networking.istio.io/v1beta1
|
|
kind: VirtualService
|
|
metadata:
|
|
name: ptp-chat-vs
|
|
namespace: ptp-chat
|
|
spec:
|
|
hosts:
|
|
- ptp-chat.k8s.bittehackmichnicht.de
|
|
gateways:
|
|
- ptp-chat-gateway
|
|
http:
|
|
- match:
|
|
- uri:
|
|
prefix: /api
|
|
rewrite:
|
|
uri: /
|
|
route:
|
|
- destination:
|
|
host: ptp-chat-backend.ptp-chat.svc.cluster.local
|
|
port:
|
|
number: 80
|
|
- match:
|
|
- uri:
|
|
prefix: /
|
|
route:
|
|
- destination:
|
|
host: ptp-chat-frontend.ptp-chat.svc.cluster.local
|
|
port:
|
|
number: 80
|