步骤 1:准备 Linux 机器

若要以 All-in-One 模式进行安装,您仅需参考以下对机器硬件和操作系统的要求准备一台主机。

硬件推荐配置

kubesphere console ip 地址修改_DNS

容器运行时

您的集群必须有一个可用的容器运行时。如果您使用 KubeKey 搭建集群,KubeKey 会默认安装最新版本的 Docker。或者,您也可以在创建集群前手动安装 Docker 或其他容器运行时。

kubesphere console ip 地址修改_kubernetes_02

依赖项要求

KubeKey 可以将 Kubernetes 和 KubeSphere 一同安装。针对不同的 Kubernetes 版本,需要安装的依赖项可能有所不同。您可以参考以下列表,查看是否需要提前在节点上安装相关的依赖项。

kubesphere console ip 地址修改_运维_03

网络和 DNS 要求

请确保 /etc/resolv.conf 中的 DNS 地址可用,否则,可能会导致集群中的 DNS 出现问题。

如果您的网络配置使用防火墙规则或安全组,请务必确保基础设施组件可以通过特定端口相互通信。建议您关闭防火墙。有关更多信息,请参见端口要求。

支持的 CNI 插件:Calico 和 Flannel。其他插件也适用(例如 Cilium 和 Kube-OVN 等),但请注意它们未经充分测试。

步骤 2:下载 KubeKey

先执行以下命令以确保您从正确的区域下载 KubeKey。
下面展示一些 内联代码片

export KKZONE=cn

执行以下命令下载 KubeKey。

curl -sfL https://get-kk.kubesphere.io | VERSION=v2.2.2 sh -

备注

在您下载 KubeKey 后,如果您将其传至新的机器,且访问 Googleapis 同样受限,在您执行以下步骤之前请务必再次执行 export KKZONE=cn 命令。

备注

执行以上命令会下载最新版 KubeKey (v2.2.2),您可以修改命令中的版本号下载指定版本。

为 kk 添加可执行权限:

chmod +x kk

步骤 3:开始安装

在本快速入门教程中,您只需执行一个命令即可进行安装,其模板如下所示:

./kk create cluster[--with-kubernetes version][--with-kubesphere version]

若要同时安装 Kubernetes 和 KubeSphere,可参考以下示例命令:

./kk create cluster --with-kubernetes v1.22.10 --with-kubesphere v3.3.0

备注

安装 KubeSphere 3.3.0 的建议 Kubernetes 版本:1.19.x、1.20.x、1.21.x、v1.22.x 和 v1.23.x(实验性支持)。如果不指定 Kubernetes 版本,KubeKey 将默认安装 Kubernetes v1.23.7。有关受支持的 Kubernetes 版本的更多信息,请参见支持矩阵。

一般来说,对于 All-in-One 安装,您无需更改任何配置。

如果您在这一步的命令中不添加标志 --with-kubesphere,则不会部署 KubeSphere,KubeKey 将只安装 Kubernetes。如果您添加标志 --with-kubesphere 时不指定 KubeSphere 版本,则会安装最新版本的 KubeSphere。

KubeKey 会默认安装 OpenEBS 为开发和测试环境提供 LocalPV 以方便新用户。对于其他存储类型,请参见持久化存储配置。

执行该命令后,KubeKey 将检查您的安装环境,结果显示在一张表格中。有关详细信息,请参见节点要求和依赖项要求。输入 yes 继续安装流程。

步骤 4:验证安装结果

输入以下命令以检查安装结果。

kubectl logs -n kubesphere-system$(kubectl get pod -n kubesphere-system -l'app in (ks-install, ks-installer)'-o jsonpath='{.items[0].metadata.name}')-f

输出信息会显示 Web 控制台的 IP 地址和端口号,默认的 NodePort 是 30880。现在,您可以使用默认的帐户和密码 (admin/P@88w0rd) 通过 :30880 访问控制台。

########################################################              Welcome to KubeSphere!          ########################################################
Console: http://192.168.0.2:30880Account: admin   Password: P@88w0rdNOTES:  
1. After you log into the console, please check the    monitoring status of service components in"Cluster Management". 
 If any service is not    ready, please wait patientlyuntilall components   are up and running.  
 2. Please change the default password after login.#####################################################
 https://kubesphere.io            20xx-xx-xx xx:xx:xx#####################################################

备注

您可能需要配置端口转发规则并在安全组中开放端口,以便外部用户访问控制台。

登录至控制台后,您可以在系统组件中查看各个组件的状态。如果要使用相关服务,您可能需要等待部分组件启动并运行。您也可以使用 kubectl get pod --all-namespaces 来检查 KubeSphere 相关组件的运行状况。

步骤 3:部署dolphinscheduler

1.安装helm
ubuntu 有默认的安装源,centos 需要dnf ,如果有dnf 可以选择dnf 安装方式,这里选择用源码安装;

# 下载安装包
wget https://get.helm.sh/helm-v3.9.4-linux-amd64.tar.gz
# 解压
tar zxf helm-v3.9.4-linux-amd64.tar.gz
# 将helm 二进制文件复制到环境变量指定目录
mv linux-amd64/helm /usr/local/bin/helm
# 验证
helm help

2.3. 部署dolphinscheduler

//获取
wget https://dlcdn.apache.org/dolphinscheduler/3.0.0/apache-dolphinscheduler-3.0.0-src.tar.gz
tar -zxvf apache-dolphinscheduler-3.0.0-src.tar.gz
cd apache-dolphinscheduler-3.0.0-src/deploy/kubernetes/dolphinscheduler
helm repo add bitnami https://charts.bitnami.com/bitnami
helm dependency update .
//如果不指定命名空间 默认使用default
helm install dolphinscheduler . --set image.tag=3.0.0

安装完成后,有如下信息显示;

NAME: dolphinscheduler
LAST DEPLOYED: Mon Sep 12 16:27:29 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

** Please be patient while the chart DolphinScheduler 3.0.0 is being deployed **

Access DolphinScheduler UI URL by:

  kubectl port-forward -n default svc/dolphinscheduler-api 12345:12345

  DolphinScheduler UI URL: http://127.0.0.1:12345/dolphinscheduler