【k8s-1.34.2安装部署】十.gateway Api v1.4.0和istio安装

文章目录

== 文章导航===

【k8s-1.34.2安装部署】一.系统初始化及k8s集群规划
【k8s-1.34.2安装部署】二.kubernets软件、证书、配置、脚本等文件准备
【k8s-1.34.2安装部署】三.etcd-v3.6.6 TLS版集群安装
【k8s-1.34.2安装部署】四.kubernets master组件kube-apiserver,kube-controller-manager,kube-scheduler安装
【k8s-1.34.2安装部署】五.worker端containerd2.2.1、kubelet-1.34.2安装
【k8s-1.34.2安装部署】六.企业级部署cilium-1.18.4网络插件
【k8s-1.34.2安装部署】七.coredns-v1.13.1安装
【k8s-1.34.2安装部署】八.metric-server-0.8.0安装
【k8s-1.34.2安装部署】九.k8s管理平台xkube安装部署
【k8s-1.34.2安装部署】十.gateway Api v1.4.0安装
【k8s-1.34.2安装部署】十一.metallb-v0.15.2安装

一.istio安装

第一步:安装客户端

1.从https://github.com/istio/istio/releases下载二进制文件放到/usr/local/bin下

2.验证: istioctl version

3.帮助文档地址:https://istio.io/latest/zh/docs/ambient/install/istioctl/

第二步:执行命令:istioctl install --set profile=ambient --set components.cni.enabled=false --skip-confirmation

二.gateway api 安装

试验版:kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.1/experimental-install.yaml
正式版:kubectl apply --server-side -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.1/standard-install.yaml

注:试验版本才会包含tcproute和udproute

三.示例创建

3.1.创建gateway的示例:
复制代码
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: my-gateway
spec:
  gatewayClassName: istio 
  listeners:
  - name: http
    protocol: HTTP
    port: 80
3.2.创建httproute示例
复制代码
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: my-httproute2
spec:
  parentRefs:
  - name: my-gateway
  hostnames:
  - "t2.eeenet.net"
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /t2
    backendRefs:
    - name: my-deployment
      port: 80
  - matches:
    - headers:
      - type: Exact
        name: env
        value: test
    backendRefs:
    - name: one-deployment
      port: 80
3.3.创建grpcroute示例
复制代码
apiVersion: gateway.networking.k8s.io/v1
kind: GRPCRoute
metadata:
  name: my-grpcroute
spec:
  parentRefs:
  - name: my-gateway 
  hostnames:
  - "t3.pc.com.cn"
  rules:
  - matches:
    - method:
        service: com.example.User
        method: Login
    backendRefs:
    - name: my-deployment
      port: 80 
  - matches:
    - method:
        service: grpc.reflection.v1.ServerReflection
    backendRefs:
    - name: one-deployment
      port: 80
3.4.创建tcproute示例
复制代码
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: my-tcp-gateway
spec:
  gatewayClassName: istio 
  listeners:
  - name: memcached-t1
    protocol: TCP
    port: 11211
    allowedRoutes:
      kinds:
      - kind: TCPRoute
  - name: redis-t1
    protocol: TCP
    port: 6379
    allowedRoutes:
      kinds:
      - kind: TCPRoute
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
  name: memcached-t1-tcproute
spec:
  parentRefs:
  - name: my-tcp-gateway
    sectionName: memcached-t1
  rules:
  - backendRefs:
    - name: memcached-t1-service
      port: 11211
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: TCPRoute
metadata:
  name: redis-t1-tcproute
spec:
  parentRefs:
  - name: my-tcp-gateway
    sectionName: redis-t1
  rules:
  - backendRefs:
    - name: redis-t1-service
      port: 6379
3.5.创建udproute示例
复制代码
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: my-udp-gateway
  namespace: kube-system
spec:
  gatewayClassName: istio 
  listeners:
  - name: udp-t1
    protocol: UDP
    port: 53
    allowedRoutes:
      kinds:
      - kind: UDPRoute
---
apiVersion: gateway.networking.k8s.io/v1alpha2
kind: UDPRoute
metadata:
  name: dns-t1-udproute
  namespace: kube-system
spec:
  parentRefs:
  - name: my-udp-gateway
    sectionName: udp-t1
  rules:
  - backendRefs:
    - name: kube-dns 
      port: 53

三.注意事项

3.1.镜像下载失败问题

istio-cni-node: docker.io/istio/install-cni:1.28.0-distroless

ztunnel: docker.io/istio/ztunnel:1.28.0-distroless

istiod: docker.io/istio/pilot:1.28.0-distroless

对应可以下载的镜像地址:

docker.1panel.live/istio/install-cni:1.28.0-distroless

docker.1panel.live/istio/ztunnel:1.28.0-distroless

docker.1panel.live/istio/pilot:1.28.0-distroless

可以下载完上传到自己的镜像站

相关推荐
吴声子夜歌12 小时前
Kubernetes进阶实战——Pod资源调度(三)
云原生·容器·kubernetes
Techblog of HaoWANG14 小时前
具身智能机器人专题(4) Docker 实战
linux·运维·ubuntu·docker·容器·机器人·ollama
吴声子夜歌14 小时前
Kubernetes进阶实战——Kubernetes系统扩展(一)
kubernetes
吴声子夜歌14 小时前
Kubernetes进阶实战——网络模型与网络策略(四)
网络·kubernetes
墨痕诉清风15 小时前
docker无法pull镜像问题解决
运维·docker·容器
东鹏特饮18 小时前
Docker 容器技术详细指南
运维·docker·容器
吴声子夜歌21 小时前
Kubernetes进阶实战——网络模型与网络策略(二)
网络·容器·kubernetes
开发者导航21 小时前
Tabby 教程:Docker 部署自托管 AI 编码助手
人工智能·docker·容器
吴声子夜歌1 天前
Kubernetes进阶实战——Pod资源调度(二)
云原生·容器·kubernetes
weixin_435247061 天前
医疗系统容器化后,K8s 发布要重做的4个取舍
云原生·容器·kubernetes