Whitelist cert-manager created ingresses

Signed-off-by: Fredrik Lack <fredrik@fre.la>
This commit is contained in:
Fredrik Lack 2018-10-25 15:55:35 +02:00
parent 9433a90c5f
commit d454a189ed
No known key found for this signature in database
GPG Key ID: 92858003C9720608

View File

@ -113,9 +113,11 @@ func buildIngressResource(ch *v1alpha1.Challenge, svcName string) *extv1beta1.In
podLabels := podLabels(ch)
// TODO: add additional annotations to help workaround problematic ingress controller behaviours
ingAnnotaions := make(map[string]string)
ingAnnotations := make(map[string]string)
ingAnnotations["nginx.ingress.kubernetes.io/whitelist-source-range"] = "0.0.0.0/0"
if ingClass != nil {
ingAnnotaions[class.IngressKey] = *ingClass
ingAnnotations[class.IngressKey] = *ingClass
}
ingPathToAdd := ingressPath(ch.Spec.Token, svcName)
@ -125,7 +127,7 @@ func buildIngressResource(ch *v1alpha1.Challenge, svcName string) *extv1beta1.In
GenerateName: "cm-acme-http-solver-",
Namespace: ch.Namespace,
Labels: podLabels,
Annotations: ingAnnotaions,
Annotations: ingAnnotations,
OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(ch, challengeGvk)},
},
Spec: extv1beta1.IngressSpec{