Skip to content

Commit

Permalink
align mutatingwebhook.yaml in istiod-remote with istiod-discovery (is…
Browse files Browse the repository at this point in the history
  • Loading branch information
irisdingbj authored Oct 15, 2020
1 parent 19581dd commit e6a0bcf
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ sync-configs-from-istiod:
cp manifests/charts/istio-control/istio-discovery/templates/telemetryv2_1.7.yaml manifests/charts/istiod-remote/templates/
cp manifests/charts/istio-control/istio-discovery/templates/telemetryv2_1.8.yaml manifests/charts/istiod-remote/templates/
cp manifests/charts/istio-control/istio-discovery/templates/configmap.yaml manifests/charts/istiod-remote/templates
cp manifests/charts/istio-control/istio-discovery/templates/mutatingwebhook.yaml manifests/charts/istiod-remote/templates

# Generate kustomize templates.
gen-kustomize:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ metadata:
webhooks:
- name: sidecar-injector.istio.io
clientConfig:
{{- if .Values.istiodRemote.injectionURL }}
url: {{ .Values.istiodRemote.injectionURL }}
{{- else }}
service:
name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}
namespace: {{ .Release.Namespace }}
path: "/inject"
{{- end }}
caBundle: ""
sideEffects: None
rules:
Expand Down
5 changes: 4 additions & 1 deletion manifests/charts/istio-control/istio-discovery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ sidecarInjectorWebhook:
autoInject: true

rewriteAppHTTPProbe: true

istiodRemote:
# Sidecar injector mutating webhook configuration url
# For example: https://$remotePilotAddress:15017/inject
injectionURL: ""
telemetry:
enabled: true
v2:
Expand Down
4 changes: 2 additions & 2 deletions manifests/charts/istiod-remote/files/gen-istiod-remote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -671,15 +671,15 @@ webhooks:
name: istiod
namespace: istio-system
path: "/inject"
caBundle:
caBundle: ""
sideEffects: None
rules:
- operations: [ "CREATE" ]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
failurePolicy: Fail
admissionReviewVersions: ["v1beta1", "v1"]
sideEffects: None
namespaceSelector:
matchLabels:
istio-injection: enabled
9 changes: 4 additions & 5 deletions manifests/charts/istiod-remote/templates/mutatingwebhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ webhooks:
- name: sidecar-injector.istio.io
clientConfig:
{{- if .Values.istiodRemote.injectionURL }}
# the url supports to use inject/cluster/x/net/y format
url: {{ .Values.istiodRemote.injectionURL }}
{{- else }}
service:
name: istiod
namespace: {{ .Values.global.istioNamespace }}
name: istiod{{- if not (eq .Values.revision "") }}-{{ .Values.revision }}{{- end }}
namespace: {{ .Release.Namespace }}
path: "/inject"
{{- end }}
caBundle: {{ .Values.sidecarInjectorWebhook.caBundle }}
caBundle: ""
sideEffects: None
rules:
- operations: [ "CREATE" ]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
failurePolicy: Fail
admissionReviewVersions: ["v1beta1", "v1"]
sideEffects: None
namespaceSelector:
{{- if .Values.sidecarInjectorWebhook.enableNamespacesByDefault }}
matchExpressions:
Expand Down

0 comments on commit e6a0bcf

Please sign in to comment.