본문 바로가기
시스템/쿠버네티스

[쿠버네티스] MSA(5) Zipkin 설치

by cbwstar 2024. 1. 25.
728x90
반응형

1. deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: zipkin-deployment
  labels:
    env: production
    tier: backend
    app: zipkin
    name: zipkin-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      env: production
      tier: backend
      app: zipkin
      name: zipkin-pod
  template:
    metadata:
      labels:
        env: production
        tier: backend
        app: zipkin
        name: zipkin-pod
    spec:
      containers:
        - name: zipkin
          image: openzipkin/zipkin
          ports:
            - containerPort: 9411
              name: http-9411
          env:
            - name: TZ
              valueFrom:
                configMapKeyRef:
                  name: common-configmap
                  key: TZ
          startupProbe:
            httpGet:
              path: /zipkin/
              port: 9411
            initialDelaySeconds: 10
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 36
          readinessProbe:
            httpGet:
              path: /zipkin/
              port: 9411
            initialDelaySeconds: 10
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3

2. service.yaml

apiVersion: v1
kind: Service
metadata:
  name: zipkin
  labels:
    env: production
    tier: backend
    app: zipkin
    name: zipkin-service
spec:
  type: NodePort
  selector:
    env: production
    tier: backend
    app: zipkin
    name: zipkin-pod
  ports:
    - name: http-9411
      protocol: TCP
      port: 9411
      targetPort: 9411
      nodePort: 30008

3. ingress.yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: zipkin-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
  labels:
    env: production
    tier: backend
    app: zipkin
    name: zipkin-ingress
spec:
  tls:
  - hosts:
    - zipkin.co.kr
    secretName: tlssecret-zipkin
  ingressClassName: nginx
  rules:
  - host: zipkin.co.kr
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: zipkin
            port:
              number: 9411

4. 적용

kubectl create -f deployment.yaml

kubectl create -f service.yaml

kubectl create -f ingress.yaml

5. 브라우저 확인

https://zipkin.co.kr:30200/zipkin/ 

728x90
반응형

댓글



"이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받습니다."

loading