This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
стратегии_деплоя_в_kubernetes [2026/04/05 11:31] val |
стратегии_деплоя_в_kubernetes [2026/04/05 12:01] (current) val [Пример Gateway] |
||
|---|---|---|---|
| Line 213: | Line 213: | ||
| <code> | <code> | ||
| kube1# kubectl delete -f my-webd-ingress-and-canary.yaml -n my-ns | kube1# kubectl delete -f my-webd-ingress-and-canary.yaml -n my-ns | ||
| + | </code> | ||
| + | ==== Установка gateway-api crd ==== | ||
| + | <code> | ||
| kube1# kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.2.0" | kubectl apply -f - | kube1# kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.2.0" | kubectl apply -f - | ||
| </code> | </code> | ||
| - | * [[Система Kubernetes#MetalLB]] с autoAssign: true | ||
| + | |||
| + | ==== Установка Istio ==== | ||
| + | |||
| + | * [[Система Kubernetes#MetalLB]] с autoAssign: true | ||
| <code> | <code> | ||
| kube1# curl -L https://istio.io/downloadIstio | sh - | kube1# curl -L https://istio.io/downloadIstio | sh - | ||
| Line 225: | Line 231: | ||
| kube1# istioctl install | kube1# istioctl install | ||
| + | </code> | ||
| + | * Если [[Система Kubernetes#MetalLB]] с autoAssign: false | ||
| + | |||
| + | <code> | ||
| + | kubectl -n istio-system edit service istio-ingressgateway | ||
| + | </code><code> | ||
| + | ... | ||
| + | kind: Service | ||
| + | metadata: | ||
| + | annotations: | ||
| + | metallb.universe.tf/ip-allocated-from-pool: first-pool | ||
| + | metallb.universe.tf/loadBalancerIPs: 192.168.X.Y | ||
| + | ... | ||
| + | </code> | ||
| + | ==== Пример Gateway ==== | ||
| + | <code> | ||
| kube1# cat my-gateway.yaml | kube1# cat my-gateway.yaml | ||
| </code><code> | </code><code> | ||
| Line 246: | Line 268: | ||
| kube1# kubectl -n my-ns get gtw my-gateway | kube1# kubectl -n my-ns get gtw my-gateway | ||
| my-gateway istio 192.168.13.66 True 113m | my-gateway istio 192.168.13.66 True 113m | ||
| + | </code> | ||
| - | kube1# cat my-webd-route.yaml | + | |
| + | * Если [[Система Kubernetes#MetalLB]] с autoAssign: false | ||
| + | |||
| + | <code> | ||
| + | kubectl patch svc my-gateway-istio -n my-ns -p '{"metadata":{"annotations":{"metallb.universe.tf/loadBalancerIPs":"192.168.X.N"}}}' | ||
| + | </code> | ||
| + | ==== Пример HTTPRoute ==== | ||
| + | <code> | ||
| + | kube1# cat my-httproute.yaml | ||
| </code><code> | </code><code> | ||
| apiVersion: gateway.networking.k8s.io/v1 | apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | kind: HTTPRoute | ||
| metadata: | metadata: | ||
| - | name: my-webd-route | + | name: my-httproute |
| spec: | spec: | ||
| parentRefs: | parentRefs: | ||
| Line 269: | Line 300: | ||
| weight: 10 | weight: 10 | ||
| </code><code> | </code><code> | ||
| - | kube1# kubectl -n my-ns apply -f my-webd-route.yaml | + | kube1# kubectl -n my-ns apply -f my-httproute.yaml |
| - | kube1# kubectl -n my-ns describe httproutes.gateway.networking.k8s.io my-webd-route | + | kube1# kubectl -n my-ns describe httproutes.gateway.networking.k8s.io my-httproute |
| kube1# IP=$(kubectl -n my-ns get gtw my-gateway -ojsonpath='{.status.addresses[0].value}') | kube1# IP=$(kubectl -n my-ns get gtw my-gateway -ojsonpath='{.status.addresses[0].value}') | ||