ShiningRush commented on a change in pull request #153:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/153#discussion_r552313667



##########
File path: charts/base/templates/rbac.yaml
##########
@@ -0,0 +1,179 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ .Values.rbac.serviceAccount }}
+  labels:
+    {{- include "base.labels" . | nindent 4 }}
+  {{- with .Values.rbac.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: {{ .Values.rbac.clusterRole }}
+  labels:
+    {{- include "base.labels" . | nindent 4 }}
+  {{- with .Values.rbac.annotations }}
+  annotations:
+    {{- toYaml . | nindent 4 }}
+  {{- end }}
+rules:
+  - apiGroups:
+      - ""
+    resources:

Review comment:
       Are we really need to watch so many resource?

##########
File path: charts/base/templates/rbac.yaml
##########
@@ -0,0 +1,179 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ .Values.rbac.serviceAccount }}

Review comment:
       this name could be fixed format, such as ` {{ .Release.Name }} ` or ` {{ 
.Release.Name }}-svcacc`, it will make values.yaml more simple.

##########
File path: charts/base/templates/rbac.yaml
##########
@@ -0,0 +1,179 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+  name: {{ .Values.rbac.serviceAccount }}
+  labels:
+    {{- include "base.labels" . | nindent 4 }}

Review comment:
       Do we really need user to control the labels and annotation? This will 
complicate values.yaml

##########
File path: charts/ingress-apisix/values.yaml
##########
@@ -0,0 +1,66 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Default values for ingress-apisix.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.

Review comment:
       I think this chart has too many configurable options for users, such as 
`affinity`, `label`, `annotation`, `toleration`, etc, which leads to too many 
configurations of values.yaml, but most of them are not help to controller's 
logic  It is rarely used even when I managing the resources of a large cluster).
   
   I think the number of options for an easy-to-use chart should be just 
enough, and then gradually evolve, the more the configuration, the easier it is 
to make mistakes, whether it is for the user or the maintenance person.

##########
File path: charts/ingress-apisix/templates/deployment.yaml
##########
@@ -0,0 +1,92 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "ingress-apisix.fullname" . }}
+  labels:
+    {{- include "ingress-apisix.labels" . | nindent 4 }}
+spec:
+  {{- if not .Values.ingressController.autoscaling.enabled }}
+  replicas: {{ .Values.ingressController.replicaCount }}
+  {{- end }}
+  selector:
+    matchLabels:
+      {{- include "ingress-apisix.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      {{- with .Values.ingressController.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      labels:
+        {{- include "ingress-apisix.selectorLabels" . | nindent 8 }}
+    spec:
+      {{- with .Values.ingressController.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      serviceAccountName: {{ .Values.ingressController.serviceAccount }}
+      securityContext:
+        {{- toYaml .Values.ingressController.podSecurityContext | nindent 8 }}
+      volumes:
+        - name: configuration
+          configMap:
+            name: {{ .Values.ingressController.configmap }}
+            items:
+              - key: config.yaml
+                path: config.yaml
+      containers:
+        - name: {{ .Chart.Name }}
+          command:
+            - /ingress-apisix/apisix-ingress-controller
+            - ingress
+            - --config-path
+            - /ingress-apisix/conf/config.yaml
+          securityContext:
+            {{- toYaml .Values.ingressController.securityContext | nindent 12 
}}
+          image: "{{ .Values.ingressController.image.repository }}:{{ 
.Values.ingressController.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.ingressController.image.pullPolicy }}
+          ports:
+            - name: http
+              containerPort: {{ (.Values.ingressController.config.httpListen | 
split ":")._1 }}

Review comment:
       `.Values.ingressController.config.httpListen` is `:8080`, but liveness 
work at `80(http)`?

##########
File path: charts/ingress-apisix/templates/deployment.yaml
##########
@@ -0,0 +1,92 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "ingress-apisix.fullname" . }}
+  labels:
+    {{- include "ingress-apisix.labels" . | nindent 4 }}
+spec:
+  {{- if not .Values.ingressController.autoscaling.enabled }}
+  replicas: {{ .Values.ingressController.replicaCount }}
+  {{- end }}
+  selector:
+    matchLabels:
+      {{- include "ingress-apisix.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      {{- with .Values.ingressController.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      labels:
+        {{- include "ingress-apisix.selectorLabels" . | nindent 8 }}
+    spec:
+      {{- with .Values.ingressController.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      serviceAccountName: {{ .Values.ingressController.serviceAccount }}
+      securityContext:
+        {{- toYaml .Values.ingressController.podSecurityContext | nindent 8 }}
+      volumes:
+        - name: configuration
+          configMap:
+            name: {{ .Values.ingressController.configmap }}
+            items:
+              - key: config.yaml
+                path: config.yaml
+      containers:
+        - name: {{ .Chart.Name }}
+          command:
+            - /ingress-apisix/apisix-ingress-controller
+            - ingress
+            - --config-path
+            - /ingress-apisix/conf/config.yaml
+          securityContext:
+            {{- toYaml .Values.ingressController.securityContext | nindent 12 
}}
+          image: "{{ .Values.ingressController.image.repository }}:{{ 
.Values.ingressController.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.ingressController.image.pullPolicy }}
+          ports:
+            - name: http
+              containerPort: {{ (.Values.ingressController.config.httpListen | 
split ":")._1 }}
+              protocol: TCP
+          livenessProbe:
+            httpGet:
+              path: /healthz
+              port: http
+          readinessProbe:
+            httpGet:
+              path: /healthz
+              port: http
+          resources:
+            {{- toYaml .Values.ingressController.resources | nindent 12 }}
+          volumeMounts:
+            - mountPath: /ingress-apisix/conf
+              name: configuration
+      {{- with .Values.ingressController.nodeSelector }}

Review comment:
       `nodeSelector` and `affinity` is similar, just one of them is enough

##########
File path: charts/ingress-apisix/values.yaml
##########
@@ -0,0 +1,66 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Default values for ingress-apisix.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+ingressController:
+  replicaCount: 1
+
+  image:
+    repository: apache/apisix-ingress-controller
+    pullPolicy: IfNotPresent
+    tag: "0.1.0"
+
+  imagePullSecrets: []
+  nameOverride: ""
+  fullnameOverride: ""
+  podAnnotations: {}
+  podSecurityContext: {}
+  securityContext: {}
+
+  configmap: "apisix-ingress-cm"
+  serviceAccount: "apisix-view-serviceaccount"
+
+  service:
+    type: ClusterIP

Review comment:
       This option can not work well, if we selected `NodePort`, we maybe need 
to specified node port, but here is no such parameter.




----------------------------------------------------------------
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.

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


Reply via email to