23.06.15
DEVOTEE를 활성화 시키면
지금 작성한 커뮤니티 글에 대해 1개의 댓글을 달아줍니다.
버튼을 누르면 글 수정 시 ChatGPT가 작성한 댓글이 수정됩니다.
| 컨텐츠 유형 | 제목 | 저장일 | 삭제 |
|---|
본인인증 로그인에 실패하였습니다.
회원이 아니시거나 본인인증 등록이
완료되지 않은 사용자입니다.
Istio 의 설치 순서는 다음과 같다.
사전에 Prometheus 와 EasticSearch 는 설치되어 있다고 가정한다.
istio operator 를 설치하기 전에 istioctl 명령을 사용할 수 있게 파일을 다운로드 한다.
$ mkdir -p ~/ahnsk/istio && cd ~/ahnsk/istio
$ curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.9.1 sh -
$ cd ~/ahnsk/istio/istio-1.9.1
$ cp bin/istioctl /usr/local/bin/istioctl
istio operator 는 helm chart 로 설치하며, 따로 helm repo 를 등록하지 않고 istio source 를 다운받아 설치한다.
먼저, istio 소스를 다운 받는다.
$ cd ~/ahnsk/istio
$ git clone https://github.com/istio/istio.git istio-operator
$ cd istio-operator
$ git checkout -b tag_1.9.1 tags/1.9.1
istio operator 를 helm 으로 설치한다.
istio 는 control plane 을 canary upgrade 가 가능하도록 revision tag 로 구분할 수 있게 권장하고 있다. 그리고 istio-operator 네임스페이스에 operator 를 설치하고, istio-system 네임스페이스에 istio control plane 을 설치한다.
operator 를 생성할 때 istio-operator 네임스페이스는 자동으로 생성되나 istio-system 네임스페이스는 operator 를 설치하기 전에 수동으로 생성해 놓아야 한다.
$ cd ~/ahnsk/istio
$ vi istio-operator-values.yaml
---
revision: "1-9-1"
operatorNamespace: istio-operator
watchedNamespaces: istio-system
operator:
resources:
limits:
cpu: 4
memory: 4Gi
requests:
cpu: 2
memory: 2Gi
$ kubectl create ns istio-system
$ helm upgrade -i istio-operator ./istio-operator/manifests/charts/istio-operator -f istio-operator-values.yaml -n istio-system
istio control plane 은 istiod 라는 pod 로 설치된다. operator 가 있으므로 아래와 같이 custom resource 를 생성하면 자동으로 istio control plane 이 설치되는 구조이다.
custom resource 를 아래와 같이 생성한다.
$ vi istio-cr-1-9-1.yaml
---
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-controlplane
spec:
revision: "1-9-1"
profile: default
meshConfig:
accessLogFile: /dev/stdout
enableTracing: true
enablePrometheusMerge: true
defaultConfig:
discoveryAddress: istiod-1-9-1.istio-system.svc:15012
proxyMetadata: {}
tracing:
zipkin:
address: jaeger-operator-jaeger-collector.istio-system:9411
sampling: 100.0
values:
global:
logging:
level: "default:info"
istioNamespace: istio-system
components:
pilot:
k8s:
env:
- name: PILOT_TRACE_SAMPLING
value: "100"
resources:
requests:
cpu: 1000m
memory: 1024Mi
hpaSpec:
maxReplicas: 10
minReplicas: 2
nodeSelector:
taco-istio: enabled
egressGateways:
- name: istio-egressgateway
namespace: istio-system
enabled: true
k8s:
resources:
requests:
cpu: 1000m
memory: 1024Mi
hpaSpec:
maxReplicas: 10
minReplicas: 2
nodeSelector:
taco-istio: enabled
ingressGateways:
- name: istio-ingressgateway
namespace: istio-system
enabled: true
k8s:
resources:
requests:
cpu: 1000m
memory: 1024Mi
hpaSpec:
maxReplicas: 10
minReplicas: 2
nodeSelector:
taco-istio: enabled
service:
type: NodePort
ports:
- name: status-port
port: 15021
targetPort: 15021
- name: http2
port: 80
targetPort: 8080
nodePort: 31080
- name: https
port: 443
targetPort: 8443
nodePort: 30443
- name: tcp
port: 31400
targetPort: 31400
- name: tls
port: 15443
targetPort: 15443
아래와 같이 custom resource 를 생성한다.
사전에 node-selector 로 어느 서버에 istiod 와 gateway 를 설치할 수 있는지 지정할 수 있다.
$ kubectl label node k1-node03 taco-istio=enabled
$ kubectl label node k1-node04 taco-istio=enabled
$ kubectl label node k1-node05 taco-istio=enabled
$ kubectl apply -f istio-cr-1-9-1.yaml
설치 현황은 아래 명령으로 확인할 수 있다.
$ kubectl get iop -n istio-system
-----------------------------------------------
NAME REVISION STATUS AGE
istio-controlplane 1-9-1 HEALTHY 44h
gateway 는 서비스별로 추가할 수 있다. 이 또한 custom resource 만 생성하면 되며 custom resource 는 아래와 같다.
$ vi istio-gateway-cr.yaml
---
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
name: istio-gateway-sample
spec:
revision: "1-9-1"
profile: empty
values:
global:
logging:
level: "default:info"
istioNamespace: istio-system
components:
ingressGateways:
- name: istio-ingressgateway-istio-gateway-sample
namespace: istio-gateway-sample
label:
app: istio-ingressgateway-istio-gateway-sample
istio: ingressgateway-istio-gateway-sample
enabled: true
k8s:
resources:
requests:
cpu: 1000m
memory: 1024Mi
hpaSpec:
maxReplicas: 10
minReplicas: 2
nodeSelector:
taco-istio: enabled
service:
type: NodePort
ports:
- name: status-port
port: 15021
targetPort: 15021
- name: http2
port: 80
targetPort: 8080
nodePort: 31081
- name: https
port: 443
targetPort: 8443
nodePort: 31443
- name: tcp
port: 31400
targetPort: 31400
- name: tls
port: 15443
targetPort: 15443
Gateway 를 설치할 네임스페이스 생성과 그 네임스페이스에 istio-system 에 있는 istio-1-9-1 ConfigMap 을 복사하여 생성한다.
$ kubectl create ns istio-gateway-sample
$ kubectl get cm istio-1-9-1 -n istio-system -o yaml \
| grep -v '^\s*namespace:\s' \
| kubectl apply -f -n istio-gateway-sample -
custom resource 를 생성하여 Gateway 를 추가로 설치한다.
$ kubectl apply -f istio-gateway-cr.yaml
설치된 정보를 확인한다.
$ kubectl get iop -A
----------------------------------------------------------------
NAMESPACE NAME REVISION STATUS AGE
istio-system istio-controlplane 1-9-1 HEALTHY 45h
istio-system istio-gateway-sample 1-9-1 HEALTHY 42h
# istioctl proxy-status
-----------------------------------------------------------------
NAME CDS LDS EDS RDS ISTIOD VERSION
api-gateway-6f87d9477f-xg5dq.default SYNCED SYNCED SYNCED SYNCED istiod-1-9-1-58ff56d6f8-dftbh 1.10-alpha.ba8228cc703fa11542c3e97c1702688d072152a1
details-v1-6f769b44-hzj8v.default SYNCED SYNCED SYNCED SYNCED istiod-1-9-1-58ff56d6f8-25z28 1.10-alpha.ba8228cc703fa11542c3e97c1702688d072152a1
istio-egressgateway-66cb5c46c7-c9q4b.istio-system SYNCED SYNCED SYNCED NOT SENT istiod-1-9-1-58ff56d6f8-dftbh 1.10-alpha.f88f93ff2b8172b37c83d6066363d76b4477bd2d
istio-egressgateway-66cb5c46c7-qjrwj.istio-system SYNCED SYNCED SYNCED NOT SENT istiod-1-9-1-58ff56d6f8-25z28 1.10-alpha.f88f93ff2b8172b37c83d6066363d76b4477bd2d
istio-ingressgateway-684d9c7755-brtsv.istio-system SYNCED SYNCED SYNCED SYNCED istiod-1-9-1-58ff56d6f8-25z28 1.10-alpha.f88f93ff2b8172b37c83d6066363d76b4477bd2d
istio-ingressgateway-684d9c7755-dvtrd.istio-system SYNCED SYNCED SYNCED SYNCED istiod-1-9-1-58ff56d6f8-dftbh 1.10-alpha.f88f93ff2b8172b37c83d6066363d76b4477bd2d
istio-ingressgateway-istio-gateway-sample-6d6998fc44-rnfnr.istio-gateway-sample SYNCED SYNCED SYNCED SYNCED istiod-1-9-1-58ff56d6f8-dftbh 1.10-alpha.f88f93ff2b8172b37c83d6066363d76b4477bd2d
istio-ingressgateway-istio-gateway-sample-6d6998fc44-twcqp.istio-gateway-sample SYNCED SYNCED SYNCED SYNCED istiod-1-9-1-58ff56d
Istio 를 Operator 를 사용해서 revision 값을 주면 sidecar 를 자동으로 injection 하기 위해서 더이상 istio-injection=enabled 와 같은 Label을 쓰지 않는다. 위에 처럼 label 을 변경줘야 한다. istio-injection=enabled 으로 설명하는 문서들이 있으면 demo 와 같은 simple 한 설치이거나 이전 설치 방법이다.
$ kubectl label ns default istio.io/rev=1-9-1
jaeger 와 kiali 는 다음에 계속..
DEVOTEE를 활성화 시키면
지금 작성한 댓글에 AI가 댓글을 달아줍니다.