Aggiorna la configurazione del servizio e dell'ingress per supportare il dominio dinamico e migliorare la gestione SSL
Some checks failed
Multi-Env Deploy / build-and-deploy (push) Has been cancelled
Some checks failed
Multi-Env Deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -20,8 +20,6 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
---
|
---
|
||||||
# NOTA: Il servizio ora è ClusterIP (interno), non più LoadBalancer.
|
|
||||||
# Non costa nulla e non ha IP pubblico diretto.
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -34,23 +32,21 @@ spec:
|
|||||||
- port: 80
|
- port: 80
|
||||||
targetPort: 80
|
targetPort: 80
|
||||||
---
|
---
|
||||||
# LA PARTE NUOVA: INGRESS
|
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: ${APP_NAME}-ingress
|
name: ${APP_NAME}-ingress
|
||||||
annotations:
|
annotations:
|
||||||
# Queste due righe attivano la magia SSL automatica
|
|
||||||
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
cert-manager.io/cluster-issuer: "letsencrypt-prod"
|
||||||
kubernetes.io/tls-acme: "true"
|
kubernetes.io/tls-acme: "true"
|
||||||
spec:
|
spec:
|
||||||
ingressClassName: nginx
|
ingressClassName: nginx
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- ${APP_NAME}.demo.bytebuilder.it
|
- ${APP_NAME}.${BASE_DOMAIN} # <--- Qui avviene la magia (varco.miosito.com OPPURE varco.demo.miosito.com)
|
||||||
secretName: ${APP_NAME}-tls
|
secretName: ${APP_NAME}-tls
|
||||||
rules:
|
rules:
|
||||||
- host: ${APP_NAME}.demo.bytebuilder.it
|
- host: ${APP_NAME}.${BASE_DOMAIN}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: /
|
- path: /
|
||||||
|
|||||||
Reference in New Issue
Block a user