diff --git a/deploy/charts/dragonfly/README.md b/deploy/charts/dragonfly/README.md index 63551f0bc..9bd1665b2 100644 --- a/deploy/charts/dragonfly/README.md +++ b/deploy/charts/dragonfly/README.md @@ -21,7 +21,8 @@ The following table lists the configurable parameters of the dragonfly chart, an | Parameter | Description | Default | | ----------------------------------------- | ------------------------------------------------------------ | ----------------------------- | -| `installation.namespace` | namespace for dragonfly installation | `dragonfly-system` | +| `installation.namespace` | namespace for dragonfly installation | `dragonfly-system` | +| `installation.jaeger` | whether enable an all in one jaeger for tracing | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/deploy/charts/dragonfly/templates/NOTES.txt b/deploy/charts/dragonfly/templates/NOTES.txt index a4f707a15..e3d5412ba 100644 --- a/deploy/charts/dragonfly/templates/NOTES.txt +++ b/deploy/charts/dragonfly/templates/NOTES.txt @@ -21,3 +21,10 @@ 3. Configure runtime to use dragonfly: https://github.com/dragonflyoss/Dragonfly2/blob/main/docs/en/user-guide/quick-start.md +{{ if .Values.installation.jaeger }} +4. Get Jaeger query URL by running these commands: + export JAEGER_QUERY_PORT=$(kubectl --namespace {{ .Values.installation.namespace }} get services jaeger-all-in-one-query -o jsonpath="{.spec.ports[0].port}") + export JAEGER_QUERY_POD=$(kubectl --namespace {{ .Values.installation.namespace }} get pod -l app.kubernetes.io/name=jaeger-all-in-one -o jsonpath='{range .items[*]}{.metadata.name}{end}' | head -n 1) + kubectl --namespace {{ .Values.installation.namespace }} port-forward $JAEGER_QUERY_POD 16686:$JAEGER_QUERY_PORT + echo "Visit http://127.0.0.1:16686/search?limit=20&lookback=1h&maxDuration&minDuration&service=dragonfly to query download events" +{{- end }} \ No newline at end of file diff --git a/deploy/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml b/deploy/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml index eeaa3e782..52e08b2b9 100644 --- a/deploy/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml +++ b/deploy/charts/dragonfly/templates/dfdaemon/dfdaemon-configmap.yaml @@ -14,6 +14,11 @@ data: gcInterval: {{ .Values.dfdaemon.config.gcInterval }} keepStorage: {{ .Values.dfdaemon.config.keepStorage }} verbose: {{ .Values.dfdaemon.config.verbose }} + {{- if .Values.dfdaemon.config.jaeger }} + jaeger: {{ .Values.dfdaemon.config.jaeger }} + {{- else if .Values.installation.jaeger }} + jaeger: http://jaeger-all-in-one-collector.{{ $.Values.installation.namespace }}.svc{{ $.Values.installation.clusterDomain }}:14268/api/traces + {{- end }} scheduler: netAddrs: {{- $count := .Values.scheduler.replicas | int}} diff --git a/deploy/charts/dragonfly/templates/jaeger.yaml b/deploy/charts/dragonfly/templates/jaeger.yaml new file mode 100644 index 000000000..ec4ad37c6 --- /dev/null +++ b/deploy/charts/dragonfly/templates/jaeger.yaml @@ -0,0 +1,297 @@ +{{- if .Values.installation.jaeger }} +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app: jaeger + app.kubernetes.io/component: service-account + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one + namespace: {{ .Values.installation.namespace }} + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app: jaeger + app.kubernetes.io/component: ui-configuration + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one-ui-configuration + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one-ui-configuration + namespace: {{ .Values.installation.namespace }} +data: + ui: |- + { + "menu": [ + { + "items": [ + { + "label": "Documentation", + "url": "https://www.jaegertracing.io/docs/1.23" + } + ], + "label": "About" + } + ] + } + +--- + +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app: jaeger + app.kubernetes.io/component: sampling-configuration + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one-sampling-configuration + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one-sampling-configuration + namespace: {{ .Values.installation.namespace }} +data: + sampling: |- + { + "default_strategy": { + "param": 1, + "type": "probabilistic" + } + } + +--- + +apiVersion: v1 +kind: Service +metadata: + labels: + app: jaeger + app.kubernetes.io/component: service-collector + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one-collector + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one-collector-headless + namespace: {{ .Values.installation.namespace }} +spec: + clusterIP: None + ports: + - name: http-zipkin + port: 9411 + targetPort: 0 + - name: http-grpc + port: 14250 + targetPort: 0 + - name: c-tchan-trft + port: 14267 + targetPort: 0 + - name: http-c-binary-trft + port: 14268 + targetPort: 0 + selector: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + +--- + +apiVersion: v1 +kind: Service +metadata: + labels: + app: jaeger + app.kubernetes.io/component: service-collector + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one-collector + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one-collector + namespace: {{ .Values.installation.namespace }} +spec: + ports: + - name: http-zipkin + port: 9411 + targetPort: 0 + - name: http-grpc + port: 14250 + targetPort: 0 + - name: c-tchan-trft + port: 14267 + targetPort: 0 + - name: http-c-binary-trft + port: 14268 + targetPort: 0 + selector: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + +--- + +apiVersion: v1 +kind: Service +metadata: + labels: + app: jaeger + app.kubernetes.io/component: service-query + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one-query + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one-query + namespace: {{ .Values.installation.namespace }} +spec: + ports: + - name: http-query + port: 16686 + targetPort: 16686 + selector: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + +--- + +apiVersion: v1 +kind: Service +metadata: + labels: + app: jaeger + app.kubernetes.io/component: service-agent + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one-agent + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one-agent + namespace: {{ .Values.installation.namespace }} +spec: + clusterIP: None + ports: + - name: zk-compact-trft + port: 5775 + protocol: UDP + targetPort: 0 + - name: config-rest + port: 5778 + targetPort: 0 + - name: jg-compact-trft + port: 6831 + protocol: UDP + targetPort: 0 + - name: jg-binary-trft + port: 6832 + protocol: UDP + targetPort: 0 + selector: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + +--- + +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + name: jaeger-all-in-one + namespace: {{ .Values.installation.namespace }} +spec: + selector: + matchLabels: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + strategy: {} + template: + metadata: + labels: + app: jaeger + app.kubernetes.io/component: all-in-one + app.kubernetes.io/instance: jaeger-all-in-one + app.kubernetes.io/name: jaeger-all-in-one + app.kubernetes.io/part-of: jaeger + spec: + containers: + - args: + - --query.ui-config=/etc/config/ui.json + - --sampling.strategies-file=/etc/jaeger/sampling/sampling.json + env: + - name: SPAN_STORAGE_TYPE + value: memory + - name: COLLECTOR_ZIPKIN_HTTP_PORT + value: "9411" + image: jaegertracing/all-in-one:1.23.0 + livenessProbe: + failureThreshold: 5 + httpGet: + path: / + port: 14269 + initialDelaySeconds: 5 + periodSeconds: 15 + name: jaeger + ports: + - containerPort: 5775 + name: zk-compact-trft + protocol: UDP + - containerPort: 5778 + name: config-rest + - containerPort: 6831 + name: jg-compact-trft + protocol: UDP + - containerPort: 6832 + name: jg-binary-trft + protocol: UDP + - containerPort: 9411 + name: zipkin + - containerPort: 14267 + name: c-tchan-trft + - containerPort: 14268 + name: c-binary-trft + - containerPort: 16686 + name: query + - containerPort: 14269 + name: admin-http + - containerPort: 14250 + name: grpc + readinessProbe: + httpGet: + path: / + port: 14269 + initialDelaySeconds: 1 + resources: {} + volumeMounts: + - mountPath: /etc/config + name: jaeger-all-in-one-ui-configuration-volume + readOnly: true + - mountPath: /etc/jaeger/sampling + name: jaeger-all-in-one-sampling-configuration-volume + readOnly: true + serviceAccountName: jaeger-all-in-one + volumes: + - configMap: + items: + - key: ui + path: ui.json + name: jaeger-all-in-one-ui-configuration + name: jaeger-all-in-one-ui-configuration-volume + - configMap: + items: + - key: sampling + path: sampling.json + name: jaeger-all-in-one-sampling-configuration + name: jaeger-all-in-one-sampling-configuration-volume +{{- end }} \ No newline at end of file diff --git a/deploy/charts/dragonfly/values.yaml b/deploy/charts/dragonfly/values.yaml index 2de507d23..9d5758c42 100644 --- a/deploy/charts/dragonfly/values.yaml +++ b/deploy/charts/dragonfly/values.yaml @@ -5,6 +5,9 @@ fullnameOverride: "" installation: namespace: dragonfly-system clusterDomain: "" + # enable an all in one jaeger for tracing every downloading event + # should not use in production environment + jaeger: false scheduler: name: scheduler @@ -136,6 +139,7 @@ dfdaemon: gcInterval: 1m0s keepStorage: false verbose: true + jaeger: "" # customize jaeger like: http://localhost:14268/api/traces host: listenIP: 0.0.0.0 advertiseIP: 0.0.0.0