This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push: new 923e504 chore: fix kubernetes yaml not working (#3410) 923e504 is described below commit 923e504e1942522e98cf38262ffd4c728d1a0b90 Author: Shuyang Wu <wosoyo...@gmail.com> AuthorDate: Mon Jan 25 23:57:00 2021 +0800 chore: fix kubernetes yaml not working (#3410) --- conf/config.yaml | 6 ++-- kubernetes/deployment.yaml | 68 +++++++++++++++++++++++----------------------- kubernetes/service.yaml | 12 ++++---- 3 files changed, 42 insertions(+), 44 deletions(-) diff --git a/conf/config.yaml b/conf/config.yaml index 04fb1f7..bed00a2 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -32,10 +32,8 @@ # If the configured environment variable can't be found, an error will be thrown. apisix: admin_key: - - - name: "admin" + - name: "admin" # yamllint disable rule:comments-indentation - key: edd1c9f034335f136f87ad84b625c8f1 # using fixed API token has security risk, please - # update it when you deploy to production environment + key: edd1c9f034335f136f87ad84b625c8f1 # using fixed API token has security risk, please update it when you deploy to production environment # yamllint enable rule:comments-indentation role: admin diff --git a/kubernetes/deployment.yaml b/kubernetes/deployment.yaml index 522beef..069f72e 100644 --- a/kubernetes/deployment.yaml +++ b/kubernetes/deployment.yaml @@ -15,7 +15,7 @@ # limitations under the License. # -apiVersion: apps/v1beta2 # for versions before 1.8.0 use apps/v1beta1 +apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1, before 1.9.0 use apps/v1beta2 kind: Deployment metadata: labels: @@ -35,33 +35,33 @@ spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - apisix-gw - topologyKey: kubernetes.io/hostname - weight: 100 + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - apisix-gw + topologyKey: kubernetes.io/hostname + weight: 100 initContainers: - - command: - - /bin/sh - - -c - - | - sysctl -w net.core.somaxconn=65535 - sysctl -w net.ipv4.ip_local_port_range="1024 65535" - sysctl -w net.ipv4.tcp_max_syn_backlog=8192 - sysctl -w fs.file-max=1048576 - sysctl -w fs.inotify.max_user_instances=16384 - sysctl -w fs.inotify.max_user_watches=524288 - sysctl -w fs.inotify.max_queued_events=16384 - image: busybox:latest - name: init-sysctl - resources: {} - securityContext: - privileged: true - procMount: Default + - command: + - /bin/sh + - -c + - | + sysctl -w net.core.somaxconn=65535 + sysctl -w net.ipv4.ip_local_port_range="1024 65535" + sysctl -w net.ipv4.tcp_max_syn_backlog=8192 + sysctl -w fs.file-max=1048576 + sysctl -w fs.inotify.max_user_instances=16384 + sysctl -w fs.inotify.max_user_watches=524288 + sysctl -w fs.inotify.max_queued_events=16384 + image: busybox:latest + name: init-sysctl + resources: {} + securityContext: + privileged: true + procMount: Default restartPolicy: Always containers: @@ -76,16 +76,16 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: 'apache/apisix:latest' + image: "apache/apisix:latest" imagePullPolicy: IfNotPresent name: apisix-gw-deployment ports: - - containerPort: 9080 - name: http - protocol: TCP - - containerPort: 9443 - name: https - protocol: TCP + - containerPort: 9080 + name: http + protocol: TCP + - containerPort: 9443 + name: https + protocol: TCP readinessProbe: failureThreshold: 6 initialDelaySeconds: 10 diff --git a/kubernetes/service.yaml b/kubernetes/service.yaml index 2990bc8..59cd829 100644 --- a/kubernetes/service.yaml +++ b/kubernetes/service.yaml @@ -21,7 +21,7 @@ metadata: name: apisix-gw-lb # namespace: default labels: - app: apisix-gw # useful for service discovery, for example, prometheus-operator. + app: apisix-gw # useful for service discovery, for example, prometheus-operator. spec: ports: - name: http @@ -36,8 +36,8 @@ spec: # port: 9180 # protocol: TCP # targetPort: 9180 - selector: - app: apisix-gw - type: NodePort - externalTrafficPolicy: Local - # sessionAffinity: None + selector: + app: apisix-gw + type: NodePort + externalTrafficPolicy: Local + # sessionAffinity: None