From 50cddd9667e1b2ab221ff8ea9c52da062ceb1f86 Mon Sep 17 00:00:00 2001 From: Kevin Park Date: Sat, 6 Apr 2024 16:28:17 +0900 Subject: [PATCH] Move istio ingressgateway to yorkie namespace --- build/charts/yorkie-cluster/README.md | 2 ++ build/charts/yorkie-cluster/istio-operator.yaml | 7 ++++++- build/charts/yorkie-cluster/templates/istio/gateway.yaml | 3 +-- .../templates/istio/ingress-envoy-filter.yaml | 8 ++++---- build/charts/yorkie-cluster/templates/istio/ingress.yaml | 4 ++-- .../yorkie-cluster/templates/yorkie/namespace.yaml | 9 --------- 6 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 build/charts/yorkie-cluster/templates/yorkie/namespace.yaml diff --git a/build/charts/yorkie-cluster/README.md b/build/charts/yorkie-cluster/README.md index 39d9e17d5..1ec2b262c 100644 --- a/build/charts/yorkie-cluster/README.md +++ b/build/charts/yorkie-cluster/README.md @@ -13,6 +13,7 @@ Installs the yorkie-cluster, which provides cluster mode for Yorkie server to ha Before installing the chart, you need to install Istio with [Istio Operator](https://istio.io/latest/docs/setup/install/operator/) using [istioctl](https://istio.io/latest/docs/setup/getting-started/#download). ```bash +kubectl create namespace yorkie istioctl install -f <(curl -s https://raw.githubusercontent.com/yorkie-team/yorkie/main/build/charts/yorkie-cluster/istio-operator.yaml) ``` @@ -50,6 +51,7 @@ Also, you need to uninstall istio with [istioctl](https://istio.io/latest/docs/s ```bash istioctl uninstall --purge +kubectl delete namespace yorkie ``` This will remove all the istio components including CRDs. diff --git a/build/charts/yorkie-cluster/istio-operator.yaml b/build/charts/yorkie-cluster/istio-operator.yaml index 4c1063a4b..28993e684 100644 --- a/build/charts/yorkie-cluster/istio-operator.yaml +++ b/build/charts/yorkie-cluster/istio-operator.yaml @@ -1,7 +1,7 @@ apiVersion: install.istio.io/v1alpha1 kind: IstioOperator metadata: - name: istio-operator + name: yorkie-gateway-operator namespace: istio-system spec: profile: default @@ -11,7 +11,12 @@ spec: components: ingressGateways: - name: istio-ingressgateway + enabled: false + - name: yorkie-gateway + namespace: yorkie enabled: true + label: + istio: yorkie-gateway k8s: service: type: NodePort diff --git a/build/charts/yorkie-cluster/templates/istio/gateway.yaml b/build/charts/yorkie-cluster/templates/istio/gateway.yaml index 905f3dd20..3d7d8a645 100644 --- a/build/charts/yorkie-cluster/templates/istio/gateway.yaml +++ b/build/charts/yorkie-cluster/templates/istio/gateway.yaml @@ -4,9 +4,8 @@ metadata: name: {{ .Values.yorkie.name }}-gateway namespace: {{ .Values.yorkie.namespace }} spec: - # use istio default controller selector: - istio: ingressgateway + istio: yorkie-gateway servers: - port: number: 80 diff --git a/build/charts/yorkie-cluster/templates/istio/ingress-envoy-filter.yaml b/build/charts/yorkie-cluster/templates/istio/ingress-envoy-filter.yaml index 027a93132..c05e63c06 100644 --- a/build/charts/yorkie-cluster/templates/istio/ingress-envoy-filter.yaml +++ b/build/charts/yorkie-cluster/templates/istio/ingress-envoy-filter.yaml @@ -2,11 +2,11 @@ apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: ingress-stream-idle-timeout-filter - namespace: istio-system + namespace: {{ .Values.yorkie.namespace }} spec: workloadSelector: labels: - istio: ingressgateway + istio: yorkie-gateway configPatches: - applyTo: NETWORK_FILTER match: @@ -26,11 +26,11 @@ apiVersion: networking.istio.io/v1alpha3 kind: EnvoyFilter metadata: name: ingress-shard-key-header-filter - namespace: istio-system + namespace: {{ .Values.yorkie.namespace }} spec: workloadSelector: labels: - istio: ingressgateway + istio: yorkie-gateway configPatches: - applyTo: HTTP_FILTER match: diff --git a/build/charts/yorkie-cluster/templates/istio/ingress.yaml b/build/charts/yorkie-cluster/templates/istio/ingress.yaml index a4b481278..10e72aa4d 100644 --- a/build/charts/yorkie-cluster/templates/istio/ingress.yaml +++ b/build/charts/yorkie-cluster/templates/istio/ingress.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ .Values.yorkie.name }} - namespace: istio-system + namespace: {{ .Values.yorkie.namespace }} {{ if .Values.ingress.alb.enabled }} annotations: alb.ingress.kubernetes.io/scheme: internet-facing @@ -29,6 +29,6 @@ spec: pathType: Prefix backend: service: - name: istio-ingressgateway + name: yorkie-gateway port: number: 80 diff --git a/build/charts/yorkie-cluster/templates/yorkie/namespace.yaml b/build/charts/yorkie-cluster/templates/yorkie/namespace.yaml deleted file mode 100644 index 2b71a32bb..000000000 --- a/build/charts/yorkie-cluster/templates/yorkie/namespace.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Values.yorkie.namespace }} - labels: - ## Because we only need to load balance worklaods to Yorkie service, - ## we don't need sidecar proxy for service mesh. - ## We are only using Istio's ingressgateway envoy for load balancing. - istio-injection: disabled