提交 49dacd3e 编写于 作者: J Jeff 提交者: zryfish

fix kubesphere gateway bug

上级 3fc42075
apiVersion: extensions/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: ks-router
......@@ -26,7 +26,6 @@ spec:
args:
- /nginx-ingress-controller
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --configmap=$(POD_NAMESPACE)/nginx-configuration
- --annotations-prefix=nginx.ingress.kubernetes.io
- --force-namespace-isolation
- --update-status
......
......@@ -348,6 +348,9 @@ func createOrUpdateRouterWorkload(namespace string, publishService bool, service
deployment.Spec.Selector.MatchLabels["project"] = namespace
deployment.Spec.Template.Labels["project"] = namespace
// Add configmap
deployment.Spec.Template.Spec.Containers[0].Args = append(deployment.Spec.Template.Spec.Containers[0].Args, "--configmap=$(POD_NAMESPACE)/"+deployment.Name)
// Isolate namespace
deployment.Spec.Template.Spec.Containers[0].Args = append(deployment.Spec.Template.Spec.Containers[0].Args, "--watch-namespace="+namespace)
......@@ -362,8 +365,10 @@ func createOrUpdateRouterWorkload(namespace string, publishService bool, service
if deployment.Spec.Template.Spec.Containers[i].Name == "nginx-ingress-controller" {
var args []string
for j := range deployment.Spec.Template.Spec.Containers[i].Args {
if strings.HasPrefix("--publish-service", deployment.Spec.Template.Spec.Containers[i].Args[j]) ||
strings.HasPrefix("--report-node-internal-ip-address", deployment.Spec.Template.Spec.Containers[i].Args[j]) {
argument := deployment.Spec.Template.Spec.Containers[i].Args[j]
if strings.HasPrefix("--publish-service", argument) ||
strings.HasPrefix("--configmap", argument) ||
strings.HasPrefix("--report-node-internal-ip-address", argument) {
continue
}
args = append(args, deployment.Spec.Template.Spec.Containers[i].Args[j])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册