From 92059b7f99f607c64f739901eb23be26e39c814b Mon Sep 17 00:00:00 2001 From: tokers Date: Wed, 9 Dec 2020 15:52:04 +0800 Subject: [PATCH 1/4] chore: support to use kustomize install all resources --- docs/deploy.md | 94 +----------------- docs/develop.md | 61 +----------- docs/install.md | 97 +------------------ .../configmap/{cloud.yaml => apisix.yaml} | 0 samples/deploy/configmap/kustomization.yaml | 2 + samples/deploy/crd/v1beta1/ApisixRoute.yaml | 17 ++++ samples/deploy/crd/v1beta1/ApisixService.yaml | 17 ++++ .../deploy/crd/v1beta1/ApisixUpstream.yaml | 17 ++++ samples/deploy/crd/v1beta1/kustomization.yaml | 4 + samples/deploy/deployment/kustomization.yaml | 2 + samples/deploy/kustomization.yaml | 10 ++ .../rbac/apisix_view_clusterrolebinding.yaml | 1 - samples/deploy/rbac/kustomization.yaml | 4 + 13 files changed, 85 insertions(+), 241 deletions(-) rename samples/deploy/configmap/{cloud.yaml => apisix.yaml} (100%) create mode 100644 samples/deploy/configmap/kustomization.yaml create mode 100644 samples/deploy/crd/v1beta1/ApisixRoute.yaml create mode 100644 samples/deploy/crd/v1beta1/ApisixService.yaml create mode 100644 samples/deploy/crd/v1beta1/ApisixUpstream.yaml create mode 100644 samples/deploy/crd/v1beta1/kustomization.yaml create mode 100644 samples/deploy/deployment/kustomization.yaml create mode 100644 samples/deploy/kustomization.yaml create mode 100644 samples/deploy/rbac/kustomization.yaml diff --git a/docs/deploy.md b/docs/deploy.md index 5ba74fcdbb..108655d362 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -1,101 +1,17 @@ # 集群部署 -## 配置RBAC -示例文件在项目下的samples下 -* 执行下面的命令之前按需修改一下name和namespaces -### 1.创建ServiceAccount +## 安装依赖 -```shell -kubectl apply -f samples/deploy/rbac/service_account.yaml -``` +通过 [kustomize](https://kustomize.io/) 安装所需要的依赖。 -### 2.创建ClusterRole ```shell -kubectl apply -f samples/deploy/rbac/apisix_view_clusterrole.yaml +kubectl kustomize "github.com/apache/apisix-ingress-controller?ref=master" | kubectl apply -f - ``` -### 3.创建ClusterRoleBinding -```shell -kubectl apply -f samples/deploy/rbac/apisix_view_clusterrolebinding.yaml -``` - -## 配置 ConfigMap -* 执行命令之前按需修改 +上述命令会将 samples/deploy 中声明的配置应用到你的 Kubernetes 集群,如果该目录中的默认配置参数无法满足你的需求,可以考虑修改后再安装: ```shell -kubectl apply -f samples/deploy/configmap/cloud.yaml -``` - -## 配置 Deployment -* 执行命令之前按需修改name和namespaces,并且补充APISIX ingress controller image路径和版本号 - - -```shell -kubectl apply -f samples/deploy/deployment/ingress-controller.yaml -``` - -## CRD定义文件 - -如果APISIX CRD还未定义,执行以下脚本 -``` -kubectl apply -f - < Date: Wed, 9 Dec 2020 16:24:40 +0800 Subject: [PATCH 2/4] doc: fixed kubectl kustomize link --- docs/deploy.md | 2 +- docs/install.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/deploy.md b/docs/deploy.md index 108655d362..4aaeb1c6e5 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -5,7 +5,7 @@ 通过 [kustomize](https://kustomize.io/) 安装所需要的依赖。 ```shell -kubectl kustomize "github.com/apache/apisix-ingress-controller?ref=master" | kubectl apply -f - +kubectl kustomize "github.com/apache/apisix-ingress-controller/samples/deploy?ref=master" | kubectl apply -f - ``` 上述命令会将 samples/deploy 中声明的配置应用到你的 Kubernetes 集群,如果该目录中的默认配置参数无法满足你的需求,可以考虑修改后再安装: diff --git a/docs/install.md b/docs/install.md index 6c8f82a9ff..039547907e 100644 --- a/docs/install.md +++ b/docs/install.md @@ -18,7 +18,7 @@ To install `ingress controller` in k8s, need to care about 3 parts: Install the abovementioned resources by [Kustomize](https://kustomize.io/): ```shell -kubectl kustomize "github.com/apache/apisix-ingress-controller?ref=master" | kubectl apply -f - +kubectl kustomize "github.com/apache/apisix-ingress-controller/samples/deploy?ref=master" | kubectl apply -f - ``` If the default parameters in samples/deploy are not good for you, just tweak them and run: From 5b949fe46a1031505ca6d4d81ea00c6c749cf5db Mon Sep 17 00:00:00 2001 From: tokers Date: Wed, 9 Dec 2020 16:37:53 +0800 Subject: [PATCH 3/4] doc: removed deploy.md --- docs/deploy.md | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 docs/deploy.md diff --git a/docs/deploy.md b/docs/deploy.md deleted file mode 100644 index 4aaeb1c6e5..0000000000 --- a/docs/deploy.md +++ /dev/null @@ -1,36 +0,0 @@ -# 集群部署 - -## 安装依赖 - -通过 [kustomize](https://kustomize.io/) 安装所需要的依赖。 - -```shell -kubectl kustomize "github.com/apache/apisix-ingress-controller/samples/deploy?ref=master" | kubectl apply -f - -``` - -上述命令会将 samples/deploy 中声明的配置应用到你的 Kubernetes 集群,如果该目录中的默认配置参数无法满足你的需求,可以考虑修改后再安装: - -```shell -kubectl apply -k samples/deploy -``` - -## 通过CRD定义apisix路由的描述文件 - -尝试通过ApisixRoute定义一个路由 -``` -kubectl apply -f - < Date: Wed, 9 Dec 2020 17:02:05 +0800 Subject: [PATCH 4/4] fix: add shell in code snippet --- docs/develop.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/develop.md b/docs/develop.md index 5b0a856385..ef46ff2a31 100644 --- a/docs/develop.md +++ b/docs/develop.md @@ -36,7 +36,7 @@ Configure the service address of Apache APISIX to conf/apisix/base_url ($GOPATH/ * Create CRDs -``` +```shell kubectl apply -k samples/deploy/crd/v1beta1 ```