網站首頁 編程語言 正文
1.使用sealos部署快速部署K8S集群
1.1.基本環境配置
1.設置主機名 hostnamectl set-hostname k8s-master hostnamectl set-hostname k8s-node1 hostnamectl set-hostname k8s-node2 2.關閉selinux及防火墻 setenforce 0 sed -ri '/^SELINUX=/c SELINUX=disabled' /etc/sysconfig/selinux sed -ri '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config systemctl stop firewalld systemctl disable firewalld
1.2.部署K8S集群
1.sealos官網獲取軟件包 [root@k8s-master1 ~]# ll 總用量 507472 -rw-r--r-- 1 root root 552591411 8月 5 2021 kube1.19.16.tar.gz -rw-r--r-- 1 root root 44322816 4月 29 13:47 sealos 2.將kube1.19.16.tar.gz文件上傳到所有k8s節點 3.安裝sealos [root@k8s-master1 ~/soft]# chmod +x sealos && mv sealos /usr/bin [root@k8s-master1 ~/soft]# sealos version Version: 3.3.9-rc.3 Last Commit: 4db4953 Build Date: 2021-04-10T11:25:04Z 4.部署K8S1.19.16版本 [root@k8s-master ~]# sealos init --passwd 'teacher' --master 192.168.20.10 --node 192.168.20.11 --node 192.168.20.12 --pkg-url /root/kube1.19.16.tar.gz --version v1.19.16
2.在K8S集群中部署Istio網格服務
2.1.下載Istio安裝包
[root@k8s-master ~]# curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.8.2 TARGET_ARCH=x86_64 sh -
下載完成后會自動解壓成目錄。
2.2.查看Istio可用的配置列表
1.準備istio命令 [root@k8s-master ~]# cp istio-1.8.2/bin/istioctl /usr/bin/ 2.查看可用的配置列表 [root@k8s-master ~]# istioctl profile list Istio configuration profiles: default #默認配置檔,功能豐富,建議生產使用 demo #快速入門使用,適中配置,不適合性能測試 empty minimal #功能最少的組件集配置 openshift preview remote #用于配置共享控制平面的多集群服務網格 3.指定安裝的配置檔 $ istioctl install --set profile=demo -y
常用配置檔對安裝組件的區別
組件名稱 | default | demo | minmal | remote |
---|---|---|---|---|
istio-citadel | √ | √ | ? | √ |
istio-ingressgateway | √ | √ | ? | ? |
istio-galley | √ | √ | ? | ? |
istio-egressgateway | ? | √ | ? | ? |
istio-nodeagent | ? | ? | ? | ? |
istio-pilot | √ | √ | √ | ? |
istio-policy | √ | √ | ? | ? |
istio-sidecar-injector | √ | √ | ? | √ |
istio-telemetry | √ | √ | ? | ? |
grafana | ? | √ | ? | ? |
istio-tracing | ? | √ | ? | ? |
kiali | ? | √ | ? | ? |
prometheus | √ | √ | ? | ? |
我們采用default配置檔部署istio網格,istioctl install
命令不指定任何配置檔默認就是呀default配置檔。
1.安裝istio [root@k8s-master ~]# istioctl install -y Detected that your cluster does not support third party JWT authentication. Falling back to less secure first party JWT. See https://istio.io/v1.8/docs/ops/best-practices/security/#configure-third-party-service-account-tokens for details. ? Istio core installed ? Istiod installed ? Ingress gateways installed ? Installation complete 2.查看istio在K8S集群創建的資源 [root@k8s-master ~]# kubectl get all -n istio-system NAME READY STATUS RESTARTS AGE pod/istio-ingressgateway-559f565fcd-jxn5b 1/1 Running 0 7m46s pod/istiod-545bb98448-vqf84 1/1 Running 0 12m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/istio-ingressgateway LoadBalancer 10.107.107.206 <pending> 15021:32381/TCP,80:31105/TCP,443:30793/TCP,15012:32259/TCP,15443:31377/TCP 7m45s service/istiod ClusterIP 10.109.130.252 <none> 15010/TCP,15012/TCP,443/TCP,15014/TCP 12m NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/istio-ingressgateway 1/1 1 1 7m46s deployment.apps/istiod 1/1 1 1 12m NAME DESIRED CURRENT READY AGE replicaset.apps/istio-ingressgateway-559f565fcd 1 1 1 7m46s replicaset.apps/istiod-545bb98448 1 1 1 12m NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE horizontalpodautoscaler.autoscaling/istio-ingressgateway Deployment/istio-ingressgateway <unknown>/80% 1 5 1 7m45s horizontalpodautoscaler.autoscaling/istiod Deployment/istiod <unknown>/80% 1 5 1 12m #程序部署了2個,分別是istiod以及istio-ingressgateway #istio-ingressgateway的service資源通過loadblancer暴露了一組端口,我們可以通過這些端口訪問到istio中的應用程序,loadblancer需要依靠公有云的負載均衡器,我們沒有因此處于pending狀態,但是該service資源也是可用的,loadblancer不存在公有云負載均衡器默認就會使用nodeport類型進行端口映射
2.3.展示Istio配置檔的配置信息
可以展示出Istio的配置內容。
[root@k8s-master ~]# istioctl profile dump default
2.4.查看Istio在k8s集群部署使用的YAML文件內容
#顯示istio在k8s集群中部署使用的yaml編排文件內容 [root@k8s-master istio-1.8.2]# istioctl manifest generate #將編排文件內容導入到文件中 [root@k8s-master istio-1.8.2]# istioctl manifest generate > istio-generate.yaml #后期不使用istio時,可以通過這個文件直接卸載istio $ kubectl delete -f istio-generate.yaml
原文鏈接:https://blog.csdn.net/weixin_44953658/article/details/124707680
相關推薦
- 2022-06-08 基于Apache?Hudi在Google云構建數據湖平臺的思路詳解_Linux
- 2022-07-14 Python實現單例模式的四種方式詳解_python
- 2022-06-04 Android自定義ScrollView實現阻尼回彈_Android
- 2022-04-23 Python繪制燈籠的示例代碼_python
- 2022-03-15 BeanCreationException或NoSuchBeanDefinitionExceptio
- 2022-03-21 C++存儲方案和動態分配_C 語言
- 2023-03-16 Python中的functools?partial詳解_python
- 2022-07-17 關于elasticsearch連接時斷時續以及Kibana出現server is not ready
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支