Skip to content

Commit

Permalink
Allow to set ConfigMap name for istio-ca-root-cert
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Grimm <[email protected]>
Signed-off-by: Yann Liu <[email protected]>
  • Loading branch information
dgn authored and eoinfennessy committed May 23, 2024
1 parent 0381b91 commit ff42a6a
Show file tree
Hide file tree
Showing 61 changed files with 160 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
- name: podinfo
downwardAPI:
Expand Down
3 changes: 3 additions & 0 deletions manifests/charts/gateways/istio-egress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ global:
# CSR clients such as the Istio Agent and ingress gateways can use this to specify the CA endpoint.
caAddress: ""

# The name of the ConfigMap that stores the CA Root Certificate
caCertConfigMapName: "istio-ca-root-cert"

# Used to locate istiod.
istioNamespace: istio-system

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
- name: podinfo
downwardAPI:
Expand Down
3 changes: 3 additions & 0 deletions manifests/charts/gateways/istio-ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ global:
# CSR clients such as the Istio Agent and ingress gateways can use this to specify the CA endpoint.
caAddress: ""

# The name of the ConfigMap that stores the CA Root Certificate
caCertConfigMapName: "istio-ca-root-cert"

# Used to locate istiod.
istioNamespace: istio-system

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
{{- if .Values.global.mountMtlsCerts }}
# Use the key and cert mounted to /etc/certs/ for the in-cluster mTLS communications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
{{- if .Values.global.mountMtlsCerts }}
# Use the key and cert mounted to /etc/certs/ for the in-cluster mTLS communications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
{{- if eq .Values.global.pilotCertProvider "kubernetes" }}
- name: kube-ca-cert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ spec:
expirationSeconds: 43200
path: istio-token
- configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
name: istiod-ca-cert
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ spec:
optional: true
- name: istio-csr-ca-configmap
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
defaultMode: 420
optional: true
{{- if .Values.pilot.jwksResolverExtraRootCA }}
Expand Down
3 changes: 3 additions & 0 deletions manifests/charts/istio-control/istio-discovery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ global:
# If not set explicitly, default to the Istio discovery address.
caAddress: ""

# The name of the ConfigMap that stores the CA Root Certificate
caCertConfigMapName: "istio-ca-root-cert"

# Configure a remote cluster data plane controlled by an external istiod.
# When set to true, istiod is not deployed locally and only a subset of the other
# discovery charts are enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
{{- if .Values.global.mountMtlsCerts }}
# Use the key and cert mounted to /etc/certs/ for the in-cluster mTLS communications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ spec:
{{- if eq .Values.global.pilotCertProvider "istiod" }}
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- end }}
{{- if eq .Values.global.pilotCertProvider "kubernetes" }}
- name: kube-ca-cert
Expand Down
2 changes: 2 additions & 0 deletions manifests/charts/istiod-remote/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ global:
# CSR clients such as the Istio Agent and ingress gateways can use this to specify the CA endpoint.
# If not set explicitly, default to the Istio discovery address.
caAddress: ""
# The name of the ConfigMap that stores the CA Root Certificate
caCertConfigMapName: "istio-ca-root-cert"
# Configure a remote cluster data plane controlled by an external istiod.
# When set to true, istiod is not deployed locally and only a subset of the other
# discovery charts are enabled.
Expand Down
2 changes: 1 addition & 1 deletion manifests/charts/ztunnel/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ spec:
audience: istio-ca
- name: istiod-ca-cert
configMap:
name: istio-ca-root-cert
name: {{ .Values.global.caCertConfigMapName }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 6}}
{{- end }}
3 changes: 3 additions & 0 deletions manifests/charts/ztunnel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ multiCluster:
meshConfig:
defaultConfig:
proxyMetadata: {}
global:
# The name of the ConfigMap that stores the CA Root Certificate
caCertConfigMapName: "istio-ca-root-cert"

# Ambient redirection mode: "iptables" or "ebpf"
redirectMode: "iptables"
Expand Down
5 changes: 3 additions & 2 deletions pilot/pkg/config/kube/gateway/deploymentcontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,11 @@ func TestVersionManagement(t *testing.T) {
}

func testInjectionConfig(t test.Failer) func() inject.WebhookConfig {
vc, err := inject.NewValuesConfig(`
vc, err := inject.NewValuesConfig(fmt.Sprintf(`
global:
hub: test
tag: test`)
tag: test
caCertConfigMapName: %s`, features.CACertConfigMapName))
if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 3 additions & 0 deletions pilot/pkg/features/pilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@ var (
EnableGatewayControllerMode = env.Register("PILOT_ENABLE_GATEWAY_CONTROLLER_MODE", false,
"If enabled, istiod will watch Gateway API and k8s resources in every namespace, but Istio resources will be limited to "+
"namespaces that match the meshConfig.discoverySelectors").Get()

CACertConfigMapName = env.RegisterStringVar("PILOT_CA_CERT_CONFIG_MAP_NAME", "istio-ca-root-cert",
"Name of the ConfigMap that stores the CA Root Certificate.").Get()
)

// UnsafeFeaturesEnabled returns true if any unsafe features are enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ import (
)

const (
// CACertNamespaceConfigMap is the name of the ConfigMap in each namespace storing the root cert of non-Kube CA.
CACertNamespaceConfigMap = "istio-ca-root-cert"

// maxRetries is the number of times a namespace will be retried before it is dropped out of the queue.
// With the current rate-limiter in use (5ms*2^(maxRetries-1)) the following numbers represent the
// sequence of delays between successive queuing of a namespace.
Expand All @@ -45,6 +42,9 @@ const (
maxRetries = 5
)

// CACertNamespaceConfigMap is the name of the ConfigMap in each namespace storing the root cert of non-Kube CA.
var CACertNamespaceConfigMap = features.CACertConfigMapName

var configMapLabel = map[string]string{"istio.io/config": "true"}

// NamespaceController manages reconciles a configmap in each namespace with a desired set of data.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions pkg/kube/inject/testdata/inputs/default.template.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/kube/inject/testdata/inputs/default.values.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ff42a6a

Please sign in to comment.