diff --git a/content/en/docs/v4.1/02-quickstart/02-access-kubesphere-via-https.adoc b/content/en/docs/v4.1/02-quickstart/02-access-kubesphere-via-https.adoc index 3b13343c3..e58c7988e 100644 --- a/content/en/docs/v4.1/02-quickstart/02-access-kubesphere-via-https.adoc +++ b/content/en/docs/v4.1/02-quickstart/02-access-kubesphere-via-https.adoc @@ -1,76 +1,76 @@ --- -title: "通过域名访问 KubeSphere 控制台" -keywords: "Kubernetes, {ks_product}, 域名访问, TLS" -description: "了解如何通过域名访问 KubeSphere 控制台。" +title: "Access KubeSphere Console via Domain Name" +keywords: "Kubernetes, {ks_product-en}, Domain Access, TLS" +description: "Learn how to access KubeSphere console via custom domain name." weight: 02 --- -本节介绍如何通过自定义域名访问{ks_product_left} Web 控制台。为实现此目的,您需要使用 cert-manager 配置 TLS 访问。 +This section explains how to access the {ks_product-en} web console using a custom domain name. To achieve this, you need to configure TLS access using cert-manager. -== 前提条件 +== Prerequisites -- 已安装 Kubernetes 集群。 -- link:https://helm.sh/zh/docs/intro/install/[已安装 Helm](用于安装 cert-manager 和 ingress-nginx)。 -- 已安装{ks_product_both}或准备安装{ks_product_left}。 +- Kubernetes is installed. +- link:https://helm.sh/docs/intro/install/[Helm] is installed (for installing cert-manager and ingress-nginx). +- {ks_product-en} is installed or ready to be installed. -== 步骤 1:安装 NGINX Ingress Controller +== Step 1: Install NGINX Ingress Controller -如果您尚未安装 link:https://kubernetes.github.io/ingress-nginx/[NGINX Ingress Controller],请按照以下步骤安装。 +If you haven't installed link:https://kubernetes.github.io/ingress-nginx/[NGINX Ingress Controller], follow these steps. [source,bash] ---- -# 添加 ingress-nginx 仓库 +# Add ingress-nginx repository helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx -# 更新仓库 +# Update repository helm repo update -# 安装 ingress-nginx +# Install ingress-nginx helm install ingress-nginx ingress-nginx/ingress-nginx \ --namespace ingress-nginx \ --create-namespace \ --version 4.2.5 -# 验证安装结果 +# Verify installation kubectl -n ingress-nginx get svc ingress-nginx-controller -# 检查 IngressClass +# Check IngressClass kubectl get ingressclass ---- -== 步骤 2:安装 cert-manager +== Step 2: Install cert-manager -link:https://cert-manager.io/docs/[cert-manager] 是一个 Kubernetes 原生的证书管理控制器,可以帮助您自动化 TLS 证书的管理和签发。 +link:https://cert-manager.io/docs/[cert-manager] is a Kubernetes native certificate management controller that helps automate the management and issuance of TLS certificates. [source,bash] ---- -# 添加 cert-manager 仓库 +# Add cert-manager repository helm repo add jetstack https://charts.jetstack.io -# 更新仓库 +# Update repository helm repo update -# 安装 cert-manager +# Install cert-manager helm install cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --version v1.12.0 \ --set installCRDs=true -# 验证安装结果 +# Verify installation kubectl get pods -n cert-manager ---- -== 步骤 3:为 KubeSphere 配置 TLS +== Step 3: Configure TLS for KubeSphere -=== 方法 1:安装 KubeSphere 时,配置 TLS +=== Method 1: Configure TLS during KubeSphere installation -如果您尚未安装 KubeSphere,可以在安装时配置 TLS。以下命令采用 cert-manager 生成自签证书。 +If you haven't installed KubeSphere yet, you can configure TLS during installation. The following command uses cert-manager to generate a self-signed certificate. [source,bash] ---- helm upgrade --install -n kubesphere-system --create-namespace ks-core https://charts.kubesphere.io/main/ks-core-1.1.3.tgz \ ---set portal.hostname=kubesphere.my.org \ # 将 kubesphere.my.org 替换为您的自定义域名 +--set portal.hostname=kubesphere.my.org \ # Replace kubesphere.my.org with your custom domain --set portal.https.port=30880 \ --set ingress.enabled=true \ --set ingress.tls.source=generation \ @@ -79,19 +79,19 @@ helm upgrade --install -n kubesphere-system --create-namespace ks-core https://c [.admon.note,cols="a"] |=== -|说明 +|Note | -以上参数的更多信息,请参阅 link:../../03-installation-and-upgrade/02-install-kubesphere/05-appendix/[KubeSphere Core 高级配置]。 +For more information about these parameters, please refer to link:../../03-installation-and-upgrade/02-install-kubesphere/05-appendix/[Advanced Configuration of KubeSphere Core]. |=== -=== 方法 2:安装 KubeSphere 后,手动配置自签名TLS +=== Method 2: Manually configure self-signed TLS after KubeSphere installation -如果已安装 KubeSphere,需手动配置 TLS。 +If KubeSphere is already installed, you need to manually configure TLS. [source,bash] ---- -# 创建 Issuer +# Create Issuer cat </login. ---- -- -== 步骤 5:访问{ks_product_left} Web 控制台 +== Step 5: Access {ks_product-en} Web Console -在使用自定义 DNS 的情况下,如果要在其他机器使用域名访问{ks_product_left} Web 控制台,还需要执行以下步骤。 +When using custom DNS, if you want to access the {ks_product-en} web console from other machines using the domain name, you need to perform the following additional steps. -. 设置 Service 使用 NodePort 模式。 +. Set Service to use NodePort mode. + [source,bash] ---- kubectl -n ingress-nginx patch svc ingress-nginx-controller -p '{"spec": {"type": "NodePort"}}' ---- -. 查询 Service 信息。 +. View Service information. + [source,bash] ---- kubectl -n ingress-nginx get svc ingress-nginx-controller ---- -. 获取 https 访问地址。 +. Get HTTPS access address. + -- [source,bash] @@ -364,13 +364,13 @@ echo https://kubesphere.my.org:$(kubectl -n ingress-nginx get svc ingress-nginx- [.admon.attention,cols="a"] |=== -|注意 +|Attention | -将 kubesphere.my.org 替换为您的自定义域名。 +Replace `kubesphere.my.org` with your custom domain. |=== -输出示例如下(您的访问地址可能不同): +Example output (your address may differ): [source,bash] ---- @@ -378,14 +378,14 @@ https://kubesphere.my.org:31655 ---- -- -. 获取节点 IP。 +. Get node IP. + [source,bash] ---- kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}' ---- -. 在访问{ks_product_both}控制台的机器上添加节点 IP 的 DNS,以配置域名解析规则。 +. On the machine accessing the {ks_product-en} web console, add DNS for node IP. + -- [source,bash] @@ -393,7 +393,7 @@ kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP vim /etc/hosts ---- -添加节点 IP 和域名。 +Add node IP and domain. [source,bash] ---- @@ -402,54 +402,54 @@ vim /etc/hosts [.admon.attention,cols="a"] |=== -|注意 +|Attention | -将 kubesphere.my.org 替换为您的自定义域名。 +Replace `kubesphere.my.org` with your custom domain. |=== -- -. 如果一切配置正确,您将能够通过第 3 步获取的 https 访问地址,如 https://kubesphere.my.org:31655 访问{ks_product_left} Web 控制台。 +. If everything is configured correctly, you should be able to access the {ks_product-en} web console using the HTTPS address obtained above, such as https://kubesphere.my.org:31655. -== 故障排除 +== Troubleshooting -=== 证书未成功签发 +=== Certificate Not Issued Successfully -检查证书状态: +Check certificate status: [source,bash] ---- kubectl describe certificate -n kubesphere-system ---- -检查 cert-manager 日志: +Check cert-manager logs: [source,bash] ---- kubectl logs -n cert-manager -l app=cert-manager ---- -=== Ingress 配置问题 +=== Ingress Configuration Issues -检查 Ingress 配置: +Check Ingress configuration: [source,bash] ---- kubectl describe ingress -n kubesphere-system ---- -检查 Ingress 控制器日志: +Check Ingress controller logs: [source,bash] ---- kubectl logs -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx ---- -== 卸载 +== Uninstallation -卸载 cert-manager +Uninstall cert-manager [source,bash] ---- @@ -458,9 +458,9 @@ helm uninstall cert-manager -n cert-manager kubectl delete crd certificaterequests.cert-manager.io certificates.cert-manager.io challenges.acme.cert-manager.io clusterissuers.cert-manager.io issuers.cert-manager.io orders.acme.cert-manager.io ---- -卸载 NGINX Ingress Controller +Uninstall NGINX Ingress Controller [source,bash] ---- helm uninstall ingress-nginx -n ingress-nginx ----- \ No newline at end of file +----