https://github.com/jaegertracing/jaeger-operator

K8S 구성

설명: https://www.jaegertracing.io/docs/1.34/operator/

포트 관련: https://www.jaegertracing.io/docs/next-release/getting-started/#all-in-one

한글 설명: https://www.oss.kr/storage/app/public/oss/9f/ca/[Jaeger]%20Solution%20Guide.pdf

 

cert-manager 설치

$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.8.0/cert-manager.yaml
namespace/cert-manager created
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created
serviceaccount/cert-manager-cainjector created
serviceaccount/cert-manager created
serviceaccount/cert-manager-webhook created
configmap/cert-manager-webhook created
clusterrole.rbac.authorization.k8s.io/cert-manager-cainjector created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-issuers created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-certificates created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-orders created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-challenges created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created
clusterrole.rbac.authorization.k8s.io/cert-manager-view created
clusterrole.rbac.authorization.k8s.io/cert-manager-edit created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-approve:cert-manager-io created
clusterrole.rbac.authorization.k8s.io/cert-manager-controller-certificatesigningrequests created
clusterrole.rbac.authorization.k8s.io/cert-manager-webhook:subjectaccessreviews created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-cainjector created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-issuers created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-clusterissuers created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-certificates created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-orders created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-challenges created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-ingress-shim created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-approve:cert-manager-io created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-controller-certificatesigningrequests created
clusterrolebinding.rbac.authorization.k8s.io/cert-manager-webhook:subjectaccessreviews created
role.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created
role.rbac.authorization.k8s.io/cert-manager:leaderelection created
role.rbac.authorization.k8s.io/cert-manager-webhook:dynamic-serving created
rolebinding.rbac.authorization.k8s.io/cert-manager-cainjector:leaderelection created
rolebinding.rbac.authorization.k8s.io/cert-manager:leaderelection created
rolebinding.rbac.authorization.k8s.io/cert-manager-webhook:dynamic-serving created
service/cert-manager created
service/cert-manager-webhook created
deployment.apps/cert-manager-cainjector created
deployment.apps/cert-manager created
deployment.apps/cert-manager-webhook created
mutatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created
validatingwebhookconfiguration.admissionregistration.k8s.io/cert-manager-webhook created
 

pods 가 다 running 인지 확인한다. (그래야 나중에 operator 설치할 때 순조롭게 진행할 수 있다)

$ kubectl get all -n cert-manager
NAME                                           READY   STATUS    RESTARTS   AGE
pod/cert-manager-cainjector-6db6b64d5f-qq4rz   1/1     Running   0          76s
pod/cert-manager-64d9bc8b74-drmqn              1/1     Running   0          76s
pod/cert-manager-webhook-6c9dd55dc8-8gtt2      1/1     Running   0          76s
 

operator 설치

# namespace 생성
$ kubectl create namespace observability
namespace/observability created

# operator 설치
$ kubectl create -f https://github.com/jaegertracing/jaeger-operator/releases/download/v1.34.0/jaeger-operator.yaml -n observability
customresourcedefinition.apiextensions.k8s.io/jaegers.jaegertracing.io created
serviceaccount/jaeger-operator created
role.rbac.authorization.k8s.io/leader-election-role created
role.rbac.authorization.k8s.io/prometheus created
clusterrole.rbac.authorization.k8s.io/jaeger-operator-metrics-reader created
clusterrole.rbac.authorization.k8s.io/manager-role created
clusterrole.rbac.authorization.k8s.io/proxy-role created
rolebinding.rbac.authorization.k8s.io/leader-election-rolebinding created
rolebinding.rbac.authorization.k8s.io/prometheus created
clusterrolebinding.rbac.authorization.k8s.io/jaeger-operator-proxy-rolebinding created
clusterrolebinding.rbac.authorization.k8s.io/manager-rolebinding created
service/jaeger-operator-metrics created
service/jaeger-operator-webhook-service created
deployment.apps/jaeger-operator created
certificate.cert-manager.io/jaeger-operator-serving-cert created
issuer.cert-manager.io/jaeger-operator-selfsigned-issuer created
mutatingwebhookconfiguration.admissionregistration.k8s.io/jaeger-operator-mutating-webhook-configuration created
validatingwebhookconfiguration.admissionregistration.k8s.io/jaeger-operator-validating-webhook-configuration created

# 제대로 생성되었는지 확인 (pod 컨테이너 생성의 경우 조금 오래 걸릴 수 있음)
$ kubectl get all -n observability
NAME                                   READY   STATUS    RESTARTS   AGE
pod/jaeger-operator-86cc79547f-z4zmh   2/2     Running   0          56s

NAME                                      TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)    AGE
service/jaeger-operator-metrics           ClusterIP   10.43.207.49   <none>        8443/TCP   56s
service/jaeger-operator-webhook-service   ClusterIP   10.43.86.152   <none>        443/TCP    56s

NAME                              READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/jaeger-operator   1/1     1            1           56s

NAME                                         DESIRED   CURRENT   READY   AGE
replicaset.apps/jaeger-operator-86cc79547f   1         1         1       56s
 

jaeger 인스턴스 생성

아래처럼 production strategy 를 사용하여 인스턴스를 생성한다.
아래는 replica 를 5로 해서 생성한 것

자세한 내용은 https://www.jaegertracing.io/docs/1.34/operator/#deployment-strategies 참고

storage 는 알아서 선택

배포 전략 종류 (Strategies)

  • all-in-one - 개발, 테스트 및 데모 목적
  • production - trace 데이터의 장기간 저장이 중요하고 확장/가용성이 높은 아키텍처가 필요한 운영 환경을 대상으로 함. agent 는 sidecar(기본) 또는 deamonset 으로 동작 가능. db 는 elasticsearch 등으로 설정 가능함
  • streaming - production 과 db 사이에서 부하가 높을 때 db 부하를 줄이는 이점을 제공함
jaeger-operator-simple-prod.yaml
apiVersion: jaegertracing.io/v1
kind: Jaeger
metadata:
  name: simple-prod
spec:
  strategy: production
  collector:
    maxReplicas: 5
    resources:
      limits:
        cpu: 100m
        memory: 128Mi
  storage:
    type: memory
    options:
      memory:
        max-traces: 100000
  ingress:
    enabled: true
  agent:
    strategy: DaemonSet
 

yaml 파일을 적용한다.

$ kubectl apply -f jaeger-operator-simple-prod.yaml
jaeger.jaegertracing.io/simple-prod created

 

제대로 생성되었는지 확인한다.

$ kubectl get ingress
NAME                CLASS    HOSTS   ADDRESS   PORTS   AGE
simple-prod-query   <none>   *                 80      30s

$ kubectl get all
NAME                                    READY   STATUS    RESTARTS   AGE
pod/simple-prod-596f785786-5s4b9        1/1     Running   0          3m21s
pod/simple-prod-agent-daemonset-wh24v   1/1     Running   0          3m21s

NAME                                     TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                                  AGE
service/kubernetes                       ClusterIP   10.43.0.1       <none>        443/TCP                                  44m
service/simple-prod-collector-headless   ClusterIP   None            <none>        9411/TCP,14250/TCP,14267/TCP,14268/TCP   3m21s
service/simple-prod-collector            ClusterIP   10.43.202.158   <none>        9411/TCP,14250/TCP,14267/TCP,14268/TCP   3m21s
service/simple-prod-query                ClusterIP   10.43.58.4      <none>        16686/TCP,16685/TCP                      3m21s
service/simple-prod-agent                ClusterIP   None            <none>        5775/UDP,5778/TCP,6831/UDP,6832/UDP      3m21s

NAME                                         DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/simple-prod-agent-daemonset   1         1         1       1            1           <none>          3m21s

NAME                          READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/simple-prod   1/1     1            1           3m21s

NAME                                     DESIRED   CURRENT   READY   AGE
replicaset.apps/simple-prod-596f785786   1         1         1       3m21s
 

Jaeger UI 확인

서비스를 확인해서 들어간다. 80 으로 접속 못하면 16686 을 포트포워드 열어서 들어간다.

http://localhost:80