Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Commit bb6d6f4

Browse files
authored
Merge pull request #82 from nginxinc/release-1.6.0
Helm release - 1.6.0
2 parents e0297f0 + 066bc5d commit bb6d6f4

13 files changed

+121
-326
lines changed

Diff for: helm-chart/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: nginx-service-mesh
33
description: NGINX Service Mesh
4-
version: 0.5.0
5-
appVersion: 1.5.0
4+
version: 0.6.0
5+
appVersion: 1.6.0
66
kubeVersion: ">= 1.18-0"
77
icon: https://raw.githubusercontent.com/nginxinc/nginx-service-mesh/master/helm-chart/chart-icon.png

Diff for: helm-chart/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Before deploying NGINX Service Mesh, see the [Platform Guide](https://docs.nginx
66

77
For information on the configuration options and installation process when using Helm with NGINX Service Mesh, see the [Installation Guide](https://docs.nginx.com/nginx-service-mesh/get-started/install-with-helm/).
88

9-
## Rancher users
9+
We recommend deploying the mesh with auto-injection disabled globally, using the `--set disableAutoInjection=true` flag. This ensures that Pods are not automatically injected without your consent, especially in system namespaces.
1010

11-
When deploying NGINX Service Mesh via the Rancher Apps and Marketplace, the Helm value `rancher` is set to `true` by default. This value causes Pods in the `cattle-*`, `ingress-nginx`, and `cert-manager` namespaces to be ignored by the automatic sidecar injection webhook. If this behavior is not desired, the `rancher` value can be set to `false`, or the `injector.nsm.nginx.com/auto-inject` label can be manually removed from these namespaces.
11+
To opt-in a namespace you can label it with `injector.nsm.nginx.com/auto-inject=enabled` or use the flag `--set autoInjection.enabledNamespaces={namespace-1, namespace-2}`.

Diff for: helm-chart/configs/mesh-config.conf

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
"clientMaxBodySize": {{ quote .Values.clientMaxBodySize }},
1010
"environment": {{ quote .Values.environment }},
1111
"isUDPEnabled": {{ .Values.enableUDP }},
12+
"enabledNamespaces": [{{ if .Values.enabledNamespaces }} {{ range $idx, $elem := .Values.enabledNamespaces }}{{if $idx}},{{end}}{{quote .}}{{end}} {{ else }} {{ range $idx, $elem := .Values.autoInjection.enabledNamespaces }}{{if $idx}},{{end}}{{quote .}}{{end}} {{ end }}],
13+
"isAutoInjectEnabled": {{ if eq .Values.disableAutoInjection .Values.autoInjection.disable }} {{ not .Values.disableAutoInjection }} {{ else if .Values.disableAutoInjection }} {{ not .Values.disableAutoInjection }} {{ else }} {{ not .Values.autoInjection.disable }} {{ end }},
1214
"injection": {
1315
"disabledNamespaces": [{{ range $idx, $elem := .Values.autoInjection.disabledNamespaces }}{{if $idx}},{{end}}{{quote .}}{{end}}],
14-
"enabledNamespaces": [{{ range $idx, $elem := .Values.autoInjection.enabledNamespaces }}{{if $idx}},{{end}}{{quote .}}{{end}}],
15-
"isAutoInjectEnabled": {{ not .Values.autoInjection.disable }}
16+
"enabledNamespaces": [{{ if .Values.enabledNamespaces }} {{ range $idx, $elem := .Values.enabledNamespaces }}{{if $idx}},{{end}}{{quote .}}{{end}} {{ else }} {{ range $idx, $elem := .Values.autoInjection.enabledNamespaces }}{{if $idx}},{{end}}{{quote .}}{{end}} {{ end }}],
17+
"isAutoInjectEnabled": {{ if eq .Values.disableAutoInjection .Values.autoInjection.disable }} {{ not .Values.disableAutoInjection }} {{ else if .Values.disableAutoInjection }} {{ not .Values.disableAutoInjection }} {{ else }} {{ not .Values.autoInjection.disable }} {{ end }}
1618
},
1719
"loadBalancingMethod": {{ quote .Values.nginxLBMethod }},
1820
"mtls": {

Diff for: helm-chart/templates/_helpers.tpl

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{- end }}
88

99
{{- define "node-driver.image-server" -}}
10-
{{- if not .Values.registry.disablePublicImages }}k8s.gcr.io/sig-storage{{ else }}{{ .Values.registry.server }}{{ end }}
10+
{{- if not .Values.registry.disablePublicImages }}registry.k8s.io/sig-storage{{ else }}{{ .Values.registry.server }}{{ end }}
1111
{{- end }}
1212

1313
{{- define "hook.image-server" -}}
@@ -18,6 +18,10 @@
1818
{{- if not .Values.registry.disablePublicImages }}{{ else }}{{ .Values.registry.server }}/{{ end }}
1919
{{- end }}
2020

21+
{{- define "curl.image-server" -}}
22+
{{- if not .Values.registry.disablePublicImages }}curlimages{{ else }}{{ .Values.registry.server }}{{ end }}
23+
{{- end }}
24+
2125
{{- define "registry-key-name" -}}
2226
nginx-mesh-registry-key
2327
{{- end }}

Diff for: helm-chart/templates/nats.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ spec:
113113
- name: spire-agent-socket
114114
mountPath: "/run/spire/sockets"
115115
- name: nats-server
116-
image: {{ include "nats.image-server" . }}nats:2.8.4-alpine3.15
116+
image: {{ include "nats.image-server" . }}nats:2.9.3-alpine3.16
117117
imagePullPolicy: {{ .Values.registry.imagePullPolicy }}
118118
ports:
119119
- containerPort: 4222

Diff for: helm-chart/templates/nginx-mesh-api.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,11 @@ webhooks:
249249
- name: nginx-mesh-api.sidecar.injector
250250
namespaceSelector:
251251
matchExpressions:
252-
- key: injector.nsm.nginx.com/auto-inject
252+
- key: kubernetes.io/metadata.name
253253
operator: NotIn
254254
values:
255-
- 'false'
255+
- "kube-system"
256+
- {{ .Release.Namespace }}
256257
clientConfig:
257258
service:
258259
name: nginx-mesh-webhook

Diff for: helm-chart/templates/post-upgrade-hook.yaml

+31-36
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This hook reads the ConfigMap created by the pre-upgrade hook, and applies all updated HTTPRouteGroups.
1+
# This hook removes vestigial labels from select namespaces that the mesh no longer uses
22
---
33
apiVersion: v1
44
kind: ServiceAccount
@@ -27,26 +27,20 @@ rules:
2727
- apiGroups:
2828
- ''
2929
resources:
30-
- configmaps
31-
verbs:
32-
- get
33-
- delete
34-
- apiGroups:
35-
- specs.smi-spec.io
36-
resources:
37-
- httproutegroups
30+
- namespaces
3831
verbs:
3932
- get
33+
- list
4034
- patch
4135
{{- if eq .Values.environment "openshift" }}
4236
- apiGroups:
43-
- security.openshift.io
37+
- security.openshift.io
4438
resources:
45-
- securitycontextconstraints
39+
- securitycontextconstraints
4640
resourceNames:
47-
- post-upgrade-permissions.builtin.nsm.nginx
41+
- post-upgrade-permissions.builtin.nsm.nginx
4842
verbs:
49-
- use
43+
- use
5044
---
5145
apiVersion: security.openshift.io/v1
5246
kind: SecurityContextConstraints
@@ -86,14 +80,14 @@ roleRef:
8680
kind: ClusterRole
8781
name: post-upgrade.builtin.nsm.nginx
8882
subjects:
89-
- kind: ServiceAccount
90-
name: post-upgrade
91-
namespace: {{ .Release.Namespace }}
83+
- kind: ServiceAccount
84+
name: post-upgrade
85+
namespace: {{ .Release.Namespace }}
9286
---
9387
apiVersion: batch/v1
9488
kind: Job
9589
metadata:
96-
name: update-httproutegroups
90+
name: remove-namespace-labels
9791
labels:
9892
app.kubernetes.io/part-of: nginx-service-mesh
9993
annotations:
@@ -103,26 +97,27 @@ metadata:
10397
spec:
10498
template:
10599
metadata:
106-
name: update-httproutegroups
100+
name: remove-namespace-labels
107101
spec:
108102
restartPolicy: Never
109103
serviceAccountName: post-upgrade
110104
containers:
111-
- name: update-httproutegroups
112-
image: {{ include "hook.image-server" . }}/kubectl
113-
imagePullPolicy: {{ .Values.registry.imagePullPolicy }}
114-
command:
115-
- /bin/bash
116-
- -c
117-
- |
118-
res=$(kubectl get configmap httproutegroups --ignore-not-found -o jsonpath='{.data.httproutegroups}')
119-
if [ -n "$res" ]; then
120-
n=0
121-
until [ "$n" -ge 30 ]
122-
do
123-
echo $res | jq -c '.[]' | while read -r i; do kubectl apply -f - <<< $i; done && break
124-
n=$((n+1))
125-
sleep 1
126-
done
127-
fi
128-
kubectl delete configmap httproutegroups --ignore-not-found
105+
- name: remove-namespace-labels
106+
image: {{ include "hook.image-server" . }}/kubectl
107+
imagePullPolicy: {{ .Values.registry.imagePullPolicy }}
108+
securityContext:
109+
runAsUser: 0
110+
command:
111+
- /bin/bash
112+
- -c
113+
- |
114+
kubectl label namespace kube-system injector.nsm.nginx.com/auto-inject-
115+
kubectl label namespace {{ .Release.Namespace }} --overwrite injector.nsm.nginx.com/auto-inject- app.kubernetes.io/part-of-
116+
{{- if .Values.rancher }}
117+
kubectl label namespace ingress-nginx cert-manager injector.nsm.nginx.com/auto-inject-
118+
for ns in $(kubectl get ns | awk '{print $1}' | tail -n +2); do
119+
case "$ns" in
120+
cattle-*) kubectl label namespace $ns injector.nsm.nginx.com/auto-inject- ;;
121+
esac
122+
done
123+
{{- end }}

Diff for: helm-chart/templates/pre-install-hook.yaml

-138
This file was deleted.

0 commit comments

Comments
 (0)