This is an automated email from the ASF dual-hosted git repository.

tokers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git


The following commit(s) were added to refs/heads/master by this push:
     new c597409  chore: support to deploy ingress-apisix through helm charts 
(#153)
c597409 is described below

commit c597409de4722b0ba104db61076198e03617b1de
Author: Alex Zhang <[email protected]>
AuthorDate: Fri Jan 8 21:28:47 2021 +0800

    chore: support to deploy ingress-apisix through helm charts (#153)
    
    related #130
---
 charts/base/.helmignore                         |  23 ++++
 charts/base/Chart.yaml                          |  27 ++++
 charts/base/crds/customresourcedefinitions.yaml |  88 +++++++++++++
 charts/base/templates/NOTES.txt                 |   1 +
 charts/base/templates/_helpers.tpl              |  68 ++++++++++
 charts/base/templates/rbac.yaml                 | 161 ++++++++++++++++++++++++
 charts/ingress-apisix/.helmignore               |  23 ++++
 charts/ingress-apisix/Chart.yaml                |  27 ++++
 charts/ingress-apisix/templates/NOTES.txt       |   5 +
 charts/ingress-apisix/templates/_helpers.tpl    |  80 ++++++++++++
 charts/ingress-apisix/templates/configmap.yaml  |  34 +++++
 charts/ingress-apisix/templates/deployment.yaml |  80 ++++++++++++
 charts/ingress-apisix/templates/hpa.yaml        |  44 +++++++
 charts/ingress-apisix/templates/service.yaml    |  31 +++++
 charts/ingress-apisix/values.yaml               |  59 +++++++++
 docs/install.md                                 |  14 ++-
 16 files changed, 764 insertions(+), 1 deletion(-)

diff --git a/charts/base/.helmignore b/charts/base/.helmignore
new file mode 100644
index 0000000..0e8a0eb
--- /dev/null
+++ b/charts/base/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/charts/base/Chart.yaml b/charts/base/Chart.yaml
new file mode 100644
index 0000000..cad9b06
--- /dev/null
+++ b/charts/base/Chart.yaml
@@ -0,0 +1,27 @@
+#
+# 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: v2
+name: base
+description: Helm chart for deploying ingress-apisix cluster resources and CRDs
+icon: https://apache.org/logos/res/apisix/apisix.png
+keywords:
+  - ingress
+  - apisix
+  - nginx
+  - crd
+type: application
+version: 0.1.0
diff --git a/charts/base/crds/customresourcedefinitions.yaml 
b/charts/base/crds/customresourcedefinitions.yaml
new file mode 100644
index 0000000..0ce112f
--- /dev/null
+++ b/charts/base/crds/customresourcedefinitions.yaml
@@ -0,0 +1,88 @@
+#
+# 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: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: apisixroutes.apisix.apache.org
+spec:
+  group: apisix.apache.org
+  versions:
+    - name: v1
+      served: true
+      storage: true
+  scope: Namespaced
+  names:
+    plural: apisixroutes
+    singular: apisixroute
+    kind: ApisixRoute
+    shortNames:
+      - ar
+---
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: apisixtlses.apisix.apache.org
+spec:
+  group: apisix.apache.org
+  versions:
+    - name: v1
+      served: true
+      storage: true
+  scope: Namespaced
+  names:
+    plural: apisixtlses
+    singular: apisixtls
+    kind: ApisixTls
+    shortNames:
+      - atls
+---
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: apisixupstreams.apisix.apache.org
+spec:
+  group: apisix.apache.org
+  versions:
+    - name: v1
+      served: true
+      storage: true
+  scope: Namespaced
+  names:
+    plural: apisixupstreams
+    singular: apisixupstream
+    kind: ApisixUpstream
+    shortNames:
+      - au
+---
+apiVersion: apiextensions.k8s.io/v1beta1
+kind: CustomResourceDefinition
+metadata:
+  name: apisixservices.apisix.apache.org
+spec:
+  group: apisix.apache.org
+  versions:
+    - name: v1
+      served: true
+      storage: true
+  scope: Namespaced
+  names:
+    plural: apisixservices
+    singular: apisixservice
+    kind: ApisixService
+    shortNames:
+      - as
diff --git a/charts/base/templates/NOTES.txt b/charts/base/templates/NOTES.txt
new file mode 100644
index 0000000..44dc576
--- /dev/null
+++ b/charts/base/templates/NOTES.txt
@@ -0,0 +1 @@
+Installs ingress-apisix cluster resources: CRDs, cluster bindings and 
associated service accounts.
diff --git a/charts/base/templates/_helpers.tpl 
b/charts/base/templates/_helpers.tpl
new file mode 100644
index 0000000..6131f0d
--- /dev/null
+++ b/charts/base/templates/_helpers.tpl
@@ -0,0 +1,68 @@
+#
+# 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.
+#
+
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "base.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to 
this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "base.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "base.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | 
trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "base.labels" -}}
+helm.sh/chart: {{ include "base.chart" . }}
+{{ include "base.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "base.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "base.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end }}
diff --git a/charts/base/templates/rbac.yaml b/charts/base/templates/rbac.yaml
new file mode 100644
index 0000000..22fd2a9
--- /dev/null
+++ b/charts/base/templates/rbac.yaml
@@ -0,0 +1,161 @@
+#
+# 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: {{ .Release.Name }}-serviceaccount
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+  name: {{ .Release.Name }}-clusterrole
+rules:
+  - apiGroups:
+      - ""
+    resources:
+      - configmaps
+      - endpoints
+      - persistentvolumeclaims
+      - pods
+      - replicationcontrollers
+      - replicationcontrollers/scale
+      - serviceaccounts
+      - services
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - bindings
+      - events
+      - limitranges
+      - namespaces/status
+      - pods/log
+      - pods/status
+      - replicationcontrollers/status
+      - resourcequotas
+      - resourcequotas/status
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - ""
+    resources:
+      - namespaces
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - apps
+    resources:
+      - controllerrevisions
+      - daemonsets
+      - deployments
+      - deployments/scale
+      - replicasets
+      - replicasets/scale
+      - statefulsets
+      - statefulsets/scale
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - autoscaling
+    resources:
+      - horizontalpodautoscalers
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - batch
+    resources:
+      - cronjobs
+      - jobs
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - extensions
+    resources:
+      - daemonsets
+      - deployments
+      - deployments/scale
+      - ingresses
+      - networkpolicies
+      - replicasets
+      - replicasets/scale
+      - replicationcontrollers/scale
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - policy
+    resources:
+      - poddisruptionbudgets
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - networking.k8s.io
+    resources:
+      - ingresses
+      - networkpolicies
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - metrics.k8s.io
+    resources:
+      - pods
+    verbs:
+      - get
+      - list
+      - watch
+  - apiGroups:
+      - apisix.apache.org
+    resources:
+      - apisixroutes
+      - apisixupstreams
+      - apisixservices
+      - apisixtlses
+    verbs:
+      - get
+      - list
+      - watch
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+  name: {{ .Release.Name }}-clusterrolebinding
+roleRef:
+  apiGroup: rbac.authorization.k8s.io
+  kind: ClusterRole
+  name: {{ .Release.Name }}-clusterrole
+subjects:
+  - kind: ServiceAccount
+    name: {{ .Release.Name }}-serviceaccount
+    namespace: {{ .Release.Namespace }}
diff --git a/charts/ingress-apisix/.helmignore 
b/charts/ingress-apisix/.helmignore
new file mode 100644
index 0000000..0e8a0eb
--- /dev/null
+++ b/charts/ingress-apisix/.helmignore
@@ -0,0 +1,23 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*.orig
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
+.vscode/
diff --git a/charts/ingress-apisix/Chart.yaml b/charts/ingress-apisix/Chart.yaml
new file mode 100644
index 0000000..991c077
--- /dev/null
+++ b/charts/ingress-apisix/Chart.yaml
@@ -0,0 +1,27 @@
+#
+# 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: v2
+name: ingress-apisix
+description: Apache APISIX Ingress Controller for Kubernetes
+icon: https://apache.org/logos/res/apisix/apisix.png
+keywords:
+  - ingress
+  - apisix
+  - nginx
+type: application
+version: 0.1.0
+appVersion: 0.1.0
diff --git a/charts/ingress-apisix/templates/NOTES.txt 
b/charts/ingress-apisix/templates/NOTES.txt
new file mode 100644
index 0000000..dda31fd
--- /dev/null
+++ b/charts/ingress-apisix/templates/NOTES.txt
@@ -0,0 +1,5 @@
+Get the application URL by running these commands:
+export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l 
"app.kubernetes.io/name={{ include "ingress-apisix.name" . 
}},app.kubernetes.io/instance={{ .Release.Name }}" -o 
jsonpath="{.items[0].metadata.name}")
+export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} 
$POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
+echo "Visit http://127.0.0.1:8080 to use your application"
+kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 
8080:$CONTAINER_PORT
diff --git a/charts/ingress-apisix/templates/_helpers.tpl 
b/charts/ingress-apisix/templates/_helpers.tpl
new file mode 100644
index 0000000..b52627c
--- /dev/null
+++ b/charts/ingress-apisix/templates/_helpers.tpl
@@ -0,0 +1,80 @@
+#
+# 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.
+#
+
+{{/*
+Expand the name of the chart.
+*/}}
+{{- define "ingress-apisix.name" -}}
+{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Create a default fully qualified app name.
+We truncate at 63 chars because some Kubernetes name fields are limited to 
this (by the DNS naming spec).
+If release name contains chart name it will be used as a full name.
+*/}}
+{{- define "ingress-apisix.fullname" -}}
+{{- if .Values.fullnameOverride }}
+{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- $name := default .Chart.Name .Values.nameOverride }}
+{{- if contains $name .Release.Name }}
+{{- .Release.Name | trunc 63 | trimSuffix "-" }}
+{{- else }}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
+{{- end }}
+{{- end }}
+{{- end }}
+
+{{/*
+Create chart name and version as used by the chart label.
+*/}}
+{{- define "ingress-apisix.chart" -}}
+{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | 
trimSuffix "-" }}
+{{- end }}
+
+{{/*
+Common labels
+*/}}
+{{- define "ingress-apisix.labels" -}}
+helm.sh/chart: {{ include "ingress-apisix.chart" . }}
+{{ include "ingress-apisix.selectorLabels" . }}
+{{- if .Chart.AppVersion }}
+app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
+{{- end }}
+app.kubernetes.io/managed-by: {{ .Release.Service }}
+{{- end }}
+
+{{/*
+Selector labels
+*/}}
+{{- define "ingress-apisix.selectorLabels" -}}
+app.kubernetes.io/name: {{ include "ingress-apisix.name" . }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+
+{{- end }}
+
+{{/*
+Create the name of the clusterrole to use
+*/}}
+{{- define "ingress-apisix.clusterRole" -}}
+{{- if .Values.rbac.enable }}
+{{- default (include "ingress-apisix.fullname" .) .Values.rbac.clusterRole }}
+{{- else }}
+{{- default "default" .Values.rbac.clusterRole }}
+{{- end }}
+{{- end }}
diff --git a/charts/ingress-apisix/templates/configmap.yaml 
b/charts/ingress-apisix/templates/configmap.yaml
new file mode 100644
index 0000000..43ab4a3
--- /dev/null
+++ b/charts/ingress-apisix/templates/configmap.yaml
@@ -0,0 +1,34 @@
+#
+# 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
+data:
+  config.yaml: |
+    # log options
+    log_level: {{ .Values.ingressController.config.logLevel | quote }}
+    log_output: {{ .Values.ingressController.config.logOutput | quote }}
+    http_listen: {{ .Values.ingressController.config.httpListen | quote }}
+    enable_profiling: {{ .Values.ingressController.config.enableProfiling }}
+    kubernetes:
+      kubeconfig: {{ .Values.ingressController.config.kubernetes.kubeconfig | 
quote }}
+      resync_interval: {{ 
.Values.ingressController.config.kubernetes.resyncInterval | quote }}
+    apisix:
+      base_url: {{ .Values.ingressController.config.apisix.baseURL | quote }}
+kind: ConfigMap
+metadata:
+  name: {{ .Release.Name }}-configmap
+  labels:
+    {{- include "ingress-apisix.labels" . | nindent 4 }}
diff --git a/charts/ingress-apisix/templates/deployment.yaml 
b/charts/ingress-apisix/templates/deployment.yaml
new file mode 100644
index 0000000..b96e811
--- /dev/null
+++ b/charts/ingress-apisix/templates/deployment.yaml
@@ -0,0 +1,80 @@
+#
+# 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:
+      labels:
+        {{- include "ingress-apisix.selectorLabels" . | nindent 8 }}
+    spec:
+      {{- with .Values.ingressController.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      serviceAccountName: {{ .Values.ingressController.serviceAccount }}
+      volumes:
+        - name: configuration
+          configMap:
+            name: {{ .Release.Name }}-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
+          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: {{ (.Values.ingressController.config.httpListen | split 
":")._1 }}
+          readinessProbe:
+            httpGet:
+              path: /healthz
+              port: {{ (.Values.ingressController.config.httpListen | split 
":")._1 }}
+          resources:
+            {{- toYaml .Values.ingressController.resources | nindent 12 }}
+          volumeMounts:
+            - mountPath: /ingress-apisix/conf
+              name: configuration
+      {{- with .Values.ingressController.nodeSelector }}
+      nodeSelector:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      {{- with .Values.ingressController.tolerations }}
+      tolerations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
diff --git a/charts/ingress-apisix/templates/hpa.yaml 
b/charts/ingress-apisix/templates/hpa.yaml
new file mode 100644
index 0000000..9edabf3
--- /dev/null
+++ b/charts/ingress-apisix/templates/hpa.yaml
@@ -0,0 +1,44 @@
+#
+# 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.
+#
+  {{- if .Values.ingressController.autoscaling.enabled }}
+apiVersion: autoscaling/v2beta1
+kind: HorizontalPodAutoscaler
+metadata:
+  name: {{ include "ingress-apisix.fullname" . }}
+  labels:
+    {{- include "ingress-apisix.labels" . | nindent 4 }}
+spec:
+  scaleTargetRef:
+    apiVersion: apps/v1
+    kind: Deployment
+    name: {{ include "ingress-apisix.fullname" . }}
+  minReplicas: {{ .Values.ingressController.autoscaling.minReplicas }}
+  maxReplicas: {{ .Values.ingressController.autoscaling.maxReplicas }}
+  metrics:
+    {{- if 
.Values.ingressController.autoscaling.targetCPUUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: cpu
+        targetAverageUtilization: {{ 
.Values.ingressController.autoscaling.targetCPUUtilizationPercentage }}
+    {{- end }}
+    {{- if 
.Values.ingressController.autoscaling.targetMemoryUtilizationPercentage }}
+    - type: Resource
+      resource:
+        name: memory
+        targetAverageUtilization: {{ 
.Values.ingressController.autoscaling.targetMemoryUtilizationPercentage }}
+    {{- end }}
+{{- end }}
diff --git a/charts/ingress-apisix/templates/service.yaml 
b/charts/ingress-apisix/templates/service.yaml
new file mode 100644
index 0000000..a4de583
--- /dev/null
+++ b/charts/ingress-apisix/templates/service.yaml
@@ -0,0 +1,31 @@
+#
+# 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: Service
+metadata:
+  name: {{ include "ingress-apisix.fullname" . }}
+  labels:
+    {{- include "ingress-apisix.labels" . | nindent 4 }}
+spec:
+  type: ClusterIP
+  ports:
+    - port: {{ .Values.ingressController.service.port }}
+      targetPort: {{ (.Values.ingressController.config.httpListen | split 
":")._1 }}
+      protocol: TCP
+      name: http
+  selector:
+    {{- include "ingress-apisix.selectorLabels" . | nindent 4 }}
diff --git a/charts/ingress-apisix/values.yaml 
b/charts/ingress-apisix/values.yaml
new file mode 100644
index 0000000..ce94cce
--- /dev/null
+++ b/charts/ingress-apisix/values.yaml
@@ -0,0 +1,59 @@
+#
+# 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: ""
+  serviceAccount: "ingress-apisix-base-serviceaccount"
+
+  service:
+    port: 80
+
+  config:
+    logLevel: "info"
+    logOutput: "stderr"
+    httpListen: ":8080"
+    enableProfiling: true
+    kubernetes:
+      kubeconfig: ""
+      resyncInterval: "60s"
+    apisix:
+      baseURL: "http://127.0.0.1:9080/apisix/admin";
+
+  resources: {}
+
+  autoscaling:
+    enabled: false
+    minReplicas: 1
+    maxReplicas: 100
+    targetCPUUtilizationPercentage: 80
+    # targetMemoryUtilizationPercentage: 80
+
+  nodeSelector: {}
+  tolerations: []
diff --git a/docs/install.md b/docs/install.md
index 1eb6cdf..e3bf5ad 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -54,7 +54,19 @@ kubectl apply -k 
/path/to/apisix-ingress-controller/samples/deploy
 
 ## Helm
 
-// todo
+First of all, deploying the necessary CRDs and cluster resources like 
serviceaccount through the [base](../charts/base) chart.
+
+```shell
+helm install ingress-apisix-base -n ingress-apisix ./charts/base
+```
+
+Note namespace `ingress-apisix` should be created before you run the above 
command.
+
+Then try to deploy apisix-ingress-controller through the 
[ingress-apisix](../charts/ingress-apisix) chart.
+
+```shell
+helm install ingress-apisix -n ingress-apisix ./charts/ingress-apisix
+```
 
 ## Master branch builds
 

Reply via email to