Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support to use kustomize install all resources #72

Merged
merged 4 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 0 additions & 120 deletions docs/deploy.md

This file was deleted.

61 changes: 2 additions & 59 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,65 +36,8 @@ Configure the service address of Apache APISIX to conf/apisix/base_url ($GOPATH/

* Create CRDs

```yaml
kubectl apply -f - <<EOF
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: 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

---
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

EOF
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add shell

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

kubectl apply -k samples/deploy/crd/v1beta1
```

* Run apisix-ingress-controller
Expand Down
97 changes: 5 additions & 92 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,105 +13,18 @@ To install `ingress controller` in k8s, need to care about 3 parts:

3. Configmap: Contains the necessary configuration for `ingress controller`.

## CRDs installation
## Kustomize

Install CRDs in Kubernetes
Install the abovementioned resources by [Kustomize](https://kustomize.io/):

```shell
kubectl apply -f - <<EOF
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: 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

---
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

EOF
kubectl kustomize "github.com/apache/apisix-ingress-controller/samples/deploy?ref=master" | kubectl apply -f -
```

## RBAC configuration

* Create ServiceAccount

```shell
kubectl apply -f ../samples/deploy/rbac/service_account.yaml
```

* Create ClusterRole

```shell
kubectl apply -f ../samples/deploy/rbac/apisix_view_clusterrole.yaml
```

* Create ClusterRoleBinding

```shell
kubectl apply -f ../samples/deploy/rbac/apisix_view_clusterrolebinding.yaml
```

## Configmap for ingress controller

Pay attention to the `namespace` and `APISIX address` in configmap.

```shell
kubectl apply -f ../samples/deploy/configmap/cloud.yaml
```

## Deploy ingress controller

[How to build image from master branch?](#Master-branch-builds)
If the default parameters in samples/deploy are not good for you, just tweak them and run:

```shell
kubectl apply -f ../samples/deploy/deployment/ingress-controller.yaml
kubectl apply -k /path/to/apisix-ingress-controller/samples/deploy
```

## Helm
Expand Down
2 changes: 2 additions & 0 deletions samples/deploy/configmap/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- ./apisix.yaml
17 changes: 17 additions & 0 deletions samples/deploy/crd/v1beta1/ApisixRoute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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
17 changes: 17 additions & 0 deletions samples/deploy/crd/v1beta1/ApisixService.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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
17 changes: 17 additions & 0 deletions samples/deploy/crd/v1beta1/ApisixUpstream.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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
4 changes: 4 additions & 0 deletions samples/deploy/crd/v1beta1/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- ./ApisixRoute.yaml
- ./ApisixUpstream.yaml
- ./ApisixService.yaml
2 changes: 2 additions & 0 deletions samples/deploy/deployment/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
resources:
- ./ingress-controller.yaml
10 changes: 10 additions & 0 deletions samples/deploy/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: ingress-apisix
commonLabels:
apisix.apache.org/app: ingress-apisix
bases:
- ./configmap
- ./deployment
- ./rbac
- ./crd/v1beta1
1 change: 0 additions & 1 deletion samples/deploy/rbac/apisix_view_clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ roleRef:
subjects:
- kind: ServiceAccount
name: apisix-view-serviceaccount

4 changes: 4 additions & 0 deletions samples/deploy/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resources:
- ./apisix_view_clusterrole.yaml
- ./service_account.yaml
- ./apisix_view_clusterrolebinding.yaml