Kubernetes 1.28.2 环境,准备安装 Harbor 2.10.1 版本,持久化存储。
前提条件
-
Kubernetes 1.28.2 集群已经正常运行。
-
节点网络正常,能够拉取 Harbor 镜像。
-
已安装 Helm(如果用 Helm 安装 Harbor)。
安装local-path并设置为default
#安装 local-path-provisioner
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
#设置 StorageClass 为默认
kubectl patch storageclass local-path -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
注意:先配置openebs
1、配置openebs仓库
helm repo add openebs https://openebs.github.io/charts
helm repo update
2、安装openebs chart
helm install openebs --namespace openebs openebs/openebs --create-namespace
3、检查部署的资源:后续用存储(openebs-hostpath)
# 部署的chart
[root@k8s-master ~]# helm ls -n openebs
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
openebs openebs 1 2024-06-28 15:14:46.982427602 +0800 CST deployed openebs-3.10.0 3.10.0
# pods
[root@k8s-master ~]# kubectl get pod -n openebs -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
openebs-localpv-provisioner-685b678c88-lq57l 1/1 Running 0 9m49s 10.244.0.232 k8s-master <none> <none>
openebs-ndm-bxzwv 1/1 Running 0 9m49s 192.168.0.51 k8s-master <none> <none>
openebs-ndm-d54bt 1/1 Running 1 9m49s 192.168.0.53 k8s-node2 <none> <none>
openebs-ndm-hjnpx 1/1 Running 2 9m49s 192.168.0.52 k8s-node1 <none> <none>
openebs-ndm-operator-c959d9d77-dscd2 1/1 Running 0 9m49s 10.244.0.233 k8s-master <none> <none>
# 存储类
[root@k8s-master ~]# kubectl get sc -n openebs
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
openebs-device openebs.io/local Delete WaitForFirstConsumer false 16d
openebs-hostpath openebs.io/local Delete WaitForFirstConsumer false 16d
部署ingress-nginx(如果用istio-ingressgateway,就不用安装这个,多此一举)
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-nginx \
--create-namespace \
--version 4.10.0 \
--set controller.hostNetwork=true \
--set controller.service.type=NodePort \
--set controller.service.nodePorts.http=32088 \
--set controller.service.nodePorts.https=32448
本次环境部署的