├── README.md ├── emojivoto ├── daemonset │ ├── kustomization.yml │ └── patch.yml ├── deployment │ ├── emoji.yml │ ├── ingressroute.yaml │ ├── kustomization.yml │ ├── namespace.yml │ ├── vote-bot.yml │ ├── voting.yml │ └── web.yml ├── job │ ├── kustomization.yml │ └── patch.yml ├── statefulset │ ├── kustomization.yml │ ├── patch.yml │ └── service-name.yml └── tracing │ ├── kustomization.yml │ └── patch.yml ├── ingress ├── crd.yaml ├── kustomization.yaml ├── namespace.yaml ├── patch.yaml ├── rbac.yaml └── traefik.yaml └── jaeger ├── jaeger.yaml ├── kustomization.yaml └── namespace.yaml /README.md: -------------------------------------------------------------------------------- 1 | # Emojivoto Kustomization 2 | Kustomization of [a microservice application](https://github.com/BuoyantIO/emojivoto) that allows users to vote for their favorite emoji, 3 | and tracks votes received on a leaderboard. 4 | 5 | The application is composed of the following 3 services: 6 | 7 | * web: Web frontend and REST API 8 | * emoji: gRPC API for finding and listing emoji 9 | * voting: gRPC API for voting and leaderboard 10 | 11 | ![](https://i.imgur.com/eyT3gQu.png) 12 | 13 | `vote-bot` deployment is responsible for generating some traffic. It votes on emoji randomly as follows: 14 | - It votes for :doughnut: 15% of the time. 15 | - When not voting for :doughnut:, it picks an emoji at random. 16 | ### Environment 17 | * A Kubernetes cluster 18 | * Jaeger backend installation 19 | * Linkerd (`stable-2.10.2`) and Linkerd Jaeger plugin installation 20 | * Ingress controller installation with tracing enabled and injected to Linkerd 21 | 22 | Create a local cluster with one node and using [K3d](https://github.com/rancher/k3d): 23 | ```bash 24 | k3d cluster create mycluster --agents 1 -p "80:80@loadbalancer" -p "8000:30080@agent[0]" --k3s-server-arg "--no-deploy=traefik" 25 | ``` 26 | We expose host port 80 and forward to port 80 of the service load balancer in our K3d cluster. Also, we expose host port 8000 and forward to node port 30080 of our K3d cluster. We will later use these ports to access web UI and Jaeger UI respectively. 27 | 28 | Install Linkerd: 29 | ```bash 30 | LINKERD2_VERSION=stable-2.10.2 curl -sL https://run.linkerd.io/install | sh 31 | linkerd install | kubectl apply -f - 32 | ``` 33 | Install Linkerd visualization plugin: 34 | ```bash 35 | linkerd viz install | kubectl apply -f - 36 | ``` 37 | Check Linkerd installation: 38 | ```bash 39 | linkerd check 40 | ``` 41 | Install Jaeger backend: 42 | ```bash 43 | kustomize build jaeger | kubectl apply -f - 44 | ``` 45 | Install Linkerd Jaeger plugin and configure Linkerd Opencensus collector to send spans to our Jaeger backend: 46 | ```bash 47 | linkerd jaeger install --set collector.jaegerAddr='http://jaeger-collector.tracing:14268/api/traces' | kubectl apply -f - 48 | ``` 49 | Install Traefik, an ingress controller, with tracing enabled and injected to Linkerd: 50 | ```bash 51 | kustomize build ingress | kubectl apply -f - 52 | ``` 53 | ### Build with tracing enabled 54 | The following command deploys all services with tracing enabled and injects Linkerd proxies: 55 | ```bash 56 | kustomize build emojivoto/tracing | kubectl apply -f - 57 | 58 | # or 59 | 60 | kubectl kustomize emojivoto/tracing | kubectl apply -f - 61 | 62 | # or 63 | 64 | kubectl apply -k emojivoto/tracing 65 | ``` 66 | ### Have Fun With UI 67 | - Visit emojivoto web at http://localhost. 68 | - Visit Jaeger UI at http://localhost:8000. 69 | - Visit Linkerd dashboard by executing `linkerd viz dashboard`. 70 | ### Clean Up 71 | Delete the cluster: 72 | ```bash 73 | k3d cluster delete mycluster 74 | ``` 75 | -------------------------------------------------------------------------------- /emojivoto/daemonset/kustomization.yml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../deployment 3 | patchesJson6902: 4 | - target: 5 | group: apps 6 | version: v1 7 | kind: Deployment 8 | name: web 9 | path: patch.yml 10 | - target: 11 | group: apps 12 | version: v1 13 | kind: Deployment 14 | name: emoji 15 | path: patch.yml 16 | - target: 17 | group: apps 18 | version: v1 19 | kind: Deployment 20 | name: voting 21 | path: patch.yml 22 | - target: 23 | group: apps 24 | version: v1 25 | kind: Deployment 26 | name: vote-bot 27 | path: patch.yml 28 | -------------------------------------------------------------------------------- /emojivoto/daemonset/patch.yml: -------------------------------------------------------------------------------- 1 | - op: replace 2 | path: /kind 3 | value: DaemonSet 4 | 5 | - op: remove 6 | path: /spec/replicas 7 | -------------------------------------------------------------------------------- /emojivoto/deployment/emoji.yml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: emoji 5 | namespace: emojivoto 6 | --- 7 | apiVersion: apps/v1 8 | kind: Deployment 9 | metadata: 10 | name: emoji 11 | namespace: emojivoto 12 | labels: 13 | app.kubernetes.io/name: emoji 14 | app.kubernetes.io/part-of: emojivoto 15 | app.kubernetes.io/version: v11 16 | annotations: 17 | prometheus.io/port: prom 18 | prometheus.io/scrape: "true" 19 | spec: 20 | replicas: 1 21 | selector: 22 | matchLabels: 23 | app: emoji-svc 24 | version: v11 25 | template: 26 | metadata: 27 | labels: 28 | app: emoji-svc 29 | version: v11 30 | spec: 31 | serviceAccountName: emoji 32 | containers: 33 | - env: 34 | - name: GRPC_PORT 35 | value: "8080" 36 | - name: PROM_PORT 37 | value: "8801" 38 | image: docker.l5d.io/buoyantio/emojivoto-emoji-svc:v11 39 | name: emoji-svc 40 | ports: 41 | - containerPort: 8080 42 | name: grpc 43 | - containerPort: 8801 44 | name: prom 45 | resources: 46 | requests: 47 | cpu: 100m 48 | --- 49 | apiVersion: v1 50 | kind: Service 51 | metadata: 52 | name: emoji-svc 53 | namespace: emojivoto 54 | spec: 55 | selector: 56 | app: emoji-svc 57 | ports: 58 | - name: grpc 59 | port: 8080 60 | targetPort: 8080 61 | - name: prom 62 | port: 8801 63 | targetPort: 8801 64 | -------------------------------------------------------------------------------- /emojivoto/deployment/ingressroute.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: traefik.containo.us/v1alpha1 2 | kind: IngressRoute 3 | metadata: 4 | name: emoji-ingressroute 5 | namespace: emojivoto 6 | spec: 7 | entryPoints: 8 | - web 9 | routes: 10 | - match: PathPrefix(`/`) 11 | kind: Rule 12 | services: 13 | - name: web-svc 14 | port: 80 -------------------------------------------------------------------------------- /emojivoto/deployment/kustomization.yml: -------------------------------------------------------------------------------- 1 | #namePrefix: dev- 2 | #nameSuffix: "-001" 3 | 4 | #commonLabels: 5 | # app: emojivoto 6 | 7 | resources: 8 | - namespace.yml 9 | - ingressroute.yaml 10 | - web.yml 11 | - emoji.yml 12 | - voting.yml 13 | - vote-bot.yml 14 | 15 | apiVersion: kustomize.config.k8s.io/v1beta1 16 | kind: Kustomization 17 | -------------------------------------------------------------------------------- /emojivoto/deployment/namespace.yml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Namespace 3 | metadata: 4 | name: emojivoto 5 | -------------------------------------------------------------------------------- /emojivoto/deployment/vote-bot.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: vote-bot 5 | namespace: emojivoto 6 | labels: 7 | app.kubernetes.io/name: vote-bot 8 | app.kubernetes.io/part-of: emojivoto 9 | app.kubernetes.io/version: v11 10 | spec: 11 | replicas: 1 12 | selector: 13 | matchLabels: 14 | app: vote-bot 15 | version: v11 16 | template: 17 | metadata: 18 | labels: 19 | app: vote-bot 20 | version: v11 21 | spec: 22 | containers: 23 | - command: 24 | - emojivoto-vote-bot 25 | env: 26 | - name: WEB_HOST 27 | value: web-svc.emojivoto:80 28 | image: docker.l5d.io/buoyantio/emojivoto-web:v11 29 | name: vote-bot 30 | resources: 31 | requests: 32 | cpu: 10m 33 | -------------------------------------------------------------------------------- /emojivoto/deployment/voting.yml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: voting 5 | namespace: emojivoto 6 | --- 7 | apiVersion: apps/v1 8 | kind: Deployment 9 | metadata: 10 | name: voting 11 | namespace: emojivoto 12 | labels: 13 | app.kubernetes.io/name: voting 14 | app.kubernetes.io/part-of: emojivoto 15 | app.kubernetes.io/version: v11 16 | annotations: 17 | prometheus.io/port: prom 18 | prometheus.io/scrape: "true" 19 | spec: 20 | replicas: 1 21 | selector: 22 | matchLabels: 23 | app: voting-svc 24 | version: v11 25 | template: 26 | metadata: 27 | labels: 28 | app: voting-svc 29 | version: v11 30 | spec: 31 | serviceAccountName: voting 32 | containers: 33 | - env: 34 | - name: GRPC_PORT 35 | value: "8080" 36 | - name: PROM_PORT 37 | value: "8801" 38 | image: docker.l5d.io/buoyantio/emojivoto-voting-svc:v11 39 | name: voting-svc 40 | ports: 41 | - containerPort: 8080 42 | name: grpc 43 | - containerPort: 8801 44 | name: prom 45 | resources: 46 | requests: 47 | cpu: 100m 48 | --- 49 | apiVersion: v1 50 | kind: Service 51 | metadata: 52 | name: voting-svc 53 | namespace: emojivoto 54 | spec: 55 | selector: 56 | app: voting-svc 57 | ports: 58 | - name: grpc 59 | port: 8080 60 | targetPort: 8080 61 | - name: prom 62 | port: 8801 63 | targetPort: 8801 64 | -------------------------------------------------------------------------------- /emojivoto/deployment/web.yml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: web 5 | namespace: emojivoto 6 | --- 7 | apiVersion: apps/v1 8 | kind: Deployment 9 | metadata: 10 | name: web 11 | namespace: emojivoto 12 | labels: 13 | app.kubernetes.io/name: web 14 | app.kubernetes.io/part-of: emojivoto 15 | app.kubernetes.io/version: v11 16 | spec: 17 | replicas: 1 18 | selector: 19 | matchLabels: 20 | app: web-svc 21 | version: v11 22 | template: 23 | metadata: 24 | labels: 25 | app: web-svc 26 | version: v11 27 | spec: 28 | serviceAccountName: web 29 | containers: 30 | - env: 31 | - name: WEB_PORT 32 | value: "8080" 33 | - name: EMOJISVC_HOST 34 | value: emoji-svc.emojivoto:8080 35 | - name: VOTINGSVC_HOST 36 | value: voting-svc.emojivoto:8080 37 | - name: INDEX_BUNDLE 38 | value: dist/index_bundle.js 39 | image: docker.l5d.io/buoyantio/emojivoto-web:v11 40 | name: web-svc 41 | ports: 42 | - containerPort: 8080 43 | name: http 44 | resources: 45 | requests: 46 | cpu: 100m 47 | --- 48 | apiVersion: v1 49 | kind: Service 50 | metadata: 51 | name: web-svc 52 | namespace: emojivoto 53 | spec: 54 | type: ClusterIP 55 | selector: 56 | app: web-svc 57 | ports: 58 | - name: http 59 | port: 80 60 | targetPort: 8080 61 | -------------------------------------------------------------------------------- /emojivoto/job/kustomization.yml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../deployment 3 | patchesJson6902: 4 | - target: 5 | group: apps 6 | version: v1 7 | kind: Deployment 8 | name: web 9 | path: patch.yml 10 | - target: 11 | group: apps 12 | version: v1 13 | kind: Deployment 14 | name: emoji 15 | path: patch.yml 16 | - target: 17 | group: apps 18 | version: v1 19 | kind: Deployment 20 | name: voting 21 | path: patch.yml 22 | - target: 23 | group: apps 24 | version: v1 25 | kind: Deployment 26 | name: vote-bot 27 | path: patch.yml 28 | -------------------------------------------------------------------------------- /emojivoto/job/patch.yml: -------------------------------------------------------------------------------- 1 | - op: replace 2 | path: /kind 3 | value: Job 4 | 5 | - op: replace 6 | path: /apiVersion 7 | value: batch/v1 8 | 9 | - op: remove 10 | path: /spec/replicas 11 | 12 | - op: remove 13 | path: /spec/selector 14 | 15 | - op: add 16 | path: /spec/template/spec/restartPolicy 17 | value: OnFailure 18 | -------------------------------------------------------------------------------- /emojivoto/statefulset/kustomization.yml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../deployment 3 | patchesStrategicMerge: 4 | - service-name.yml 5 | patchesJson6902: 6 | - target: 7 | group: apps 8 | version: v1 9 | kind: Deployment 10 | name: web 11 | path: patch.yml 12 | - target: 13 | group: apps 14 | version: v1 15 | kind: Deployment 16 | name: emoji 17 | path: patch.yml 18 | - target: 19 | group: apps 20 | version: v1 21 | kind: Deployment 22 | name: voting 23 | path: patch.yml 24 | - target: 25 | group: apps 26 | version: v1 27 | kind: Deployment 28 | name: vote-bot 29 | path: patch.yml -------------------------------------------------------------------------------- /emojivoto/statefulset/patch.yml: -------------------------------------------------------------------------------- 1 | - op: replace 2 | path: /kind 3 | value: StatefulSet 4 | -------------------------------------------------------------------------------- /emojivoto/statefulset/service-name.yml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: emoji 5 | namespace: emojivoto 6 | spec: 7 | serviceName: emoji-svc 8 | --- 9 | apiVersion: apps/v1 10 | kind: Deployment 11 | metadata: 12 | name: voting 13 | namespace: emojivoto 14 | spec: 15 | serviceName: voting-svc 16 | --- 17 | apiVersion: apps/v1 18 | kind: Deployment 19 | metadata: 20 | name: web 21 | namespace: emojivoto 22 | spec: 23 | serviceName: web-svc 24 | --- 25 | apiVersion: apps/v1 26 | kind: Deployment 27 | metadata: 28 | name: vote-bot 29 | namespace: emojivoto 30 | spec: 31 | serviceName: vote-bot 32 | -------------------------------------------------------------------------------- /emojivoto/tracing/kustomization.yml: -------------------------------------------------------------------------------- 1 | bases: 2 | - ../deployment 3 | patchesJson6902: 4 | - target: 5 | group: apps 6 | version: v1 7 | kind: Deployment 8 | name: web 9 | path: patch.yml 10 | - target: 11 | group: apps 12 | version: v1 13 | kind: Deployment 14 | name: emoji 15 | path: patch.yml 16 | - target: 17 | group: apps 18 | version: v1 19 | kind: Deployment 20 | name: voting 21 | path: patch.yml 22 | - target: 23 | group: apps 24 | version: v1 25 | kind: Deployment 26 | name: vote-bot 27 | path: patch.yml -------------------------------------------------------------------------------- /emojivoto/tracing/patch.yml: -------------------------------------------------------------------------------- 1 | - op: add 2 | path: /spec/template/spec/containers/0/env/- 3 | value: 4 | name: OC_AGENT_HOST 5 | value: collector.linkerd-jaeger:55678 6 | 7 | - op: add 8 | path: /spec/template/metadata/annotations 9 | value: 10 | linkerd.io/inject: enabled 11 | config.linkerd.io/trace-collector: collector.linkerd-jaeger:55678 12 | config.alpha.linkerd.io/trace-collector-service-account: collector 13 | -------------------------------------------------------------------------------- /ingress/crd.yaml: -------------------------------------------------------------------------------- 1 | # All resources definition must be declared 2 | apiVersion: apiextensions.k8s.io/v1beta1 3 | kind: CustomResourceDefinition 4 | metadata: 5 | name: ingressroutes.traefik.containo.us 6 | 7 | spec: 8 | group: traefik.containo.us 9 | version: v1alpha1 10 | names: 11 | kind: IngressRoute 12 | plural: ingressroutes 13 | singular: ingressroute 14 | scope: Namespaced 15 | 16 | --- 17 | apiVersion: apiextensions.k8s.io/v1beta1 18 | kind: CustomResourceDefinition 19 | metadata: 20 | name: middlewares.traefik.containo.us 21 | 22 | spec: 23 | group: traefik.containo.us 24 | version: v1alpha1 25 | names: 26 | kind: Middleware 27 | plural: middlewares 28 | singular: middleware 29 | scope: Namespaced 30 | 31 | --- 32 | apiVersion: apiextensions.k8s.io/v1beta1 33 | kind: CustomResourceDefinition 34 | metadata: 35 | name: ingressroutetcps.traefik.containo.us 36 | 37 | spec: 38 | group: traefik.containo.us 39 | version: v1alpha1 40 | names: 41 | kind: IngressRouteTCP 42 | plural: ingressroutetcps 43 | singular: ingressroutetcp 44 | scope: Namespaced 45 | 46 | --- 47 | apiVersion: apiextensions.k8s.io/v1beta1 48 | kind: CustomResourceDefinition 49 | metadata: 50 | name: ingressrouteudps.traefik.containo.us 51 | 52 | spec: 53 | group: traefik.containo.us 54 | version: v1alpha1 55 | names: 56 | kind: IngressRouteUDP 57 | plural: ingressrouteudps 58 | singular: ingressrouteudp 59 | scope: Namespaced 60 | 61 | --- 62 | apiVersion: apiextensions.k8s.io/v1beta1 63 | kind: CustomResourceDefinition 64 | metadata: 65 | name: tlsoptions.traefik.containo.us 66 | 67 | spec: 68 | group: traefik.containo.us 69 | version: v1alpha1 70 | names: 71 | kind: TLSOption 72 | plural: tlsoptions 73 | singular: tlsoption 74 | scope: Namespaced 75 | 76 | --- 77 | apiVersion: apiextensions.k8s.io/v1beta1 78 | kind: CustomResourceDefinition 79 | metadata: 80 | name: tlsstores.traefik.containo.us 81 | 82 | spec: 83 | group: traefik.containo.us 84 | version: v1alpha1 85 | names: 86 | kind: TLSStore 87 | plural: tlsstores 88 | singular: tlsstore 89 | scope: Namespaced 90 | 91 | --- 92 | apiVersion: apiextensions.k8s.io/v1beta1 93 | kind: CustomResourceDefinition 94 | metadata: 95 | name: traefikservices.traefik.containo.us 96 | 97 | spec: 98 | group: traefik.containo.us 99 | version: v1alpha1 100 | names: 101 | kind: TraefikService 102 | plural: traefikservices 103 | singular: traefikservice 104 | scope: Namespaced 105 | 106 | --- 107 | apiVersion: apiextensions.k8s.io/v1beta1 108 | kind: CustomResourceDefinition 109 | metadata: 110 | name: serverstransports.traefik.containo.us 111 | 112 | spec: 113 | group: traefik.containo.us 114 | version: v1alpha1 115 | names: 116 | kind: ServersTransport 117 | plural: serverstransports 118 | singular: serverstransport 119 | scope: Namespaced -------------------------------------------------------------------------------- /ingress/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namespace: default 2 | resources: 3 | - crd.yaml 4 | - namespace.yaml 5 | - rbac.yaml 6 | - traefik.yaml 7 | patches: 8 | - path: patch.yaml 9 | target: 10 | kind: Deployment 11 | name: traefik 12 | labelSelector: app=traefik -------------------------------------------------------------------------------- /ingress/namespace.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: default -------------------------------------------------------------------------------- /ingress/patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: traefik 5 | spec: 6 | replicas: 1 7 | template: 8 | metadata: 9 | annotations: 10 | config.alpha.linkerd.io/trace-collector-service-account: collector 11 | config.linkerd.io/trace-collector: collector.linkerd-jaeger:55678 12 | linkerd.io/inject: enabled 13 | spec: 14 | containers: 15 | - name: traefik 16 | resources: 17 | limits: 18 | cpu: 100m 19 | memory: 100Mi 20 | requests: 21 | cpu: 100m 22 | memory: 100Mi -------------------------------------------------------------------------------- /ingress/rbac.yaml: -------------------------------------------------------------------------------- 1 | kind: ClusterRole 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: traefik-ingress-controller 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - services 10 | - endpoints 11 | - secrets 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | - apiGroups: 17 | - extensions 18 | - networking.k8s.io 19 | resources: 20 | - ingresses 21 | - ingressclasses 22 | verbs: 23 | - get 24 | - list 25 | - watch 26 | - apiGroups: 27 | - extensions 28 | resources: 29 | - ingresses/status 30 | verbs: 31 | - update 32 | - apiGroups: 33 | - traefik.containo.us 34 | resources: 35 | - middlewares 36 | - ingressroutes 37 | - traefikservices 38 | - ingressroutetcps 39 | - ingressrouteudps 40 | - tlsoptions 41 | - tlsstores 42 | - serverstransports 43 | verbs: 44 | - get 45 | - list 46 | - watch 47 | 48 | --- 49 | kind: ClusterRoleBinding 50 | apiVersion: rbac.authorization.k8s.io/v1 51 | metadata: 52 | name: traefik-ingress-controller 53 | roleRef: 54 | apiGroup: rbac.authorization.k8s.io 55 | kind: ClusterRole 56 | name: traefik-ingress-controller 57 | subjects: 58 | - kind: ServiceAccount 59 | name: traefik-ingress-controller -------------------------------------------------------------------------------- /ingress/traefik.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ServiceAccount 3 | metadata: 4 | name: traefik-ingress-controller 5 | --- 6 | kind: Deployment 7 | apiVersion: apps/v1 8 | metadata: 9 | name: traefik 10 | annotations: 11 | prometheus.io/port: http-metrics 12 | prometheus.io/scrape: "true" 13 | labels: 14 | app: traefik 15 | spec: 16 | replicas: 1 17 | selector: 18 | matchLabels: 19 | app: traefik 20 | template: 21 | metadata: 22 | labels: 23 | app: traefik 24 | spec: 25 | serviceAccountName: traefik-ingress-controller 26 | containers: 27 | - name: traefik 28 | image: traefik:v2.4.3 29 | args: 30 | - --log.level=INFO 31 | - --api # enable api/dashboard 32 | - --api.dashboard # activate dashboard 33 | - --api.insecure 34 | - --entrypoints.web.address=:80 35 | - --providers.kubernetescrd 36 | - --metrics.prometheus.entryPoint=metrics 37 | - --entryPoints.metrics.address=:8082 38 | - --ping 39 | - --ping.entryPoint=web 40 | - --tracing=true 41 | - --tracing.zipkin=true 42 | - --tracing.zipkin.httpEndpoint=http://collector.linkerd-jaeger:9411/api/v2/spans 43 | - --tracing.zipkin.sameSpan=true 44 | - --tracing.zipkin.id128Bit=true 45 | - --tracing.zipkin.sampleRate=1 46 | - --accesslog=true # output log to stdout 47 | ports: 48 | - name: web 49 | containerPort: 80 50 | - name: admin 51 | containerPort: 8080 52 | - name: http-metrics 53 | containerPort: 8082 54 | readinessProbe: 55 | httpGet: 56 | path: /ping 57 | port: 80 58 | --- 59 | apiVersion: v1 60 | kind: Service 61 | metadata: 62 | name: traefik 63 | labels: 64 | app: traefik 65 | annotations: 66 | prometheus.io/scrape: "true" 67 | prometheus.io/port: "8082" 68 | spec: 69 | type: LoadBalancer 70 | selector: 71 | app: traefik 72 | ports: 73 | - protocol: TCP 74 | port: 80 75 | name: web 76 | targetPort: 80 77 | - protocol: TCP 78 | port: 8080 79 | name: admin 80 | targetPort: 8080 81 | - protocol: TCP 82 | port: 8082 83 | name: http-metrics 84 | targetPort: 8082 85 | -------------------------------------------------------------------------------- /jaeger/jaeger.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: Deployment 3 | apiVersion: apps/v1 4 | metadata: 5 | name: jaeger-collector 6 | labels: 7 | app: jaeger 8 | app.kubernetes.io/name: jaeger 9 | app.kubernetes.io/component: collector 10 | annotations: 11 | prometheus.io/port: metrics 12 | prometheus.io/scrape: "true" 13 | spec: 14 | replicas: 1 15 | selector: 16 | matchLabels: 17 | app: jaeger 18 | app.kubernetes.io/name: jaeger 19 | app.kubernetes.io/component: collector 20 | template: 21 | metadata: 22 | labels: 23 | app: jaeger 24 | app.kubernetes.io/name: jaeger 25 | app.kubernetes.io/component: collector 26 | spec: 27 | dnsPolicy: ClusterFirst 28 | containers: 29 | - name: jaeger 30 | image: jaegertracing/all-in-one:1.22.0 31 | ports: 32 | - name: collection 33 | containerPort: 14268 34 | - name: ui 35 | containerPort: 16686 36 | - name: metrics 37 | containerPort: 14269 38 | --- 39 | apiVersion: v1 40 | kind: Service 41 | metadata: 42 | name: jaeger-collector 43 | labels: 44 | app: jaeger 45 | app.kubernetes.io/name: jaeger 46 | app.kubernetes.io/component: collector 47 | annotations: 48 | prometheus.io/port: "14269" 49 | prometheus.io/scrape: "true" 50 | spec: 51 | selector: 52 | app: jaeger 53 | app.kubernetes.io/name: jaeger 54 | app.kubernetes.io/component: collector 55 | ports: 56 | - name: collection 57 | port: 14268 58 | - name: ui 59 | port: 16686 60 | - name: metrics 61 | port: 14269 62 | --- 63 | apiVersion: v1 64 | kind: Service 65 | metadata: 66 | name: jaeger-collector-nodeport 67 | labels: 68 | app: jaeger 69 | app.kubernetes.io/name: jaeger 70 | app.kubernetes.io/component: collector 71 | spec: 72 | type: NodePort 73 | selector: 74 | app: jaeger 75 | app.kubernetes.io/name: jaeger 76 | app.kubernetes.io/component: collector 77 | ports: 78 | - name: ui 79 | nodePort: 30080 80 | port: 16686 -------------------------------------------------------------------------------- /jaeger/kustomization.yaml: -------------------------------------------------------------------------------- 1 | namespace: tracing 2 | resources: 3 | - jaeger.yaml 4 | - namespace.yaml -------------------------------------------------------------------------------- /jaeger/namespace.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: tracing 6 | --------------------------------------------------------------------------------