Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
lingsamuel committed Sep 16, 2022
2 parents 700c5d4 + 654aaec commit 3057c84
Show file tree
Hide file tree
Showing 90 changed files with 2,527 additions and 926 deletions.
3 changes: 3 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ github:
master:
required_pull_request_reviews:
required_approving_review_count: 2
v1.5.0:
required_pull_request_reviews:
required_approving_review_count: 1
4 changes: 3 additions & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ on:
pull_request:
type: [review_requested, ready_for_review]
# The branches below must be a subset of the branches above
branches: [ master ]
branches:
- master
- v1.5.0
schedule:
- cron: '25 5 * * 5'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]

permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]

concurrency:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]

jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/k8s-timer-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
name: k8s-timer-ci

on:
repository_dispatch:
default_branch: master
schedule:
- cron: '0 1 * * 1'

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/license-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/lint-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]
jobs:
changes:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/spell-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
name: spell-checker
on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]
jobs:
misspell:
Expand All @@ -35,5 +38,5 @@ jobs:
wget -O - -q https://git.io/misspell | sh -s -- -b .
- name: Misspell
run: |
find . -name "*.go" -type f | xargs ./misspell -error
find . -name "*.go" -type f | xargs ./misspell -i mosquitto -error
find docs -type f | xargs ./misspell -error
1 change: 1 addition & 0 deletions .github/workflows/unit-test-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]
jobs:
changes:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/verify-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ on:
pull_request:
branches:
- master
- v1.5.0
type: [review_requested, ready_for_review]
jobs:
changes:
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Apache APISIX for Kubernetes

[![Go Report Card](https://goreportcard.com/badge/github.com/apache/apisix-ingress-controller)](https://goreportcard.com/report/github.com/apache/apisix-ingress-controller)
[![Slack](https://badgen.net/badge/Slack/Join%20Apache%20APISIX?icon=slack)](https://apisix.apache.org/slack)

Use [Apache APISIX](https://github.com/apache/apisix#apache-apisix) for Kubernetes [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/).

Expand Down Expand Up @@ -75,12 +76,12 @@ Currently, APISIX Ingress Controller automatically manipulates some APISIX resou

## Apache APISIX Ingress vs. Kubernetes Ingress Nginx

* The control plane and data plane are separated, which can improve security and deployment flexibility.
* Hot-reload during yaml apply.
* [More convenient canary deployment.](./docs/en/latest/concepts/apisix_route.md)
* Verify the correctness of the configuration, safe and reliable.
* [Rich plugins and ecology.](https://github.com/apache/apisix/tree/master/docs/en/latest/plugins)
* Supports APISIX custom resources and Kubernetes native Ingress resources.
* More active community

## Contributing

Expand Down Expand Up @@ -122,6 +123,10 @@ for us to fix.
- [aispeech: Why we create a new k8s ingress controller?(Chinese)](https://mp.weixin.qq.com/s/bmm2ibk2V7-XYneLo9XAPQ)
- [Tencent Cloud: Why choose Apache APISIX to implement the k8s ingress controller?(Chinese)](https://www.upyun.com/opentalk/448.html)

If you are willing to share with us some scenarios and use cases when you use APISIX Ingress,
please reply to the [issue](https://github.com/apache/apisix-ingress-controller/issues/501),
or submit PR to update [Powered-BY](./powered-by.md) file

## Milestone

* [Milestone](https://github.com/apache/apisix-ingress-controller/milestones)
Expand Down
11 changes: 9 additions & 2 deletions cmd/ingress/ingress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ func TestRotateLog(t *testing.T) {
cmd.SetArgs([]string{
"--log-rotate-output-path", "./testlog/test.log",
"--log-rotate-max-size", "1",
"--log-level", "debug",
"--log-output", "./testlog/test.log",
"--http-listen", listen,
"--enable-profiling",
"--kubeconfig", "/foo/bar/baz",
Expand All @@ -185,14 +187,20 @@ func TestRotateLog(t *testing.T) {
close(stopCh)
}()

fws := &fakeWriteSyncer{}
logger, err := log.NewLogger(log.WithLogLevel("debug"), log.WithWriteSyncer(fws))
assert.Nil(t, err)
defer logger.Close()
log.DefaultLogger = logger

// fill logs with data until the size > 1m
line := ""
for i := 0; i < 256; i++ {
line += "0"
}

for i := 0; i < 4096; i++ {
log.Info(line)
log.Debug(line)
}

time.Sleep(5 * time.Second)
Expand All @@ -206,5 +214,4 @@ func TestRotateLog(t *testing.T) {
}

assert.Equal(t, true, len(files) >= 2)

}
30 changes: 15 additions & 15 deletions docs/en/latest/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
"type": "doc",
"id": "getting-started"
},
{
"type": "category",
"label": "Installation",
"items": [
"deployments/minikube",
"deployments/kind",
"deployments/aws",
"deployments/ack",
"deployments/gke",
"deployments/azure",
"deployments/tke",
"deployments/kubesphere",
"deployments/k3s-rke"
]
},
{
"type": "category",
"label": "Tutorials",
Expand All @@ -23,21 +38,6 @@
"tutorials/how-to-use-go-plugin-runner-in-apisix-ingress"
]
},
{
"type": "category",
"label": "Installation",
"items": [
"deployments/ack",
"deployments/aws",
"deployments/azure",
"deployments/gke",
"deployments/kind",
"deployments/kubesphere",
"deployments/k3s-rke",
"deployments/minikube",
"deployments/tke"
]
},
{
"type": "category",
"label": "References",
Expand Down
80 changes: 59 additions & 21 deletions docs/en/latest/deployments/ack.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
---
title: Install Ingress APISIX on ACK
title: ACK (Alibaba Cloud)
keywords:
- APISIX ingress
- Apache APISIX
- Kubernetes ingress
- Alibaba Cloud
description: Guide to install APISIX ingress controller on Alibaba Cloud Container Service for Kubernetes (ACK).
---

<!--
#
# Licensed to the Apache Software Foundation (ASF) under one or more
Expand All @@ -21,17 +26,19 @@ title: Install Ingress APISIX on ACK
#
-->

This document explains how to install Ingress APISIX on Alibaba Cloud Container Service for Kubernetes (ACK).
This document explains how you can install APISIX ingress on [Alibaba Cloud Container Service for Kubernetes (ACK)](https://www.alibabacloud.com/product/kubernetes).

## Prerequisites

* Create an ACK Service on ali-cloud.
* Download the kube config for your ACK, follow the [introduction](https://www.alibabacloud.com/help/zh/doc-detail/86378.html).
Setting up APISIX ingress on ACK requires the following:

* [Create an ACK service](https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/create-an-ack-dedicated-cluster).
* [Add the cluster credentials](https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/connect-to-ack-clusters-by-using-kubectl) to your kube config file.
* Install [Helm](https://helm.sh/).

## Install APISIX and apisix-ingress-controller
## Install APISIX and ingress controller

As the data plane of apisix-ingress-controller, [Apache APISIX](http://apisix.apache.org/) can be deployed at the same time using Helm chart.
The script below installs APISIX and the ingress controller:

```shell
helm repo add apisix https://charts.apiseven.com
Expand All @@ -48,20 +55,35 @@ helm install apisix apisix/apisix \
kubectl get service --namespace ingress-apisix
```

Five Service resources were created.
:::note

By default, APISIX ingress controller will watch the apiVersion of `networking.k8s.io/v1`.

If the target Kubernetes version is under `v1.19`, add the flag `--set ingress-controller.config.kubernetes.ingressVersion=networking/v1beta1`.

Else, if your Kubernetes cluster version is under `v1.16`, set the flag `--set ingress-controller.config.kubernetes.ingressVersion=extensions/v1beta1`.

:::

* `apisix-gateway`, which processes the real traffic;
* `apisix-admin`, which acts as the control plane to process all the configuration changes.
* `apisix-ingress-controller`, which exposes apisix-ingress-controller's metrics.
* `apisix-etcd` and `apisix-etcd-headless` for etcd service and internal communication.
This will create the five resources mentioned below:

The gateway service type is set to `LoadBalancer` (See [Access services through SLB](https://www.alibabacloud.com/help/doc-detail/182218.htm) for more details), so that clients can access Apache APISIX through a load balancer. You can find the load balancer ip by running:
* `apisix-gateway`: dataplane the process the traffic.
* `apisix-admin`: control plane that processes all configuration changes.
* `apisix-ingress-controller`: ingress controller which exposes APISIX.
* `apisix-etcd` and `apisix-etcd-headless`: stores configuration and handles internal communication.

The gateway service type will be set to `LoadBalancer`. See [Use an existing SLB instance to expose an application
](https://www.alibabacloud.com/help/en/container-service-for-kubernetes/latest/use-an-existing-slb-instance-to-expose-an-application-2) for details on using a load balancer.

You can find the load balancer IP address by running:

```shell
kubectl get service apisix-gateway --namespace ingress-apisix -o jsonpath='{.status.loadBalancer.ingress[].ip}'
```

`ACK` PV require min_size is `20Gi`,cluster with `flexVolume` component select `alicloud-disk-ssd`,if with `helm values.yml` configure startup `apisix`,[more helm etcd configure](https://hub.kubeapps.com/charts/bitnami/etcd),configure format sample:
ACK PersistentVolume requires the minimum size of `20Gi` using FlexVolume (select `alicloud-disk-ssd`)

`ACK` PV require min_size is `20Gi`,cluster with `flexVolume` component select `alicloud-disk-ssd`. If you are using Helm, you can use this [etcd configuration file](https://hub.kubeapps.com/charts/bitnami/etcd):

```yaml
etcd:
Expand All @@ -70,16 +92,32 @@ etcd:
size: 20Gi
```
Try to create some [resources](https://github.com/apache/apisix-ingress-controller/tree/master/docs/en/latest/concepts) to verify the running status. As a minimalist example, see [proxy-the-httpbin-service](../tutorials/proxy-the-httpbin-service.md) to learn how to apply resources to drive the apisix-ingress-controller.
You should now be able to use APISIX ingress controller. You can try running this [minimal example](../tutorials/proxy-the-httpbin-service.md) to see if everything is working perfectly.
### Specify The Ingress Version
apisix-ingress-controller will watch apiVersion of `networking.k8s.io/v1` by default. If the target kubernetes version is under `v1.19`, add `--set ingress-controller.config.kubernetes.ingressVersion=networking/v1beta1` or `--set ingress-controller.config.kubernetes.ingressVersion=extensions/v1beta1` if your kubernetes cluster is under `v1.16`
## Next steps
### Enable SSL
The ssl config is disabled by default, add `--set gateway.tls.enabled=true` to enable tls support.
SSL is disabled by default. You can enable it by adding the flag `--set gateway.tls.enabled=true`.

### Change default keys

It is recommended to change the default keys for security:

```shell
--set ingress-controller.config.apisix.adminKey=ADMIN_KEY_GENERATED_BY_YOURSELF
```

```shell
--set admin.credentials.admin=ADMIN_KEY_GENERATED_BY_YOURSELF
```

```shell
--set admin.credentials.viewer=VIEWER_KEY_GENERATED_BY_YOURSELF
```

:::note

### Change default apikey
The `ingress-controller.config.apisix.adminKey` and `admin.credentials.admin` must be the same. It is better if these are not same as `admin.credentials.viewer`.

It's Recommended to change the default key by add `--set ingress-controller.config.apisix.adminKey=ADMIN_KEY_GENERATED_BY_YOURSELF`, `--set admin.credentials.admin=ADMIN_KEY_GENERATED_BY_YOURSELF`, `--set admin.credentials.viewer=VIEWER_KEY_GENERATED_BY_YOURSELF`, notice that `ingress-controller.config.apisix.adminKey` and `admin.credentials.admin` must be the same, and should better not same as `admin.credentials.viewer`.
:::
Loading

0 comments on commit 3057c84

Please sign in to comment.