Skip to content

Remove hard-coding of cluster domain #83

Open
@sjgiri

Description

@sjgiri

Currently, the template definition svc-domain hardcodes
the cluster domain to be cluster.local. For environments where
the cluster domain suffix could be different, hdfs chart does not
work.
The following can be a potential fix.

diff --git a/charts/hdfs-k8s/templates/_helpers.tpl b/charts/hdfs-k8s/templates/_helpers.tpl
index 9d03c4d..84803db 100644
--- a/charts/hdfs-k8s/templates/_helpers.tpl
+++ b/charts/hdfs-k8s/templates/_helpers.tpl
@@ -163,7 +163,7 @@ The HDFS config file should specify FQDN of services. Otherwise, Kerberos
 login may fail.
 */}}
 {{- define "svc-domain" -}}
-{{- printf "%s.svc.cluster.local" .Release.Namespace -}}
+{{- printf "%s.svc.%s" .Release.Namespace .Values.global.cluster_domain_suffix -}}
 {{- end -}}
 
 {{/*
diff --git a/charts/hdfs-k8s/values.yaml b/charts/hdfs-k8s/values.yaml
index 77ca3fe..8e313d2 100644
--- a/charts/hdfs-k8s/values.yaml
+++ b/charts/hdfs-k8s/values.yaml
@@ -170,6 +170,9 @@ hdfs-krb5-k8s:
 ## Global values affecting all sub-charts:
 ## ------------------------------------------------------------------------------
 global:
+  # Domain suffix to be used for FQDN
+  cluster_domain_suffix: cluster.local

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions