kubernetes-helm

“Ghost” kubernetes pod stuck in terminating

99封情书 提交于 2019-12-04 03:57:16
The situation I have a kubernetes pod stuck in "Terminating" state that resists pod deletions NAME READY STATUS RESTARTS AGE ... funny-turtle-myservice-xxx-yyy 1/1 Terminating 1 11d ... Where funny-turtle is the name of the helm release that have since been deleted. What I have tried try to delete the pod. Output: pod "funny-turtle-myservice-xxx-yyy" deleted Outcome: it still shows up in the same state. - also tried with --force --grace-period=0 , same outcome with extra warning warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The

kubernetes helm: “lost connection to pod” and “transport is closing” errors

一曲冷凌霜 提交于 2019-12-04 03:54:40
I run helm upgrade --install to modify the state of my kubernetes cluster and I sometimes get an error like this: 22:24:34 StdErr: E0126 17:24:28.472048 48084 portforward.go:178] lost connection to pod 22:24:34 Error: UPGRADE FAILED: transport is closing It seems that I am not the only one, and it seems to happen with many different helm commands. All of these github issues have descriptions or comments mentioning "lost connection to pod" or "transport is closing" errors (usually both): https://github.com/kubernetes/helm/issues/1183 https://github.com/kubernetes/helm/issues/2003 https://github

Variable value as yaml key in helm chart

六月ゝ 毕业季﹏ 提交于 2019-12-04 01:51:17
问题 I want to choose config section from values.yaml by setting a variable in helm command line. example part of values.yaml: aaa: x1: "az1" x2: "az2" bbb: x1: "bz1" x2: "bz2" example part of configmap.yaml data: {{ .Values.outsideVal.x1 }} Expected result should looks like this data: az1 Test helm output helm template --set outsideVal=aaa mychart And got this error Error: render error in "./templates/configmap.yaml": template: ./templates/configmap.yaml:21:12: executing "./templates/configmap

Helm _helpers.tpl: Calling defined templates in other template definitions

我是研究僧i 提交于 2019-12-03 16:29:09
问题 Helm _helpers.tpl? Helm allows for the use of Go templating in resource files for Kubernetes. A file named _helpers.tpl is usually used to define Go template helpers with this syntax: {{- define "yourFnName" -}} {{- printf "%s-%s" .Values.name .Values.version | trunc 63 -}} {{- end -}} Which you can then use in your *.yaml resource files like so: {{ template "yourFnName" . }} The Question How can I use the helpers I define, in other helper definitions? For example, what if I have a helper for

Helm chart deployment and private docker repository

柔情痞子 提交于 2019-12-03 16:25:42
I have a private Docker repo with bunch of images. I am using Helm to deploy them to a Kubernetes cluster. Helm values.yaml contains the repository credentials: image: repository: <repo> tag: <version tag> pullPolicy: IfNotPresent imageCredentials: registry: <repo> username: <username> password: <pw> After doing the helm installation helm install myhelmchart --values values.yaml --version the pod's status is Init:ErrImagePull. kubectl describe pods gives this error: Failed to pull image "image:tag": rpc error: code = Unknown desc = Error response from daemon: Get [image]/manifests/[version]:

Helm: generate comma separated list

耗尽温柔 提交于 2019-12-03 13:31:59
Using Helm templates, I'm trying to generate a list of server names based on a number in values.yaml. The dot for this template is set to the number (its a float64). {{- define "zkservers" -}} {{- $zkservers := list -}} {{- range int . | until -}} {{- $zkservers := print "zk-" . ".zookeeper" | append $zkservers -}} {{- end -}} {{- join "," $zkservers -}} {{- end -}} For an input of, say, 3 I'm expecting this to produce: zk-0.zookeeper,zk-1.zookeeper,zk-2.zookeeper It produces nothing. I understand that the line within the range block is a no-op since the variable $zkservers is a new variable

Helm Subchart order of execution in an umbrella chart

牧云@^-^@ 提交于 2019-12-03 11:04:11
I have an umbrella chart with multiple sub-charts, I simply want to make sure that subchart1 runs before subchart2, etc. How can we define the order of subchart execution? Seems like hook-weights only apply relative to the chart that declares them. VAS Here is a part of the Helm documentation related to execution order of charts: The above sections explain how to specify chart dependencies, but how does this affect chart installation using helm install and helm upgrade? Suppose that a chart named "A" creates the following Kubernetes objects namespace "A-Namespace" statefulset "A-StatefulSet"

how to delete tiller from kubernetes cluster

与世无争的帅哥 提交于 2019-12-03 10:26:49
问题 Tiller is not working properly in my kubernetes cluster. I want to delete everything Tiller. Tiller (2.5.1) has 1 Deployment, 1 ReplicaSet and 1 Pod. I tried: kubectl delete deployment tiller-deploy -n kube-system results in "deployment "tiller-deploy" deleted" however, tiller-deploy is immediately recreated kubectl get deployments -n kube-system shows tiller-deploy running again I also tried: kubectl delete rs tiller-deploy-393110584 -n kube-system results in "replicaset "tiller-deploy

How to pull environment variables with Helm charts

时间秒杀一切 提交于 2019-12-03 04:13:53
问题 I have my deployment.yaml file within the templates directory of Helm charts with several environment variables for the container I will be running using Helm. Now I want to be able to pull the environment variables locally from whatever machine the helm is ran so I can hide the secrets that way. How do I pass this in and have helm grab the environment variables locally when I use Helm to run the application? Here is some part of my deployment.yaml file ... ... spec: restartPolicy: Always

How can you call a helm 'helper' template from a subchart with the correct context?

断了今生、忘了曾经 提交于 2019-12-03 02:57:18
Helm charts define helper templates in _helpers.tpl which are used to create normalized names for the services. The standard form of the template for a service (DNS) name is: {{- define "postgresql.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} If using postgresql as a subchart, how are you supposed to use DNS-based service discovery to refer to it? A common pattern seems to be to copy the subchart helpers into the parent chart. {{- define "keycloak.postgresql.fullname" -}} {{- $name :=