14.5. Création d’un domaine personnalisé Ingress Controller
Créer et configurer une ressource de certificat pour fournir un certificat pour le domaine personnalisé Ingress Controller:
NoteL’exemple suivant utilise un certificat de domaine unique. Les certificats SAN et wildcard sont également pris en charge.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow B) Vérifier que le certificat a été délivré:
NoteIl faut quelques minutes pour que ce certificat soit délivré par Let's Encrypt. Lorsque cela prend plus de 5 minutes, exécutez oc -n openshift-ingress décrit certificate.cert-manager.io/custom-domain-ingress-cert pour voir tous les problèmes signalés par cert-manager.
oc -n openshift-ingress get certificate.cert-manager.io/custom-domain-ingress-cert
$ oc -n openshift-ingress get certificate.cert-manager.io/custom-domain-ingress-cert
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Exemple de sortie
NAME READY SECRET AGE custom-domain-ingress-cert True custom-domain-ingress-cert-tls 9m53s
NAME READY SECRET AGE custom-domain-ingress-cert True custom-domain-ingress-cert-tls 9m53s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Créer une nouvelle ressource IngressController:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow AvertissementCet exemple IngressController créera un balanceur de charge réseau accessible à Internet (NLB) dans votre compte AWS. Afin de fournir une NLB interne, définissez le paramètre .spec.endpointPublishingStrategy.loadBalancer.scope sur Interne avant de créer la ressource IngressController.
Assurez-vous que votre domaine personnalisé IngressController a créé avec succès un équilibreur de charge externe:
oc -n openshift-ingress get service/router-custom-domain-ingress
$ oc -n openshift-ingress get service/router-custom-domain-ingress
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Exemple de sortie
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE router-custom-domain-ingress LoadBalancer 172.30.174.34 a309962c3bd6e42c08cadb9202eca683-1f5bbb64a1f1ec65.elb.us-east-1.amazonaws.com 80:31342/TCP,443:31821/TCP 7m28s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE router-custom-domain-ingress LoadBalancer 172.30.174.34 a309962c3bd6e42c08cadb9202eca683-1f5bbb64a1f1ec65.elb.us-east-1.amazonaws.com 80:31342/TCP,443:31821/TCP 7m28s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Créez un document avec les modifications DNS nécessaires pour activer la résolution DNS pour votre domaine personnalisé Ingress Controller:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Envoyez vos modifications à Amazon Route 53 pour propagation:
aws route53 change-resource-record-sets \ --hosted-zone-id ${ZONE_ID} \ --change-batch file://${SCRATCH}/create-cname.json
$ aws route53 change-resource-record-sets \ --hosted-zone-id ${ZONE_ID} \ --change-batch file://${SCRATCH}/create-cname.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteBien que l’enregistrement wildcard CNAME évite la nécessité de créer un nouvel enregistrement pour chaque nouvelle application que vous déployez à l’aide du contrôleur d’Ingress de domaine personnalisé, le certificat que chacune de ces applications utilise n’est pas un certificat générique.