Skip to content

Commit d416e51

Browse files
committed
feat(k8s): add k8s cluster domain
1 parent 08cea33 commit d416e51

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

charts/monitor/templates/monitor-grafana-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ spec:
6868
value: {{.Values.grafana.user}}
6969
- name: "DEFAULT_USER_PASSWORD"
7070
value: {{.Values.grafana.password}}
71+
- name: "KUBERNETES_CLUSTER_DOMAIN"
72+
value: {{.Values.global.cluster_domain}}
7173
{{- range $key, $value := .Values.grafana.environment }}
7274
- name: {{ $key }}
7375
value: {{ $value | quote }}

charts/monitor/templates/monitor-telegraf-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ spec:
7676
- name: "AGENT_BUFFER_LIMIT"
7777
value: "100000"
7878
- name: "NSQ_CONSUMER_SERVERS"
79-
value: "[{{range $i := until $nsqdNodeCount}}\"drycc-nsqd-{{$i}}.drycc-nsqd.{{ $.Release.Namespace }}.svc.cluster.local:{{$.Values.nsqd.tcp_port}}\"{{if lt (add 1 $i) $nsqdNodeCount}}, {{end}}{{end}}]"
79+
value: "[{{range $i := until $nsqdNodeCount}}\"drycc-nsqd-{{$i}}.drycc-nsqd.{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:{{$.Values.nsqd.tcp_port}}\"{{if lt (add 1 $i) $nsqdNodeCount}}, {{end}}{{end}}]"
8080
- name: "NSQ_CONSUMER_TOPIC"
8181
value: "metrics"
8282
- name: "NSQ_ENDPOINTS"
83-
value: "[{{range $i := until $nsqdNodeCount}}\"http://drycc-nsqd-{{$i}}.drycc-nsqd.{{ $.Release.Namespace }}.svc.cluster.local:{{$.Values.nsqd.http_port}}\"{{if lt (add 1 $i) $nsqdNodeCount}}, {{end}}{{end}}]"
83+
value: "[{{range $i := until $nsqdNodeCount}}\"http://drycc-nsqd-{{$i}}.drycc-nsqd.{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:{{$.Values.nsqd.http_port}}\"{{if lt (add 1 $i) $nsqdNodeCount}}, {{end}}{{end}}]"
8484
{{- if ne .Values.global.logger_redis_location "off-cluster" }}
8585
- name: DRYCC_LOGGER_REDIS_PASSWORD
8686
valueFrom:
8787
secretKeyRef:
8888
name: logger-redis-creds
8989
key: password
9090
- name: "REDIS_SERVERS"
91-
value: "[{{range $i := until $redisNodeCount}}\":$(DRYCC_LOGGER_REDIS_PASSWORD)@drycc-logger-redis-{{$i}}.drycc-logger-redis.{{ $.Release.Namespace }}.svc.cluster.local:{{$.Values.redis.port}}\"{{if lt (add 1 $i) $redisNodeCount}}, {{end}}{{end}}]"
91+
value: "[{{range $i := until $redisNodeCount}}\":$(DRYCC_LOGGER_REDIS_PASSWORD)@drycc-logger-redis-{{$i}}.drycc-logger-redis.{{$.Release.Namespace}}.svc.{{$.Values.global.cluster_domain}}:{{$.Values.redis.port}}\"{{if lt (add 1 $i) $redisNodeCount}}, {{end}}{{end}}]"
9292
volumeMounts:
9393
- name: logger-redis-creds
9494
mountPath: /var/run/secrets/drycc/redis/creds

charts/monitor/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ global:
6868
# Role-Based Access Control for Kubernetes >= 1.5
6969
use_rbac: false
7070
ingress_class: ""
71+
# A domain name consists of one or more parts.
72+
# Periods (.) are used to separate these parts.
73+
# Each part must be 1 to 63 characters in length and can contain lowercase letters, digits, and hyphens (-).
74+
# It must start and end with a lowercase letter or digit.
75+
cluster_domain: "cluster.local"
7176
# The public resolvable hostname to build your cluster with.
7277
#
7378
# This will be the hostname that is used to build endpoints such as "drycc.$HOSTNAME"

grafana/rootfs/usr/share/grafana/start-grafana

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GRAFANA_USER=${DEFAULT_USER:-admin}
88
GRAFANA_PASSWD=${DEFAULT_USER_PASSWORD:-admin}
99
GRAFANA_PORT=${BIND_PORT:-3000}
1010

11-
INFLUXDB_HOST=${DRYCC_MONITOR_INFLUXDB_SERVICE_HOST:-"drycc-monitor-influxdb.drycc.svc.cluster.local"}
11+
INFLUXDB_HOST=${DRYCC_MONITOR_INFLUXDB_SERVICE_HOST:-"drycc-monitor-influxdb.drycc.svc.${KUBERNETES_CLUSTER_DOMAIN}"}
1212
INFLUXDB_PORT=${DRYCC_MONITOR_INFLUXDB_SERVICE_PORT_TRANSPORT:-8086}
1313
INFLUXDB_DATABASE=${INFLUXDB_DATABASE:-kubernetes}
1414
INFLUXDB_USER=${INFLUXDB_USER:-admin}

0 commit comments

Comments
 (0)