kubernetes-helm

Should I use configMap for every environment variable?

蓝咒 提交于 2019-12-10 09:53:00
问题 I am using helm right now. My project is like that: values.yaml: environmentVariables: KEY1: VALUE1 KEY2: VALUE2 configmap.yaml: apiVersion: v1 kind: ConfigMap metadata: name: {{ template "myproject.fullname" . }} data: {{- range $k, $v := .Values.environmentVariables }} {{ $k }}: {{ $v | quote }} {{- end }} deployment.yaml: apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "myproject.fullname" . }} spec: template: spec: containers: - name: {{ .Chart.Name }} image: "{{ .Values

Golang template (helm) iterating over a list of maps

≡放荡痞女 提交于 2019-12-10 09:26:23
问题 I'm using helm to generate kubernetes yamls. My values.yaml looks like this: ... jobs: - nme: job1 command: [sh, -c, "/app/deployment/start.sh job1"] activeDeadlineSeconds: 600 - name: job2 command: [sh, -c, "/app/deployment/start.sh job2"] activeDeadlineSeconds: 600 ... templates/jobs.yaml {{ range $i, $job := .Values.jobs -}} apiVersion: batch/v1 kind: Job metadata: name: {{ template "name" . }}-{{ $job.name }} labels: chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" spec:

Accessing the deployed service using Helm chart in Kubernetes cluster

淺唱寂寞╮ 提交于 2019-12-10 02:14:06
问题 Currently, I am trying to deploy my microservice end point Docker image on a Kubernetes cluster by creating the Helm chart. For this, I created the chart and changed the parameters in values.yaml and deployment.yaml for port change. And also I want to access from my Angular front end. So I added service type= NodePort. And when I described the service, it gave me the port 30983 to access. And I accessed like http://node-ip:30983/endpoint But I am only getting the site can't be reached the

Kubernetes Helm, combine two variables with a string in the middle

梦想的初衷 提交于 2019-12-10 01:23:51
问题 I’m trying to change the value of a variable if another variable it set by combining the two with a dash in the middle, I’m not sure of the syntax to do this, I’m thinking of somethings like: {{- $serviceNamespace := .Values.serviceNamespace -}} {{- $serviceTag := .Values.serviceTag -}} {{- if $serviceTag}} {{- $serviceNamespace := .Values.serviceNamespace "-" .Values.serviceTag -}} {{- end}} Is this correct? if serviceNamespace was hello and serviceTag was 1.0.0 would I end up with

Helm: How to Override Value with Periods in Name

烂漫一生 提交于 2019-12-09 17:18:14
问题 I am trying to script setup of Jenkins so that I can create and tear down Jenkins clusters programmatically with helm. I've hit an annoying snag where I cannot set a key with dots in the name. My helm values.yaml file looks like this: --- rbac: install: true Master: HostName: jenkins.mycompany.com ServiceType: ClusterIP ImageTag: lts InstallPlugins: - kubernetes - workflow-aggregator - workflow-job - credentials-binding - git - blueocean - github - github-oauth ScriptApproval: - "method

helm overriding Chart and Values yaml from a base template chart

蹲街弑〆低调 提交于 2019-12-09 16:55:16
问题 I have defined a parent chart called base-microservice and is available at mycompany.github.com/pages/base-microservice Structure is as follows : base-microservice - templates - deployment.yaml - ingress.yaml - service.yaml - Chart.yaml - values.yaml - index.yaml - base-microservice-0.1.0.tgz I would like to define a customapp chart which inherits from the parent chart. Structure is as follows : customapp-service - customapp - Chart.yaml - charts - requirements.yaml - values.yaml - src

helm lint: INFO Chart.yaml: icon is recommended

二次信任 提交于 2019-12-08 16:03:44
问题 Running helm lint I get: I get: [INFO] Chart.yaml: icon is recommended Where do I set the icon? 回答1: From helm docs (https://docs.helm.sh/developing_charts/#charts): icon: A URL to an SVG or PNG image to be used as an icon (optional). I.e.: apiVersion: v1 description: A Helm chart name: myChart version: 0.1.0 icon: https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png 来源: https://stackoverflow.com/questions/51557965/helm-lint-info-chart-yaml-icon-is-recommended

use prometheus with external ip address

自古美人都是妖i 提交于 2019-12-08 09:01:21
问题 we have k8s cluster and I’ve application which is running there. Now I try to add https://prometheus.io/ and I use the command helm install stable/prometheus --version 6.7.4 --name my-prometheus this command works and I got this NAME: my-prometheus LAST DEPLOYED: Tue Feb 5 15:21:46 2019 NAMESPACE: default STATUS: DEPLOYED ... when I run command kubectl get services I got this kubernetes ClusterIP 100.64.0.1 <none> 443/TCP 2d4h my-prometheus-alertmanager ClusterIP 100.75.244.55 <none> 80/TCP

Scheduled restart of Kubernetes pod without downtime

☆樱花仙子☆ 提交于 2019-12-08 07:08:49
问题 I have 6 replicas of a pod running which I would like to restart\recreate every 5 minutes. This needs to be a rolling update - so that all are not terminated at once and there is no downtime. How do I achieve this? I tried using cron job, but seems not to be working : apiVersion: batch/v1beta1 kind: CronJob metadata: name: scheduled-pods-recreate spec: schedule: "*/5 * * * *" concurrencyPolicy: Forbid jobTemplate: spec: template: spec: containers: - name: ja-engine image: app-image

adding quotes around shellscript parameter from Jenkins/groovy

心不动则不痛 提交于 2019-12-08 06:49:46
问题 I'm building a pipeline in Jenkins, and in this pipeline, I call a shellscript: sh "helm upgrade --install $app --set myVar=$myVar" now, after trying this in the terminal on my local machine, I've discovered that for some values of myVar , it needs to be quoted on the commandline. (specifically I'm passing a YAML list, example: "{foo,bar,baz}" ) Now it turns out this is not as simple as it would seem. my first attempt was: sh "helm upgrade --install $app --set myVar='$myVar'" but in the logs,