我刚刚从helm/charts/stable/hadoop
借来安装了kubernetes集群。
现在我所有的Pod的前缀都为“ listening-snail
”
这是从哪里来的?我在所有配置文件中搜索高低,但找不到任何东西。当然我也没有在命令行上提供它!!!
$ helm install --namespace hadoopns hadoop
NAME: listening-snail
LAST DEPLOYED: Tue Jul 30 22:04:03 2019
NAMESPACE: hadoopns
STATUS: DEPLOYED
RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
listening-snail-hadoop 8 0s
==> v1/Pod(related)
NAME READY STATUS RESTARTS AGE
listening-snail-hadoop-hdfs-dn-0 0/1 ContainerCreating 0 0s
listening-snail-hadoop-hdfs-nn-0 0/1 ContainerCreating 0 0s
listening-snail-hadoop-yarn-nm-0 0/1 ContainerCreating 0 0s
listening-snail-hadoop-yarn-rm-0 0/1 ContainerCreating 0 0s
...
答案 0 :(得分:1)
如this answer中所述,listening-snail
来自您的StatefulSet名称。
charts/stable/hadoop
的{{3}}中的StatefulSet名称为
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{ include "hadoop.fullname" . }}-hdfs-dn
hadoop.fullname
在hdfs-dn-statefulset.yaml
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "hadoop.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
因此,如果您没有在--name
命令中提供helm install
参数,则它是由舵机生成的随机.Release.Name
-hadoop
(其中hadoop
是.Chart.Name
,并且可以在您的 values.yaml 文件中被nameOverride
覆盖。