[英]Create Istio Ingress-gateway POD without creating istiod
我對 istio 有點陌生,還在學習。 我有一個用例,其中 Istio 已經部署在 istio-system 命名空間中,但我需要使用 istioOperator 在 test-ns 命名空間中部署 istio ingress-gateway Pod。 我正在使用 istio 1.6.7。
從 Istio 文檔中,它提到運行這個 cmd: istioctl manifest apply --set profile=default --filename=istio-ingress-values.yaml
但這會在 istio-system 中創建 istiod Pods,因為它已經創建了我不想要。
因此,我在 cmds 下運行以創建 Ingress Gateway POD,但看不到在 test-ns 中創建的任何 Pod 或服務。 如果可能,請提供幫助
kubectl apply -f istio-ingress-values.yaml
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: test-ns
name: testoperator
ingressGateways:
- enabled: true
name: istio-ingressgateway
namespace: test-ns
k8s:
env:
- name: ISTIO_META_ROUTER_MODE
value: sni-dnat
hpaSpec:
maxReplicas: 5
metrics:
- resource:
name: cpu
targetAverageUtilization: 80
type: Resource
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: istio-ingressgateway
resources: {}
service:
ports:
- name: http2
port: 80
targetPort: 80
- name: https
port: 443
targetPort: 443
在 Istio 中,可以調整配置文件。 如我所見,您使用的是default
配置文件,因此我將描述如何調整此配置文件以在test-ns
命名空間中創建istio-ingressgateway
。
我們可以通過運行istioctl profile dump default
命令來顯示默認配置文件設置。
首先,我將這些默認設置保存在default_profile_dump.yml
文件中:
# istioctl profile dump default > default_profile_dump.yml
然后我修改了這個文件:
注意:我只添加了一行: namespace: test-ns
。
...
ingressGateways:
- enabled: true
name: istio-ingressgateway
namespace: test-ns
...
修改ingressGateways
的默認設置后,我應用了這些新設置:
# istioctl manifest apply -f default_profile_dump.yml
This will install the Istio 1.9.1 default profile with ["Istio core" "Istiod" "Ingress gateways"] components into the cluster. Proceed? (y/N) y
✔ Istio core installed
✔ Istiod installed
✔ Ingress gateways installed
- Pruning removed resources Removed HorizontalPodAutoscaler:istio-system:istio-ingressgateway.
Removed PodDisruptionBudget:istio-system:istio-ingressgateway.
Removed Deployment:istio-system:istio-ingressgateway.
Removed Service:istio-system:istio-ingressgateway.
Removed ServiceAccount:istio-system:istio-ingressgateway-service-account.
Removed RoleBinding:istio-system:istio-ingressgateway-sds.
Removed Role:istio-system:istio-ingressgateway-sds.
✔ Installation complete
最后,我們可以檢查istio-ingressgateway
的部署位置:
# kubectl get pod -A | grep ingressgateway
test-ns istio-ingressgateway-7fc7c7c-r92tw 1/1 Running 0 33s
istiod
部署在istio-system
命名空間中保持不變:
# kubectl get deploy,pods -n istio-system
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/istiod 1/1 1 1 51m
NAME READY STATUS RESTARTS AGE
pod/istiod-64675984c5-xl97n 1/1 Running 0 51m
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.