Skip to content

Commit

Permalink
feat(helm): allow cni updateStrategy to be configurable (#13562)
Browse files Browse the repository at this point in the history
* [feat] allow cni updateStrategy to be configurable

* For users with large clusters rollout of the cni can take a bit of
  time. This will allow them to configure a faster rollout of the cni
resources.

#13031
Signed-off-by: Shane Starcher <[email protected]>

* add update strategy for cli

Signed-off-by: Shane Starcher <[email protected]>

---------

Signed-off-by: Shane Starcher <[email protected]>
Co-authored-by: Shane Starcher <[email protected]>
  • Loading branch information
sstarcher and Shane Starcher authored Jan 21, 2025
1 parent 5c3053b commit 70cf784
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 32 deletions.
5 changes: 1 addition & 4 deletions charts/linkerd2-cni/templates/cni-plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,7 @@ spec:
selector:
matchLabels:
k8s-app: linkerd-cni
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
updateStrategy: {{ .Values.updateStrategy | toYaml | nindent 4 }}
template:
metadata:
labels:
Expand Down
5 changes: 5 additions & 0 deletions charts/linkerd2-cni/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ disableIPv6: true
priorityClassName: ""
# -- Specifies the number of old ReplicaSets to retain to allow rollback.
revisionHistoryLimit: 10
# -- Specifies the update strategy for how the new pods are rolled out
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1

# -- Add a PSP resource and bind it to the linkerd-cni ServiceAccounts.
# Note PSP has been deprecated since k8s v1.21
Expand Down
57 changes: 29 additions & 28 deletions pkg/charts/cni/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,35 @@ type RepairController struct {

// Values contains the top-level elements in the cni Helm chart
type Values struct {
InboundProxyPort uint `json:"inboundProxyPort"`
OutboundProxyPort uint `json:"outboundProxyPort"`
IgnoreInboundPorts string `json:"ignoreInboundPorts"`
IgnoreOutboundPorts string `json:"ignoreOutboundPorts"`
CliVersion string `json:"cliVersion"`
Image Image `json:"image"`
LogLevel string `json:"logLevel"`
PortsToRedirect string `json:"portsToRedirect"`
ProxyUID int64 `json:"proxyUID"`
ProxyGID int64 `json:"proxyGID"`
DestCNINetDir string `json:"destCNINetDir"`
DestCNIBinDir string `json:"destCNIBinDir"`
UseWaitFlag bool `json:"useWaitFlag"`
PriorityClassName string `json:"priorityClassName"`
ProxyAdminPort string `json:"proxyAdminPort"`
ProxyControlPort string `json:"proxyControlPort"`
Tolerations []interface{} `json:"tolerations"`
PodLabels map[string]string `json:"podLabels"`
CommonLabels map[string]string `json:"commonLabels"`
ImagePullSecrets []map[string]string `json:"imagePullSecrets"`
ExtraInitContainers []interface{} `json:"extraInitContainers"`
IptablesMode string `json:"iptablesMode"`
DisableIPv6 bool `json:"disableIPv6"`
EnablePSP bool `json:"enablePSP"`
Privileged bool `json:"privileged"`
Resources Resources `json:"resources"`
RepairController RepairController `json:"repairController"`
RevisionHistoryLimit uint `json:"revisionHistoryLimit"`
InboundProxyPort uint `json:"inboundProxyPort"`
OutboundProxyPort uint `json:"outboundProxyPort"`
IgnoreInboundPorts string `json:"ignoreInboundPorts"`
IgnoreOutboundPorts string `json:"ignoreOutboundPorts"`
CliVersion string `json:"cliVersion"`
Image Image `json:"image"`
LogLevel string `json:"logLevel"`
PortsToRedirect string `json:"portsToRedirect"`
ProxyUID int64 `json:"proxyUID"`
ProxyGID int64 `json:"proxyGID"`
DestCNINetDir string `json:"destCNINetDir"`
DestCNIBinDir string `json:"destCNIBinDir"`
UseWaitFlag bool `json:"useWaitFlag"`
PriorityClassName string `json:"priorityClassName"`
ProxyAdminPort string `json:"proxyAdminPort"`
ProxyControlPort string `json:"proxyControlPort"`
Tolerations []interface{} `json:"tolerations"`
PodLabels map[string]string `json:"podLabels"`
CommonLabels map[string]string `json:"commonLabels"`
ImagePullSecrets []map[string]string `json:"imagePullSecrets"`
ExtraInitContainers []interface{} `json:"extraInitContainers"`
IptablesMode string `json:"iptablesMode"`
DisableIPv6 bool `json:"disableIPv6"`
EnablePSP bool `json:"enablePSP"`
Privileged bool `json:"privileged"`
Resources Resources `json:"resources"`
RepairController RepairController `json:"repairController"`
RevisionHistoryLimit uint `json:"revisionHistoryLimit"`
UpdateStrategy map[string]interface{} `json:"updateStrategy"`
}

// NewValues returns a new instance of the Values type.
Expand Down

0 comments on commit 70cf784

Please sign in to comment.