higress 部署与上云

k3s环境准备

[root@vm ~]# curl https://releases.rancher.com/install-docker/19.03.sh | sh
[root@vm ~]# curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

[root@vm ~]# curl -sfL https://rancher-mirror.oss-cn-beijing.aliyuncs.com/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn sh -


[root@vm ~]# mkdir -p $HOME/.kube
[root@vm ~]# cp /etc/rancher/k3s/k3s.yaml  $HOME/.kube/config
[root@vm ~]# kubectl get pod

helm准备

[root@vm ~]# wget https://get.helm.sh/helm-v3.14.0-linux-amd64.tar.gz
[root@vm ~]# tar xf helm-v3.14.0-linux-amd64.tar.gz
[root@vm ~]# mv linux-amd64/helm /usr/local/bin/
[root@vm ~]# helm repo add higress.io https://higress.io/helm-charts
[root@vm ~]# helm repo update
[root@vm ~]# helm search repo higress
NAME                            CHART VERSION   APP VERSION     DESCRIPTION
higress.io/higress              1.3.5           1.3.5           Helm chart for deploying Higress gateways
higress.io/higress-console      1.3.3           1.3.3           Management console for Higress
higress.io/higress-core         1.3.5           1.3.5           Helm chart for deploying higress gateways
higress.io/higress-local        0.6.1           0.6.1           Helm chart for deploying higress gateways
higress.io/istio                1.12.4          1.12.4          Helm chart for deploying higress istio
higress.io/istio-local          1.12.4          1.12.4          Helm chart for deploying higress istio
[root@vm ~]# helm fetch higress.io/higress
[root@vm ~]# tar xf higress-1.3.5.tgz
[root@vm ~]# ls higress
Chart.lock  Chart.yaml  LICENSE  README.md  charts

直接安装

[root@vm ~]# helm install higress -n higress-system  --create-namespace --render-subchart-notes  higress

部署到华为云

镜像拉取
[root@vm ~]# helm install higress -n higress-system  --create-namespace --render-subchart-notes --debug --dry-run higress>higress.yaml

[root@vm ~]# for i in `grep cn-hangzhou.cr.aliyuncs higress.yaml |grep image|cut -d '"' -f2`;do echo $i;done
[root@vm ~]# for i in `grep cn-hangzhou.cr.aliyuncs higress.yaml |grep image|cut -d '"' -f2`;do docker pull  $i;done

镜像上传到SWR
[root@vm ~]# for i in `docker images|grep higress|awk '{print($1":"$2)}'`;do 
docker tag $i swr.cn-south-1.myhuaweicloud.com/my-swr/${i##*/};
docker push swr.cn-south-1.myhuaweicloud.com/my-swr/${i##*/};done

镜像仓库地址修改

#查看
[root@vm ~]# helm install higress -n higress-system  --create-namespace --render-subchart-notes --debug --dry-run higress>higress.yaml
[root@ecs-5e7d-0001 ~]# grep -nr higress-registry higress
higress/charts/higress-core/values.yaml:53:  hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
higress/charts/higress-core/values.yaml:346:hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
higress/charts/higress-core/values.yaml:399:  hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
higress/charts/higress-core/values.yaml:490:  hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
higress/charts/higress-core/values.yaml:580:  hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
higress/charts/higress-console/values.yaml:9:  repository: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/console

#修改
[root@vm ~]# sed -i s#higress-registry.cn-hangzhou.cr.aliyuncs.com/higress#swr.cn-south-1.myhuaweicloud.com/my-swr#g higress/charts/higress-core/values.yaml
[root@vm ~]# sed -i s#higress-registry.cn-hangzhou.cr.aliyuncs.com/higress#swr.cn-south-1.myhuaweicloud.com/my-swr#g higress/charts/higress-console/values.yaml 

#安装
[root@vm ~]# helm install higress -n higress-system  --create-namespace --render-subchart-notes  higress
# deployment 添加镜像秘钥
higress-controller
higress-gateway
higress-console
...
	  restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: higress-console
      serviceAccount: higress-console
      securityContext: {}
      # 添加镜像秘钥
      imagePullSecrets:
        - name: default-secret
#service 对外发布
higress-console: 8080 -> 8080 / TCP	30080 / TCP	# 控制台
higress-gateway  LoadBalancer -- NodePort	# 流量入口
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐