kubernetes-helm

How not to overwrite randomly generated secrets in Helm templates

风流意气都作罢 提交于 2021-01-21 07:22:17
问题 I want to generate a password in a Helm template, this is easy to do using the randAlphaNum function. However the password will be changed when the release is upgraded. Is there a way to check if a password was previously generated and then use the existing value? Something like this: apiVersion: v1 kind: Secret metadata: name: db-details data: {{ if .Secrets.db-details.db-password }} db-password: {{ .Secrets.db-details.db-password | b64enc }} {{ else }} db-password: {{ randAlphaNum 20 |

How can we create service dependencies using kubernetes

半腔热情 提交于 2021-01-20 19:24:18
问题 I have 2 services. One containing 2 pod replicas for a web application which is dependent on another backend service having pod (2 replicas) for MySQL containers. The web application uses environment variables set by backend DB service. I've all the json inside the same directory. Is there any way to express the dependencies so that kubectl always create (and run) backend pods and services before it starts the web application service? I have used kubedeam to create the cluster. 回答1: I can

Helm Conditional Templates

China☆狼群 提交于 2021-01-02 05:38:19
问题 I found that we can create subcharts and conditionally include them as described here: Helm conditionally install subchart I have just one template that I want conditionally include in my chart but I could not find anything in the docs. Is there such feature? 回答1: I discovered that empty templates are not loaded. I solved it by wrapping my yaml file content in an if condition. {{ if .Values.something }} content of yaml file {{ end }} 回答2: You simply wrap the template resource at the first and

Helm Conditional Templates

五迷三道 提交于 2021-01-02 05:37:09
问题 I found that we can create subcharts and conditionally include them as described here: Helm conditionally install subchart I have just one template that I want conditionally include in my chart but I could not find anything in the docs. Is there such feature? 回答1: I discovered that empty templates are not loaded. I solved it by wrapping my yaml file content in an if condition. {{ if .Values.something }} content of yaml file {{ end }} 回答2: You simply wrap the template resource at the first and

Rabbit mq - Error while waiting for Mnesia tables

让人想犯罪 __ 提交于 2020-12-30 09:29:44
问题 I have installed rabbitmq using helm chart on a kubernetes cluster. The rabbitmq pod keeps restarting. On inspecting the pod logs I get the below error 2020-02-26 04:42:31.582 [warning] <0.314.0> Error while waiting for Mnesia tables: {timeout_waiting_for_tables,[rabbit_durable_queue]} 2020-02-26 04:42:31.582 [info] <0.314.0> Waiting for Mnesia tables for 30000 ms, 6 retries left When I try to do kubectl describe pod I get this error Conditions: Type Status Initialized True Ready False

Rabbit mq - Error while waiting for Mnesia tables

无人久伴 提交于 2020-12-30 09:20:47
问题 I have installed rabbitmq using helm chart on a kubernetes cluster. The rabbitmq pod keeps restarting. On inspecting the pod logs I get the below error 2020-02-26 04:42:31.582 [warning] <0.314.0> Error while waiting for Mnesia tables: {timeout_waiting_for_tables,[rabbit_durable_queue]} 2020-02-26 04:42:31.582 [info] <0.314.0> Waiting for Mnesia tables for 30000 ms, 6 retries left When I try to do kubectl describe pod I get this error Conditions: Type Status Initialized True Ready False

Rabbit mq - Error while waiting for Mnesia tables

扶醉桌前 提交于 2020-12-30 09:18:23
问题 I have installed rabbitmq using helm chart on a kubernetes cluster. The rabbitmq pod keeps restarting. On inspecting the pod logs I get the below error 2020-02-26 04:42:31.582 [warning] <0.314.0> Error while waiting for Mnesia tables: {timeout_waiting_for_tables,[rabbit_durable_queue]} 2020-02-26 04:42:31.582 [info] <0.314.0> Waiting for Mnesia tables for 30000 ms, 6 retries left When I try to do kubectl describe pod I get this error Conditions: Type Status Initialized True Ready False

Kubernetes - How to define ConfigMap built using a file in a yaml?

给你一囗甜甜゛ 提交于 2020-12-21 14:28:29
问题 At present I am creating a configmap from the file config.json by executing: kubectl create configmap jksconfig --from-file=config.json I would want the ConfigMap to be created as part of the deployment and tried to do this: apiVersion: v1 kind: ConfigMap metadata: name: jksconfig data: config.json: |- {{ .Files.Get "config.json" | indent 4 }} But doesn't seem to work. What should be going into configmap.yaml so that the same configmap is created? ---UPDATE--- when I do a helm install dry run

Kubernetes - How to define ConfigMap built using a file in a yaml?

自古美人都是妖i 提交于 2020-12-21 14:28:25
问题 At present I am creating a configmap from the file config.json by executing: kubectl create configmap jksconfig --from-file=config.json I would want the ConfigMap to be created as part of the deployment and tried to do this: apiVersion: v1 kind: ConfigMap metadata: name: jksconfig data: config.json: |- {{ .Files.Get "config.json" | indent 4 }} But doesn't seem to work. What should be going into configmap.yaml so that the same configmap is created? ---UPDATE--- when I do a helm install dry run

Updated configMap.yaml but it's not being applied to Kubernetes pods

泄露秘密 提交于 2020-12-13 16:14:19
问题 I'm editing configMap.yaml in my Helm chart, but when I log in to one of my pods to check if it's being applied, it doesn't reflect my changes. I'm fairly new to Helm charts so any help is appreciated. 回答1: For updating your ConfigMap you can also use kubectl patch command if you find it more fitting for you. Documentation regarding it can be found here. For applying the changes there is a very useful tool called Reloader. Reloader can watch changes in ConfigMap and Secret and do rolling