mirror of
https://github.com/rancher/rke.git
synced 2025-08-31 14:36:32 +00:00
Use initContainer for nginx ingress if it is old version
**Problem:** The nginx ingress daemonSet securityContext can not be applied to version before 0.16.0 **Solution:** When the nginx controller version is older than 0.16.0, we use the old way to set it up.
This commit is contained in:
committed by
Alena Prokharchyk
parent
3094ac132d
commit
642970feb2
@@ -439,6 +439,16 @@ func (c *Cluster) deployIngress(ctx context.Context) error {
|
||||
IngressImage: c.SystemImages.Ingress,
|
||||
IngressBackend: c.SystemImages.IngressBackend,
|
||||
}
|
||||
// since nginx ingress controller 0.16.0, it can be run as non-root and doesn't require privileged anymore.
|
||||
// So we can use securityContext instead of setting privileges via initContainer.
|
||||
ingressSplits := strings.SplitN(c.SystemImages.Ingress, ":", 2)
|
||||
if len(ingressSplits) == 2 {
|
||||
version := strings.Split(ingressSplits[1], "-")[0]
|
||||
if version < "0.16.0" {
|
||||
ingressConfig.AlpineImage = c.SystemImages.Alpine
|
||||
}
|
||||
}
|
||||
|
||||
// Currently only deploying nginx ingress controller
|
||||
ingressYaml, err := addons.GetNginxIngressManifest(ingressConfig)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user