Aggiorna la configurazione di deployment per utilizzare ClusterIP e aggiungi Ingress per la gestione SSL
All checks were successful
GKE Auto-Deploy / build-and-deploy (push) Successful in 36s
All checks were successful
GKE Auto-Deploy / build-and-deploy (push) Successful in 36s
This commit is contained in:
@@ -20,14 +20,43 @@ spec:
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
# NOTA: Il servizio ora è ClusterIP (interno), non più LoadBalancer.
|
||||
# Non costa nulla e non ha IP pubblico diretto.
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: ${APP_NAME}-service
|
||||
spec:
|
||||
type: LoadBalancer
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: ${APP_NAME}
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
targetPort: 80
|
||||
---
|
||||
# LA PARTE NUOVA: INGRESS
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: ${APP_NAME}-ingress
|
||||
annotations:
|
||||
# Queste due righe attivano la magia SSL automatica
|
||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||
kubernetes.io/tls-acme: "true"
|
||||
spec:
|
||||
ingressClassName: nginx
|
||||
tls:
|
||||
- hosts:
|
||||
- ${APP_NAME}.demo.bytebuilder.it
|
||||
secretName: ${APP_NAME}-tls
|
||||
rules:
|
||||
- host: ${APP_NAME}.demo.bytebuilder.it
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: ${APP_NAME}-service
|
||||
port:
|
||||
number: 80
|
||||
Reference in New Issue
Block a user