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 ef552b8 feat: add configmap for deploy (#107)
ef552b8 is described below
commit ef552b8ba799c907f9205a7952b28a7b42286d37
Author: kv <[email protected]>
AuthorDate: Fri Dec 18 13:44:19 2020 +0800
feat: add configmap for deploy (#107)
* add configmap for deploy
* fix: license check
* add EOL
---
Dockerfile | 2 +-
conf/config-default.yaml | 5 +--
samples/deploy/configmap/apisix-ingress-cm.yaml | 53 +++++++++++++++++++++++
samples/deploy/{ => configmap}/kustomization.yaml | 11 +----
samples/deploy/deployment/ingress-controller.yaml | 8 ++++
samples/deploy/kustomization.yaml | 1 +
6 files changed, 66 insertions(+), 14 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 7cf462b..9059cbf 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -36,4 +36,4 @@ RUN apk add --no-cache ca-certificates libc6-compat \
COPY --from=build-env /build/apisix-ingress-controller .
COPY --from=build-env /usr/share/zoneinfo/Hongkong /etc/localtime
-ENTRYPOINT ["/ingress-apisix/apisix-ingress-controller", "ingress"]
+ENTRYPOINT ["/ingress-apisix/apisix-ingress-controller", "ingress",
"--config-path", "/ingress-apisix/config.yaml"]
diff --git a/conf/config-default.yaml b/conf/config-default.yaml
index d2466f9..7ff9978 100644
--- a/conf/config-default.yaml
+++ b/conf/config-default.yaml
@@ -41,8 +41,5 @@ kubernetes:
# APISIX related configurations.
apisix:
- base_url: "http://host:port/foo/bar/baz" # the APISIX admin api / manager api
+ base_url: "http://127.0.0.1:9080/apisix/admin" # the APISIX admin api /
manager api
# base url, it's required.
- #admin_key: "blahblahblah" # admin key for the authorization
- # of APISIX admin api / manager api,
- # default is empty.
diff --git a/samples/deploy/configmap/apisix-ingress-cm.yaml
b/samples/deploy/configmap/apisix-ingress-cm.yaml
new file mode 100644
index 0000000..5781d6f
--- /dev/null
+++ b/samples/deploy/configmap/apisix-ingress-cm.yaml
@@ -0,0 +1,53 @@
+#
+# 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: "info" # the error log level, default is info, optional
values are:
+ # debug
+ # info
+ # warn
+ # error
+ # panic
+ # fatal
+ log_output: "stderr" # the output file path of error log, default is
stderr, when
+ # the file path is "stderr" or "stdout", logs are
marshalled
+ # plainly, which is more readable for human; otherwise
logs
+ # are marshalled in JSON format, which can be parsed by
+ # programs easily.
+
+ http_listen: ":8080" # the HTTP Server listen address, default is ":8080"
+ enable_profiling: true # enable profileing via web interfaces
+ # host:port/debug/pprof, default is true.
+
+ # Kubernetes related configurations.
+ kubernetes:
+ kubeconfig: "" # the Kubernetes configuration file path, default
is
+ # "", so the in-cluster configuration will be used.
+ resync_interval: "60s" # how long should apisix-ingress-controller
+ # re-synchronizes with Kubernetes, default is 60s,
+ # and the minimal resync interval is 30s.
+
+ # APISIX related configurations.
+ apisix:
+ base_url: "http://127.0.0.1:9080/apisix/admin" # the APISIX admin api /
manager api
+ # base url, it's required.
+kind: ConfigMap
+metadata:
+ name: apisix-ingress-cm
diff --git a/samples/deploy/kustomization.yaml
b/samples/deploy/configmap/kustomization.yaml
similarity index 79%
copy from samples/deploy/kustomization.yaml
copy to samples/deploy/configmap/kustomization.yaml
index 85d4ead..7ecd5e4 100644
--- a/samples/deploy/kustomization.yaml
+++ b/samples/deploy/configmap/kustomization.yaml
@@ -15,12 +15,5 @@
# limitations under the License.
#
-apiVersion: kustomize.config.k8s.io/v1beta1
-kind: Kustomization
-namespace: ingress-apisix
-commonLabels:
- apisix.apache.org/app: ingress-apisix
-bases:
- - ./deployment
- - ./rbac
- - ./crd/v1beta1
+resources:
+ - ./apisix-ingress-cm.yaml
diff --git a/samples/deploy/deployment/ingress-controller.yaml
b/samples/deploy/deployment/ingress-controller.yaml
index 98a6571..3b67252 100644
--- a/samples/deploy/deployment/ingress-controller.yaml
+++ b/samples/deploy/deployment/ingress-controller.yaml
@@ -49,5 +49,13 @@ spec:
ports:
- containerPort: 8080
hostPort: 8080
+ volumeMounts:
+ - mountPath: /ingress-apisix/config.yaml
+ name: apisix-ingress-configmap
+ subPath: config.yaml
+ volumes:
+ - configMap:
+ name: apisix-ingress-cm
+ name: apisix-ingress-configmap
terminationGracePeriodSeconds: 60
serviceAccountName: apisix-view-serviceaccount
diff --git a/samples/deploy/kustomization.yaml
b/samples/deploy/kustomization.yaml
index 85d4ead..551a3c5 100644
--- a/samples/deploy/kustomization.yaml
+++ b/samples/deploy/kustomization.yaml
@@ -21,6 +21,7 @@ namespace: ingress-apisix
commonLabels:
apisix.apache.org/app: ingress-apisix
bases:
+ - ./configmap
- ./deployment
- ./rbac
- ./crd/v1beta1