You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2022/03/18 07:08:33 UTC

[apisix] branch master updated: refactor: move kubernetes configuration files to t/chaos. (#6634)

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

spacewander 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 003b89d  refactor: move kubernetes configuration files to t/chaos. (#6634)
003b89d is described below

commit 003b89d39c3781fea4bb8f2e0488647275826686
Author: 123liubao <87...@users.noreply.github.com>
AuthorDate: Fri Mar 18 15:08:22 2022 +0800

    refactor: move kubernetes configuration files to t/chaos. (#6634)
---
 .github/workflows/chaos.yml                        |   4 +-
 kubernetes/README.md                               | 102 ---------------------
 kubernetes/service-monitor-for-prometheus.yaml     |  38 --------
 {kubernetes => t/chaos/kubernetes}/deployment.yaml |   0
 {kubernetes => t/chaos/kubernetes}/service.yaml    |   0
 t/chaos/utils/setup_chaos_utils.sh                 |   2 +-
 6 files changed, 3 insertions(+), 143 deletions(-)

diff --git a/.github/workflows/chaos.yml b/.github/workflows/chaos.yml
index 6780337..9398a21 100644
--- a/.github/workflows/chaos.yml
+++ b/.github/workflows/chaos.yml
@@ -62,8 +62,8 @@ jobs:
         run: |
           bash ./t/chaos/utils/setup_chaos_utils.sh modify_config
           kubectl create configmap apisix-gw-config.yaml --from-file=./conf/config.yaml
-          kubectl apply -f ./kubernetes/deployment.yaml
-          kubectl apply -f ./kubernetes/service.yaml
+          kubectl apply -f ./t/chaos/kubernetes/deployment.yaml
+          kubectl apply -f ./t/chaos/kubernetes/service.yaml
           kubectl wait pods -l app=apisix-gw --for=condition=Ready --timeout=300s \
             || (kubectl logs -l app=apisix-gw && exit 1)
           kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
diff --git a/kubernetes/README.md b/kubernetes/README.md
deleted file mode 100644
index b91bbc0..0000000
--- a/kubernetes/README.md
+++ /dev/null
@@ -1,102 +0,0 @@
-<!--
-#
-# 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.
-#
--->
-
-### Kubernetes
-
-There are some yaml files for deploying apisix in Kubernetes.
-
-**Note: You can also install Apache APISIX in Kubernetes by [Helm Chart](https://github.com/apache/apisix-helm-chart).**
-
-### Prerequisites
-
-- use `etcd`, if there is no `etcd` service, please install and set etcd address in `../conf/config.yaml`
-
-### Usage
-
-#### Create configmap for apache apisix
-
-if you do not need to change any config, and use default config in `../conf/config.yaml`
-
-```
-$ kubectl create configmap apisix-gw-config.yaml --from-file=../conf/config.yaml
-```
-
-#### When using etcd-operator
-
-when using etcd-operator, you need to change `apisix-gw-config-cm.yaml`:
-
-* add CoreDNS IP into dns_resolver
-
-```
-dns_resolver:
-  - 10.233.0.3      # default coreDNS cluster ip
-
-```
-
-* change etcd host
-
-Following {your-namespace} should be changed to your namespace, for example `default`.
-> Mention: must use `Full Qualified Domain Name`. Short name `etcd-cluster-client` is not work.
-
-```
-etcd:
-  host:
-    - "http://etcd-cluster-client.{your-namespace}.svc.cluster.local:2379"     # multiple etcd address
-```
-
-#### Create deployment for apache apisix
-
-```
-$ kubectl apply -f deployment.yaml
-```
-
-#### Create service for apache apisix
-
-```
-$ kubectl apply -f service.yaml
-```
-
-#### Scale apache apisix
-
-```
-$ kubectl scale deployment apisix-gw-deployment --replicas=4
-```
-
-#### Check running status
-
-```
-$ kubectl get cm | grep -i apisix
-apisix-gw-config.yaml                             1      1d
-
-$ kubectl get pod | grep -i apisix
-apisix-gw-deployment-68df7c7578-5pvxb   1/1     Running   0          1d
-apisix-gw-deployment-68df7c7578-kn89l   1/1     Running   0          1d
-apisix-gw-deployment-68df7c7578-i830r   1/1     Running   0          1d
-apisix-gw-deployment-68df7c7578-32ow1   1/1     Running   0          1d
-
-$ kubectl get svc | grep -i apisix
-apisix-gw-svc            LoadBalancer   172.19.33.28    10.253.0.11   80:31141/TCP,443:30931/TCP                  1d
-
-```
-
-#### Clean up (dangerous)
-
-```
-kubectl delete -f .
-```
diff --git a/kubernetes/service-monitor-for-prometheus.yaml b/kubernetes/service-monitor-for-prometheus.yaml
deleted file mode 100644
index ce5e075..0000000
--- a/kubernetes/service-monitor-for-prometheus.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# 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.
-#
-
-# when using prometheus-operator, you can apply this into k8s.
-# Mention: ServiceMonitor should be the same namespace with prometheus-operator.
----
-apiVersion: monitoring.coreos.com/v1
-kind: ServiceMonitor
-metadata:
-  name: apisix-gw
-  labels:
-    app: apisix-gw
-spec:
-  endpoints:
-    - interval: 10s
-      honorLabels: true
-      port: http
-      path: /apisix/prometheus/metrics
-      scheme: http
-  selector:
-    matchLabels:
-      app: apisix-gw
-  namespaceSelector:
-    any: true
diff --git a/kubernetes/deployment.yaml b/t/chaos/kubernetes/deployment.yaml
similarity index 100%
rename from kubernetes/deployment.yaml
rename to t/chaos/kubernetes/deployment.yaml
diff --git a/kubernetes/service.yaml b/t/chaos/kubernetes/service.yaml
similarity index 100%
rename from kubernetes/service.yaml
rename to t/chaos/kubernetes/service.yaml
diff --git a/t/chaos/utils/setup_chaos_utils.sh b/t/chaos/utils/setup_chaos_utils.sh
index 5fd60e0..9c08fed 100755
--- a/t/chaos/utils/setup_chaos_utils.sh
+++ b/t/chaos/utils/setup_chaos_utils.sh
@@ -41,7 +41,7 @@ plugin_attr:
   prometheus:
     enable_export_server: false
   " > ./conf/config.yaml
-    sed -i -e 's/apisix:latest/apisix:alpine-local/g' kubernetes/deployment.yaml
+    sed -i -e 's/apisix:latest/apisix:alpine-local/g' t/chaos/kubernetes/deployment.yaml
 }
 
 port_forward() {