yzeng25 commented on a change in pull request #781:
URL: https://github.com/apache/apisix-website/pull/781#discussion_r759053377



##########
File path: website/blog/2021/11/30/use-ingress-in-kubesphere.md
##########
@@ -0,0 +1,439 @@
+---
+title: "Using Apache APISIX Ingress Gateway to access Custom Monitoring in 
KubeSphere"
+author: "Haili Zhang"
+authorURL: "https://github.com/webup";
+authorImageURL: "https://avatars.githubusercontent.com/u/2936504?v=4";
+keywords: 
+- KubeSphere
+- Apache APISIX
+- Kubenetes
+- Ingress Controller
+- Monitor
+description: This article will take Apache APISIX Ingress Controller as an 
example to show you in detail how to quickly use different types of gateways 
and status monitoring for Kubernetes clusters through KubeSphere.
+tags: [Technology]
+---
+
+> This article will take Apache APISIX Ingress Controller as an example to 
show you in detail how to quickly use different types of gateways and status 
monitoring for Kubernetes clusters through KubeSphere.
+
+<!--truncate-->
+
+In early November, KubeSphere released version 3.2.0, which added a full set 
of monitoring and management pages for project gateways, and introduced cluster 
gateways to provide global Ingress gateway capabilities at the cluster level.
+
+To help users better understand how to deploy and use third-party Ingress 
Controllers in the new version of KubeSphere, this article will use the [Apache 
APISIX Ingress 
Controller](https://apisix.apache.org/docs/ingress-controller/getting-started/) 
as an example to show you how to quickly use different types of gateways for 
Kubernetes clusters with KubeSphere and perform status monitoring.
+
+## Preparation
+
+### Installing KubeSphere
+
+There are two ways to install KubeSphere.
+
+1. Install directly on 
[Linux](https://kubesphere.com.cn/docs/quick-start/all-in-one-on-linux/)
+2. Install on [existing 
Kubernetes](https://kubesphere.com.cn/docs/quick-start/minimal-kubesphere-on-k8s/)
+
+The monitoring module is already included in the minimal installation of 
KubeSphere, so there is no need to enable it additionally, and you can confirm 
the installation status via the Monitoring tab on the System Components page.
+
+![Confirm installation 
status](https://static.apiseven.com/202108/1638255471644-e1327ffc-dbed-4890-a15c-819f28731fc9.png)
+
+### Deploying the httpbin demo application
+
+Since we need to demonstrate the access control capabilities of the gateway, 
we must first have an accessible application as a backend service for the 
gateway. Here we use the 
[kennethreitz/httpbin](https://hub.docker.com/r/kennethreitz/httpbin/) 
container application provided by [httpbin.org](httpbin.org) as our demo 
application.
+
+In KubeSphere, we can either create a new project or use an existing one. 
After entering the project page, select "Services" under "Application Loads" to 
directly create a stateless workload and generate a companion service.
+
+![Create a 
Service](https://static.apiseven.com/202108/1638255616585-b0f5a674-f06a-4b18-baf9-8d6006abeead.png)
+
+Use the default port `80` of the 
[kennethreitz/httpbin](https://hub.docker.com/r/kennethreitz/httpbin/) 
container as the service port, and make sure you can see the corresponding 
entry for `httpbin` under both the Workloads and Services pages after creation, 
as shown in the following image.
+
+![Service](https://static.apiseven.com/202108/1638255786442-924bf704-9b9d-413f-9fc0-be6650a6ff4a.png)
+
+![Workload](https://static.apiseven.com/202108/1638255792974-7f354950-e34a-427a-9ff7-aa3af0a56dd6.png)
+
+### Additional Project Gateway Details
+
+The **Project Gateway** is a feature that has been live since KubeSphere 3.0. 
The Gateway in the KubeSphere Project is an NGINX Ingress controller. The 
mechanism built into KubeSphere for HTTP load balancing is called **Application 
Routing**, which defines the rules for connecting from the outside to the 
clustered service. To allow access to services from the outside, users can 
create routing resources to define URI paths, back-end service names, and other 
information.
+
+Following the `httpbin` service project deployed above, open the Gateway 
Settings page in Project Settings and perform the "Enable Gateway" operation. 
For convenience, just select `NodePort` as the "Access Method".
+
+![Project 
setting](https://static.apiseven.com/202108/1638256005754-d1e8bf9a-0ecc-4c6e-8ceb-0c25b04fef20.png)
+
+After OK, go back to the Gateway page, wait for a moment and refresh the page, 
you can get the deployment completion status as shown below, where you can see 
that NodePort is given two node ports by default. Next, we use the "Manage" 
button in the upper right corner to "View Details".
+
+![Deployment 
complete](https://static.apiseven.com/202108/1638256011357-960f6852-31b3-4702-8911-17d07ec19d7b.png)
+
+At this point we are looking at the new monitoring page for the 
project/cluster gateway in version 3.2.0. Next we need to create an application 
route for the httpbin service.
+
+Go to the Application Routing page from Application Load and start "creating" 
the route. After naming the route `httpbin`, we specify a domain name for 
testing purposes and set the "path" to `/`, select "service" `httpbin` and 
"port" `80`.
+
+![Apply 
routin](https://static.apiseven.com/202108/1638241684770-ce94fe24-58a6-4b9b-9507-d802713b4c38.png)
+
+![Create 
route](https://static.apiseven.com/202108/1638241689985-149fc2f7-456b-423c-8cfc-00800dc24917.png)
+
+After skipping the advanced settings in the next step, the route creation is 
completed and you can get the `httpbin` application route entry as shown in the 
figure below.
+
+![Route 
creation](https://static.apiseven.com/202108/1638256382273-109728eb-4d19-4c2b-ab92-9a2909c3eff8.png)
+
+Next, we can access the httpbin application service through the NodePort 
address of the project gateway and the specified domain name (e.g., 
http://httpbin.ui:32516 here), refresh or manipulate the request generation 
function of the page at will, and then enter the details page of the gateway, 
you can see that the "Monitoring" panel has appeared some built-in monitoring 
indicators.
+
+![Generation 
function](https://static.apiseven.com/202108/1638256419345-48476f01-b293-401b-9e4f-8bf64a9fab90.png)
+
+#### Specifying the NodePort Node Port
+
+For public cloud environments that use NodePort to expose access to the 
outside world, the open ports are usually limited and controlled, so we need to 
modify the NodePort used by the gateway.
+
+Since the gateway is managed by KubeSphere, to modify the NodePort of the 
gateway service, you need to have access to the `kubesphere-controls-system` 
project. Once inside the project, you can find the gateway service named 
`kubesphere-router-<project-namespace>` on the "Services" page under 
"Application Load", and the NodePort is open for external access.
+
+![Application 
Load](https://static.apiseven.com/202108/1638256523468-408ee36f-aac7-4bb4-9cd3-2473a95a52f4.png)
+
+## Getting Started with Clustered Gateways
+
+>KubeSphere 3.2.0 supports global gateways at the cluster level, so all 
projects can share the same gateway, and previously created project gateways 
are not affected by the cluster gateway. Gateways for all projects can be 
managed and configured centrally, eliminating the need to switch to a different 
enterprise space to configure gateways.
+
+If you are using KubeSphere version 3.2.0, we recommend using the cluster 
gateway feature to unify the application routing across the cluster. To enable 
the cluster gateway, it's very simple: use an account with cluster management 
privileges to access one of the clusters you can manage (e.g. default cluster 
here), and under "Gateway Settings" in "Cluster Settings", you can "Enable 
Gateway" and view the "Project Gateway".
+
+![Project 
gateway](https://static.apiseven.com/202108/1638256574546-920473f3-e8ac-4cf9-932b-4202888e7a54.png)
+
+The way the cluster gateway is opened and the modification of the aligned 
NodePort access port are basically the same as the previous project gateway, so 
we won't go into details here.
+
+However, there is one point that needs special attention: after the cluster 
gateway is opened, the gateway of the project that has been opened will remain; 
however, the project that has not yet created a gateway cannot create a 
separate gateway, and will use the cluster gateway directly.
+
+The following figure shows the overview of all gateways in the "Gateway 
Settings" page for projects that have already created gateways, after having 
both project and cluster gateways.
+
+![Gateway 
setting](https://static.apiseven.com/202108/1638256658706-ac5107fe-2fd7-4521-b830-9ae1fdf762e1.png)
+
+## A Quick Look at Apache APISIX Ingress Controller
+
+Apache APISIX is an open source, high-performance, dynamic cloud-native 
gateway donated to the Apache Foundation by Shenzhen Tributary Technology Co. 
in 2019, and is now the top open source project of the Apache Foundation and 
the most active gateway project on GitHub.Apache APISIX currently covers API 
gateways, LB Kubernetes Ingress, Service Mesh, and many other scenarios.
+
+### How to deploy
+
+First add the Apache APISIX Helm Chart repository. After that, select an 
enterprise space and add the following [Apache APISIX 
repository](https://charts.apiseven.com) via "Application Repository" under 
"Application Management".
+
+![Application 
repository](https://static.apiseven.com/202108/1638256788584-dca2d21b-3ffc-4bb4-bd73-56dedb6d005a.png)
+
+Next, create a project named `apisix-system`. Once you are on the project 
page, select the Create an Application in Application Load method to deploy 
Apache APISIX, and select the `apisix` application template to start the 
deployment.
+
+![start the 
deployment](https://static.apiseven.com/202108/1638241691528-80090ab6-85de-401f-96d7-58118b3cbd88.png)
+
+>Why deploy the Apache APISIX application Helm Chart directly instead of 
deploying the Apache APISIX Ingress Controller directly?
+
+This is because the Apache APISIX Ingress Controller is currently strongly 
associated with the Apache APISIX Gateway (as shown in the figure below), and 
it is currently most convenient to deploy Apache APISIX Gateway + Dashboard + 
Ingress Controller through Apache APISIX Helm Charts at the same time. Ingress 
Controller is the most convenient, so this article recommends using Apache 
APISIX Helm Charts directly for the deployment of the whole set of components.
+
+![Why use APISIX 
gateway](https://static.apiseven.com/202108/1638241693072-9b3146f5-bcc6-4441-b002-f1a07603a8c4.png)
+
+Name the application apisix to avoid mismatches between workloads and service 
names of multiple components (Gateway, Dashboard, Ingress Controller); in the 
"Application Settings" section edited in the installation steps, please fill in 
the following configuration (please pay special attention to the notes marked 
with [Note], the rest (The rest can be edited and modified by yourself as 
needed).
+
+```shell
+global:

Review comment:
       or yaml?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to