头盔升级-安装未接受新更改 [英] Helm upgrade --install isn't picking up new changes

查看:66
本文介绍了头盔升级-安装未接受新更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建CI中使用以下命令,以便掌舵的部署发生在每个构建上.但是,我注意到这些更改尚未部署.

I'm using the command below in my build CI such that the deployments to helm happen on each build. However, I'm noticing that the changes aren't being deployed.

              helm upgrade --install --force \
              --namespace=default \
              --values=kubernetes/values.yaml \
              --set image.tag=latest \
              --set service.name=my-service \
              --set image.pullPolicy=Always \
              myService kubernetes/myservice

我每次都需要标记图像吗?如果存在相同版本,头盔是否不进行安装?

Do I need to tag the image each time? Does helm not do the install if the same version exists?

推荐答案

您不必每次都使用新标签来标记图像.只需添加

You don't have to tag the image each time with a new tag. Just add

date: "{{ now | unixEpoch }}"

spec/template/metadata/labels下的

并设置imagePullPolicy: Always. Helm将检测部署对象中的更改,并每次提取最新映像:

under spec/template/metadata/labels and set imagePullPolicy: Always. Helm will detect the changes in the deployment object and will pull the latest image each time:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: "{{ .Release.Name }}-{{ .Values.app.frontendName }}-deployment"
  labels:
    app.kubernetes.io/name: {{ .Values.app.frontendName }}
    app.kubernetes.io/instance: {{ .Release.Name }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      app.kubernetes.io/name: {{ .Values.app.frontendName }}
      app.kubernetes.io/instance: {{ .Release.Name }}
  template:
    metadata:
      labels:
        app.kubernetes.io/name: {{ .Values.app.frontendName }}
        app.kubernetes.io/instance: {{ .Release.Name }}
        date: "{{ now | unixEpoch }}"
    spec:
      containers:
        - name: {{ .Values.app.frontendName }}
          image: "rajesh12/myimage:latest"
          imagePullPolicy: Always

运行helm upgrade releaseName ./my-chart升级您的版本

这篇关于头盔升级-安装未接受新更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆