From 0afaa77b50d2bd5166deba4f0f00f3a9842f3b3d Mon Sep 17 00:00:00 2001 From: choisungwook <9348148+choisungwook@users.noreply.github.com> Date: Sat, 14 Dec 2024 10:10:39 +0900 Subject: [PATCH] Istio installication manaul (#118) --- kubernetes/istio/install/README.md | 8 +++ .../install/argocd_bootstrap/values/README.md | 0 kubernetes/istio/install/eks/README.md | 8 +++ .../istio/install/{ => eks}/addons/README.md | 4 +- .../istio/install/{ => eks}/addons/grafana.md | 8 +-- .../install/{ => eks}/addons/prometheus.md | 9 +-- .../argocd_bootstrap/argocd-apps.yaml | 2 +- .../eks/argocd_bootstrap/values/README.md | 6 ++ .../argocd_bootstrap/values/argocd-apps.yaml | 2 +- .../argocd_bootstrap/values/grafana.yaml | 0 .../argocd_bootstrap/values/prometheus.yaml | 0 .../istio/install/kind_cluster/Makefile | 7 ++ .../istio/install/kind_cluster/README.md | 68 +++++++++++++++++++ .../install/kind_cluster/kind-config.yaml | 25 +++++++ .../istio/install/manual_helm/README.md | 22 ++++++ mkdocs/docs/kubernetes/istio | 1 + 16 files changed, 158 insertions(+), 12 deletions(-) create mode 100644 kubernetes/istio/install/README.md delete mode 100644 kubernetes/istio/install/argocd_bootstrap/values/README.md create mode 100644 kubernetes/istio/install/eks/README.md rename kubernetes/istio/install/{ => eks}/addons/README.md (82%) rename kubernetes/istio/install/{ => eks}/addons/grafana.md (88%) rename kubernetes/istio/install/{ => eks}/addons/prometheus.md (93%) rename kubernetes/istio/install/{ => eks}/argocd_bootstrap/argocd-apps.yaml (88%) create mode 100644 kubernetes/istio/install/eks/argocd_bootstrap/values/README.md rename kubernetes/istio/install/{ => eks}/argocd_bootstrap/values/argocd-apps.yaml (93%) rename kubernetes/istio/install/{ => eks}/argocd_bootstrap/values/grafana.yaml (100%) rename kubernetes/istio/install/{ => eks}/argocd_bootstrap/values/prometheus.yaml (100%) create mode 100644 kubernetes/istio/install/kind_cluster/Makefile create mode 100644 kubernetes/istio/install/kind_cluster/README.md create mode 100644 kubernetes/istio/install/kind_cluster/kind-config.yaml create mode 100644 kubernetes/istio/install/manual_helm/README.md create mode 120000 mkdocs/docs/kubernetes/istio diff --git a/kubernetes/istio/install/README.md b/kubernetes/istio/install/README.md new file mode 100644 index 00000000..4ab0b43b --- /dev/null +++ b/kubernetes/istio/install/README.md @@ -0,0 +1,8 @@ +## 개요 +* istio 설치 문서 + + +## 목차 +* [EKS에서 ArgoCD와 helm chart를 사용하여 istio 설치](./eks) +* [kind 클러스터에 istio 설치](./kind_cluster/) +* [helm chart를 사용하여 istio 설치](./manual_helm/) diff --git a/kubernetes/istio/install/argocd_bootstrap/values/README.md b/kubernetes/istio/install/argocd_bootstrap/values/README.md deleted file mode 100644 index e69de29b..00000000 diff --git a/kubernetes/istio/install/eks/README.md b/kubernetes/istio/install/eks/README.md new file mode 100644 index 00000000..86e5b288 --- /dev/null +++ b/kubernetes/istio/install/eks/README.md @@ -0,0 +1,8 @@ +## 개요 +* EKS에서 ArgoCD와 helm chart를 사용하여 istio 설치 + +## 설치 방법 + +```sh +kubectl apply -f ./argocd_bootstrap/argocd-apps.yaml +``` diff --git a/kubernetes/istio/install/addons/README.md b/kubernetes/istio/install/eks/addons/README.md similarity index 82% rename from kubernetes/istio/install/addons/README.md rename to kubernetes/istio/install/eks/addons/README.md index 89a98149..232ff10e 100644 --- a/kubernetes/istio/install/addons/README.md +++ b/kubernetes/istio/install/eks/addons/README.md @@ -1,6 +1,6 @@ -# 개요 +## 개요 * istio 애드온 설치 메뉴얼 -# 목차 +## 목차 * [prometheus](./prometheus.md) * [grafana](./grafana.md) diff --git a/kubernetes/istio/install/addons/grafana.md b/kubernetes/istio/install/eks/addons/grafana.md similarity index 88% rename from kubernetes/istio/install/addons/grafana.md rename to kubernetes/istio/install/eks/addons/grafana.md index 1646ad52..1690b032 100644 --- a/kubernetes/istio/install/addons/grafana.md +++ b/kubernetes/istio/install/eks/addons/grafana.md @@ -1,11 +1,11 @@ -# 개요 +## 개요 * istio mesh메트릭을 시각화하기 위해 grafana 설치 -# 전제조건 +## 전제조건 * proemtheus가 설치되어 있어야 함 * [설치 문서 바로가기](./prometheus.md) -# 설치방법 +## 설치방법 * helm values에서 AWS ACM과 host를 꼭 여러분 껄로 변경하세요!!! ```sh @@ -17,7 +17,7 @@ helm upgrade --install \ grafana grafana/grafana ``` -# 그라파나 admin 비밀번호 +## 그라파나 admin 비밀번호 ```sh kubectl get secret --namespace istio-system grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo diff --git a/kubernetes/istio/install/addons/prometheus.md b/kubernetes/istio/install/eks/addons/prometheus.md similarity index 93% rename from kubernetes/istio/install/addons/prometheus.md rename to kubernetes/istio/install/eks/addons/prometheus.md index 517c53d1..a1e90567 100644 --- a/kubernetes/istio/install/addons/prometheus.md +++ b/kubernetes/istio/install/eks/addons/prometheus.md @@ -1,14 +1,15 @@ -# 개요 +## 개요 * istio mesh메트릭 수집을 담당하는 프로메테우스 설치 -# 선수지식 +## 선수지식 * helm chart로 istio를 설치하면 프로메테우스 exporter설정이 디폴트로 활성화 되어 있다. ```sh --set meshConfig.enablePrometheusMerge=true ``` -# 설치방법 +## 설치방법 + * helm values * 스토리지를 사용하지 않고 인메모리를 사용 * retenetion 설정: 1d와 200MB @@ -26,5 +27,5 @@ helm upgrade --install \ prometheus prometheus-community/prometheus ``` -# 참고자료 +## 참고자료 * https://istio.io/latest/docs/ops/integrations/prometheus/ diff --git a/kubernetes/istio/install/argocd_bootstrap/argocd-apps.yaml b/kubernetes/istio/install/eks/argocd_bootstrap/argocd-apps.yaml similarity index 88% rename from kubernetes/istio/install/argocd_bootstrap/argocd-apps.yaml rename to kubernetes/istio/install/eks/argocd_bootstrap/argocd-apps.yaml index de71388b..b4ada562 100644 --- a/kubernetes/istio/install/argocd_bootstrap/argocd-apps.yaml +++ b/kubernetes/istio/install/eks/argocd_bootstrap/argocd-apps.yaml @@ -16,7 +16,7 @@ spec: chart: argocd-apps helm: valueFiles: - - '$values/kubernetes/istio/install/argocd_bootstrap/values/argocd-apps.yaml' + - '$values/kubernetes/istio/install/eks/argocd_bootstrap/values/argocd-apps.yaml' - repoURL: 'https://github.com/choisungwook/portfolio.git' targetRevision: master ref: values diff --git a/kubernetes/istio/install/eks/argocd_bootstrap/values/README.md b/kubernetes/istio/install/eks/argocd_bootstrap/values/README.md new file mode 100644 index 00000000..a45a39a7 --- /dev/null +++ b/kubernetes/istio/install/eks/argocd_bootstrap/values/README.md @@ -0,0 +1,6 @@ +## 개요 +* istio 관리를 위한 애드온 helm values + +## 목차 +* [grafana](./grafana.yaml) +* [prometheus](./prometheus.yaml) diff --git a/kubernetes/istio/install/argocd_bootstrap/values/argocd-apps.yaml b/kubernetes/istio/install/eks/argocd_bootstrap/values/argocd-apps.yaml similarity index 93% rename from kubernetes/istio/install/argocd_bootstrap/values/argocd-apps.yaml rename to kubernetes/istio/install/eks/argocd_bootstrap/values/argocd-apps.yaml index bf0bd9bc..5fd5668d 100644 --- a/kubernetes/istio/install/argocd_bootstrap/values/argocd-apps.yaml +++ b/kubernetes/istio/install/eks/argocd_bootstrap/values/argocd-apps.yaml @@ -32,7 +32,7 @@ applicationsets: chart: '{{chart}}' helm: valueFiles: - - '$values/kubernetes/istio/install/argocd_bootstrap/values/{{valueFile}}' + - '$values/kubernetes/istio/install/eks/argocd_bootstrap/values/{{valueFile}}' - repoURL: 'https://github.com/choisungwook/portfolio.git' targetRevision: master ref: values diff --git a/kubernetes/istio/install/argocd_bootstrap/values/grafana.yaml b/kubernetes/istio/install/eks/argocd_bootstrap/values/grafana.yaml similarity index 100% rename from kubernetes/istio/install/argocd_bootstrap/values/grafana.yaml rename to kubernetes/istio/install/eks/argocd_bootstrap/values/grafana.yaml diff --git a/kubernetes/istio/install/argocd_bootstrap/values/prometheus.yaml b/kubernetes/istio/install/eks/argocd_bootstrap/values/prometheus.yaml similarity index 100% rename from kubernetes/istio/install/argocd_bootstrap/values/prometheus.yaml rename to kubernetes/istio/install/eks/argocd_bootstrap/values/prometheus.yaml diff --git a/kubernetes/istio/install/kind_cluster/Makefile b/kubernetes/istio/install/kind_cluster/Makefile new file mode 100644 index 00000000..a629a3d8 --- /dev/null +++ b/kubernetes/istio/install/kind_cluster/Makefile @@ -0,0 +1,7 @@ +install-istioctl: + @echo "Install istioctl" + @brew install istioctl + +up: + @echo "Install kind cluster" + @kind create cluster --config kind-config.yaml diff --git a/kubernetes/istio/install/kind_cluster/README.md b/kubernetes/istio/install/kind_cluster/README.md new file mode 100644 index 00000000..a0f3bb7d --- /dev/null +++ b/kubernetes/istio/install/kind_cluster/README.md @@ -0,0 +1,68 @@ +## 개요 +* kind 클러스터에 istio 설치 + +## 전제조건 +* docker가 설치되어 있어야 합니다. +* kind CLI가 설치되어 있어야 합니다. + +## kind 클러스터 생성 + +1. kind 클러스터 생성 + +```sh +kind create cluster --config kind-config.yaml +``` + +2. kind 클러스터 생성 확인 + +```sh +$ kubectl get nodes +NAME STATUS ROLES AGE VERSION +istio-control-plane Ready control-plane 3m51s v1.31.4 +istio-worker Ready 3m40s v1.31.4 +istio-worker2 Ready 3m41s v1.31.4 +``` + +## istio 설치 + +1. istioctl 설치 + +```sh +brew install istioctl +``` + +2. istioctl version 확인 + +```sh +$ istioctl version +Istio is not present in the cluster: no running Istio pods in namespace "istio-system" +client version: 1.24.1 +``` + +3. istio 설치: demo 프로파일 사용 + +```sh +istioctl install --set profile=demo --skip-confirmation +✔ Istio core installed ⛵️ +✔ Istiod installed 🧠 +✔ Egress gateways installed 🛫 +✔ Ingress gateways installed 🛬 +✔ Installation complete +``` + +![](./imgs/istio-profile.png) + + +4. istio 설치 확인 + +```sh +$ kubectl get pod -n istio-system +NAME READY STATUS RESTARTS AGE +istio-egressgateway-94bdb56cb-kxsq5 1/1 Running 0 99s +istio-ingressgateway-86cb558598-zbbv7 1/1 Running 0 99s +istiod-7dccd8956d-8xlzv 1/1 Running 0 113s +``` + +## 참고자료 +* https://istio.io/latest/docs/setup/platform-setup/kind/ +* https://medium.com/@s4l1h/how-to-install-kind-and-istio-ingress-controller-3b510834c762 diff --git a/kubernetes/istio/install/kind_cluster/kind-config.yaml b/kubernetes/istio/install/kind_cluster/kind-config.yaml new file mode 100644 index 00000000..4bade268 --- /dev/null +++ b/kubernetes/istio/install/kind_cluster/kind-config.yaml @@ -0,0 +1,25 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +name: istio +nodes: +- role: control-plane + image: kindest/node:v1.31.4 + kubeadmConfigPatches: + - | + kind: InitConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "ingress-ready=true" + extraPortMappings: + # istio ingress controller + - containerPort: 80 + hostPort: 80 + protocol: TCP + # istio ingress controller + - containerPort: 443 + hostPort: 443 + protocol: TCP +- role: worker + image: kindest/node:v1.31.4 +- role: worker + image: kindest/node:v1.31.4 diff --git a/kubernetes/istio/install/manual_helm/README.md b/kubernetes/istio/install/manual_helm/README.md new file mode 100644 index 00000000..b6d88fc9 --- /dev/null +++ b/kubernetes/istio/install/manual_helm/README.md @@ -0,0 +1,22 @@ +# 개요 +* helm으로 istio 설치 + +# 설치 방법 +1. **istio-base** helm chart 릴리즈 +2. **istiod helm** chart 릴리즈 +3. **istio-ingress** chart 릴리즈 +4. **(옵션) istio-egress** helm chart 릴리즈 + + +```sh +helm repo add istio https://istio-release.storage.googleapis.com/charts +helm repo update +``` + +* helm chart 릴리즈 + +```sh +helm install istio-base istio/base --version 1.24.0 -n istio-system --create-namespace --set defaultRevision=default +helm install istiod istio/istiod --version 1.24.0 -n istio-system --create-namespace --wait +helm install istio-ingress istio/gateway --version 1.24.0 -n istio-system --create-namespace --wait +``` diff --git a/mkdocs/docs/kubernetes/istio b/mkdocs/docs/kubernetes/istio new file mode 120000 index 00000000..6f60762f --- /dev/null +++ b/mkdocs/docs/kubernetes/istio @@ -0,0 +1 @@ +../../../kubernetes/istio \ No newline at end of file