mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 04:37:31 +08:00
feat: Support installing higress to a K8s cluster with kernel version < 4.11 (#301)
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
{{- $unprivilegedPortSupported := true }}
|
||||||
|
{{- range $index, $node := (lookup "v1" "Node" "default" "").items }}
|
||||||
|
{{- $kernelVersion := $node.status.nodeInfo.kernelVersion }}
|
||||||
|
{{- if $kernelVersion }}
|
||||||
|
{{- $kernelVersion = regexFind "^(\\d+\\.\\d+\\.\\d+)" $kernelVersion }}
|
||||||
|
{{- if and $kernelVersion (semverCompare "<4.11.0" $kernelVersion) }}
|
||||||
|
{{- $unprivilegedPortSupported = false }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -50,7 +60,7 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
{{- if .Values.gateway.securityContext }}
|
{{- if .Values.gateway.securityContext }}
|
||||||
{{- toYaml .Values.gateway.securityContext | nindent 8 }}
|
{{- toYaml .Values.gateway.securityContext | nindent 8 }}
|
||||||
{{- else if and (not .Values.gateway.hostNetwork) (semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion) }}
|
{{- else if and $unprivilegedPortSupported (and (not .Values.gateway.hostNetwork) (semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||||
# Safe since 1.22: https://github.com/kubernetes/kubernetes/pull/103326
|
# Safe since 1.22: https://github.com/kubernetes/kubernetes/pull/103326
|
||||||
sysctls:
|
sysctls:
|
||||||
- name: net.ipv4.ip_unprivileged_port_start
|
- name: net.ipv4.ip_unprivileged_port_start
|
||||||
@@ -71,7 +81,7 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
{{- if .Values.gateway.containerSecurityContext }}
|
{{- if .Values.gateway.containerSecurityContext }}
|
||||||
{{- toYaml .Values.gateway.containerSecurityContext | nindent 12 }}
|
{{- toYaml .Values.gateway.containerSecurityContext | nindent 12 }}
|
||||||
{{- else if and (not .Values.gateway.hostNetwork) (semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion) }}
|
{{- else if and $unprivilegedPortSupported (and (not .Values.gateway.hostNetwork) (semverCompare ">=1.22-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||||
# Safe since 1.22: https://github.com/kubernetes/kubernetes/pull/103326
|
# Safe since 1.22: https://github.com/kubernetes/kubernetes/pull/103326
|
||||||
capabilities:
|
capabilities:
|
||||||
drop:
|
drop:
|
||||||
|
|||||||
Reference in New Issue
Block a user