mirror of https://github.com/kubernetes/kops.git
Populate ingress spec values only when needed
Co-authored-by: Ciprian Hacman <ciprian@hakman.dev> fmt
This commit is contained in:
parent
61d036933e
commit
592e84d042
|
|
@ -173,21 +173,6 @@ func (b *CiliumOptionsBuilder) BuildOptions(o interface{}) error {
|
|||
if ingress.Enabled == nil {
|
||||
ingress.Enabled = fi.PtrTo(true)
|
||||
}
|
||||
if ingress.EnforceHttps == nil {
|
||||
ingress.EnforceHttps = fi.PtrTo(true)
|
||||
}
|
||||
if ingress.EnableSecretsSync == nil {
|
||||
ingress.EnableSecretsSync = fi.PtrTo(true)
|
||||
}
|
||||
if ingress.LoadBalancerAnnotationPrefixes == "" {
|
||||
ingress.LoadBalancerAnnotationPrefixes = "service.beta.kubernetes.io service.kubernetes.io cloud.google.com"
|
||||
}
|
||||
if ingress.DefaultLoadBalancerMode == "" {
|
||||
ingress.DefaultLoadBalancerMode = "dedicated"
|
||||
}
|
||||
if ingress.SharedLoadBalancerServiceName == "" {
|
||||
ingress.SharedLoadBalancerServiceName = "cilium-ingress"
|
||||
}
|
||||
} else {
|
||||
c.Ingress = &kops.CiliumIngressSpec{
|
||||
Enabled: fi.PtrTo(false),
|
||||
|
|
|
|||
|
|
@ -282,14 +282,29 @@ data:
|
|||
enable-envoy-config: "true"
|
||||
external-envoy-proxy: "false"
|
||||
enable-ingress-controller: "true"
|
||||
enforce-ingress-https: "{{ .Ingress.EnforceHttps }}"
|
||||
enable-ingress-secrets-sync: "{{ .Ingress.EnableSecretsSync }}"
|
||||
ingress-secrets-namespace: kube-system
|
||||
ingress-lb-annotation-prefixes: "{{ .Ingress.LoadBalancerAnnotationPrefixes }}"
|
||||
ingress-default-lb-mode: {{ .Ingress.DefaultLoadBalancerMode }}
|
||||
|
||||
{{ if .Ingress.EnforceHttps }}
|
||||
enforce-ingress-https: "{{ .Ingress.EnforceHttps }}"
|
||||
{{ end }}
|
||||
|
||||
{{ if .Ingress.EnableSecretsSync }}
|
||||
enable-ingress-secrets-sync: "{{ .Ingress.EnableSecretsSync }}"
|
||||
{{ end }}
|
||||
|
||||
{{ if .Ingress.SharedLoadBalancerServiceName }}
|
||||
ingress-shared-lb-service-name: {{ .Ingress.SharedLoadBalancerServiceName }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Ingress.DefaultLoadBalancerMode }}
|
||||
ingress-default-lb-mode: {{ .Ingress.DefaultLoadBalancerMode }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .Ingress.LoadBalancerAnnotationPrefixes }}
|
||||
ingress-lb-annotation-prefixes: "{{ .Ingress.LoadBalancerAnnotationPrefixes }}"
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if WithDefaultBool .Hubble.Enabled false }}
|
||||
# Enable Hubble gRPC service.
|
||||
enable-hubble: "true"
|
||||
|
|
@ -711,6 +726,15 @@ subjects:
|
|||
name: "cilium-operator"
|
||||
namespace: kube-system
|
||||
---
|
||||
# Source: cilium/templates/cilium-ingress-class.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: IngressClass
|
||||
metadata:
|
||||
name: cilium
|
||||
spec:
|
||||
controller: cilium.io/ingress-controller
|
||||
{{ if or (eq .Ingress.DefaultLoadBalancerMode "shared") (not .Ingress.DefaultLoadBalancerMode) }}
|
||||
---
|
||||
# Source: cilium/templates/cilium-ingress-service.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
|
@ -742,14 +766,7 @@ subsets:
|
|||
- ip: "192.192.192.192"
|
||||
ports:
|
||||
- port: 9999
|
||||
---
|
||||
# Source: cilium/templates/cilium-ingress-class.yaml
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: IngressClass
|
||||
metadata:
|
||||
name: cilium
|
||||
spec:
|
||||
controller: cilium.io/ingress-controller
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if WithDefaultBool .Hubble.Enabled false }}
|
||||
---
|
||||
|
|
|
|||
Loading…
Reference in New Issue