Skip to content

add template annotation support for sts/deploy to allow linkerd or ot… #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/dgraph/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `nameOverride` | Deployment name override (will append the release name) | `nil` |
| `fullnameOverride` | Deployment full name override (the release name is ignored) | `nil` |
| `zero.name` | Zero component name | `zero` |
| `zero.metrics.enabled` | Add annotations for Prometheus metric scraping | `true` |
| `zero.extraAnnotations` | Specify annotations for template metadata | `{}` |
| `zero.updateStrategy` | Strategy for upgrading zero nodes | `RollingUpdate` |
| `zero.schedulerName` | Configure an explicit scheduler | `nil` |
| `zero.monitorLabel` | Monitor label for zero, used by prometheus. | `zero-dgraph-io` |
Expand Down Expand Up @@ -103,6 +105,8 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `zero.customLivenessProbe` | Zero custom liveness probes (if `zero.livenessProbe` not enabled) | `{}` |
| `zero.customReadinessProbe` | Zero custom readiness probes (if `zero.readinessProbe` not enabled) | `{}` |
| `alpha.name` | Alpha component name | `alpha` |
| `alpha.metrics.enabled` | Add annotations for Prometheus metric scraping | `true` |
| `alpha.extraAnnotations` | Specify annotations for template metadata | `{}` |
| `alpha.monitorLabel` | Monitor label for alpha, used by prometheus. | `alpha-dgraph-io` |
| `alpha.updateStrategy` | Strategy for upgrading alpha nodes | `RollingUpdate` |
| `alpha.schedulerName` | Configure an explicit scheduler | `nil` |
Expand Down Expand Up @@ -156,6 +160,7 @@ The following table lists the configurable parameters of the `dgraph` chart and
| `alpha.initContainers.init.command` | Alpha initContainer command line to execute | See `values.yaml` for defaults |
| `ratel.name` | Ratel component name | `ratel` |
| `ratel.enabled` | Ratel service enabled or disabled | `false` |
| `ratel.extraAnnotations` | Specify annotations for template metadata | `{}` |
| `ratel.image.registry` | Container registry name | `docker.io` |
| `ratel.image.repository` | Container image name | `dgraph/ratel` |
| `ratel.image.tag` | Container image tag | `v21.03.0` |
Expand Down
10 changes: 10 additions & 0 deletions charts/dgraph/example_values/linkerd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
alpha:
extraAnnotations:
config.linkerd.io/skip-inbound-ports: 7080
config.linkerd.io/skip-outbound-ports: 7080
linkerd.io/inject: enabled
zero:
extraAnnotations:
config.linkerd.io/skip-inbound-ports: 5080
config.linkerd.io/skip-outbound-ports: 5080
linkerd.io/inject: enabled
7 changes: 6 additions & 1 deletion charts/dgraph/templates/alpha/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ spec:
template:
metadata:
name: {{ template "dgraph.alpha.fullname" . }}
{{- if .Values.alpha.metrics.enabled }}
{{- if or .Values.alpha.metrics.enabled .Values.alpha.extraAnnotations }}
annotations:
{{- if .Values.alpha.metrics.enabled }}
prometheus.io/path: /debug/prometheus_metrics
prometheus.io/port: "8080"
prometheus.io/scrape: "true"
{{- end }}
{{- with .Values.alpha.extraAnnotations }}
{{- toYaml . | trimSuffix "\n" | nindent 8 }}
{{- end }}
{{- end }}
labels:
app: {{ template "dgraph.name" . }}
Expand Down
6 changes: 6 additions & 0 deletions charts/dgraph/templates/ratel/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ spec:
replicas: {{ .Values.ratel.replicaCount }}
template:
metadata:
{{- if .Values.ratel.extraAnnotations }}
annotations:
{{- with .Values.ratel.extraAnnotations }}
{{- toYaml . | trimSuffix "\n" | nindent 8 }}
{{- end }}
{{- end }}
labels:
app: {{ template "dgraph.name" . }}
chart: {{ template "dgraph.chart" . }}
Expand Down
7 changes: 6 additions & 1 deletion charts/dgraph/templates/zero/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,16 @@ spec:
template:
metadata:
name: {{ template "dgraph.zero.fullname" . }}
{{- if .Values.zero.metrics.enabled }}
{{- if or .Values.zero.metrics.enabled .Values.zero.extraAnnotations }}
annotations:
{{- if .Values.zero.metrics.enabled }}
prometheus.io/path: /debug/prometheus_metrics
prometheus.io/port: "6080"
prometheus.io/scrape: "true"
{{- end }}
{{- with .Values.zero.extraAnnotations }}
{{- toYaml . | trimSuffix "\n" | nindent 8 }}
{{- end }}
{{- end }}
labels:
app: {{ template "dgraph.name" . }}
Expand Down
11 changes: 11 additions & 0 deletions charts/dgraph/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ zero:
name: zero
metrics:
enabled: true

## StatefulSet spec.template.metadata.annotations
extraAnnotations: {}

monitorLabel: zero-dgraph-io
## StatefulSet controller supports automated updates. There are two valid update strategies: RollingUpdate and OnDelete
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
Expand Down Expand Up @@ -201,6 +205,10 @@ alpha:
name: alpha
metrics:
enabled: true

## StatefulSet spec.template.metadata.annotations
extraAnnotations: {}

monitorLabel: alpha-dgraph-io
## StatefulSet controller supports automated updates. There are two valid update strategies: RollingUpdate and OnDelete
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
Expand Down Expand Up @@ -422,6 +430,9 @@ ratel:
## Disable Ratel service
enabled: false

## Deployment spec.template.metadata.annotations
extraAnnotations: {}

## NOTE: Ratel is no longer included in dgraph image since dgraph/dgraph:v21.03.0
## The image dgraph/dgraph:v21.11.3 is last known version that has Ratel.
image:
Expand Down