flylan commented on code in PR #537:
URL: https://github.com/apache/apisix-helm-chart/pull/537#discussion_r1270187707


##########
charts/apisix/templates/configmap.yaml:
##########
@@ -287,16 +287,16 @@ data:
 
       admin:
         allow_admin:    # 
http://nginx.org/en/docs/http/ngx_http_access_module.html#allow
+        {{- $ipList := list "0.0.0.0/0" -}}
         {{- if .Values.admin.allow.ipList }}
-        {{- range $ips := .Values.admin.allow.ipList }}
-          - {{ $ips }}
+        {{- $ipList = .Values.admin.allow.ipList -}}
         {{- end }}
-        {{- else }}
-          - 0.0.0.0/0
-        {{- end}}
-        {{- if or (index .Values "ingress-controller" "enabled") 
.Values.dashboard.enabled  }}
-          - 0.0.0.0/0
+        {{- if and (or (index .Values "ingress-controller" "enabled") 
.Values.dashboard.enabled) (not (has "0.0.0.0/0" $ipList)) }}
+        {{- $ipList = concat $ipList ( list "127.0.0.1/32" "10.0.0.0/8" 
"172.16.0.0/12" "192.168.0.0/16" ) | uniq -}}

Review Comment:
   Indeed, some companies may directly use public IP as the K8S networking 
environment, such as when multiple subsidiaries are distributed in different 
places
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to