【问题标题】:How to deploy a release after changing the configurations?更改配置后如何部署发布?
【发布时间】:2019-09-27 11:53:54
【问题描述】:

我已经成功地在我的集群中发布了 jhub。然后我更改了配置以提取另一个 docker 映像,如 documentation 中所述。

这一次,在运行相同的旧命令时:

# Suggested values: advanced users of Kubernetes and Helm should feel
# free to use different values.
RELEASE=jhub
NAMESPACE=jhub

helm upgrade --install $RELEASE jupyterhub/jupyterhub \
  --namespace $NAMESPACE  \
  --version=0.8.2 \
  --values jupyter-hub-config.yaml

jupyter-hub-config.yaml 文件在哪里:

proxy:
  secretToken: "<a secret token>"
singleuser:
  image:
    # Get the latest image tag at:
    # https://hub.docker.com/r/jupyter/datascience-notebook/tags/
    # Inspect the Dockerfile at:
    # https://github.com/jupyter/docker-stacks/tree/master/datascience-notebook/Dockerfile
    name: jupyter/datascience-notebook
    tag: 177037d09156

我遇到以下问题:

UPGRADE FAILED
ROLLING BACK
Error: "jhub" has no deployed releases
Error: UPGRADE FAILED: "jhub" has no deployed releases

然后我通过kubectl delete ns/jhub 删除了命名空间,并通过helm delete --purge jhub 进行了发布。再次尝试此命令无效,再次出现同样的错误。

我阅读了一些 GH 问题,发现 YAML 文件无效或 --force 标志有效。但是,就我而言,这两个都不是有效的。

我希望发布此版本,并学习如何编辑当前版本。

注意:正如您在上述文档中发现的那样,创建了一个 pvc。

【问题讨论】:

  • 这种情况还有效吗?

标签: kubernetes jupyter devops kubernetes-helm jupyterhub


【解决方案1】:

在我的 gCloud 中添加了以下内容。每次我更新我的config.yaml 文件时都会运行它。运行前请确保连接到正确的 Kubernetes 集群。

update.sh
# Installs Helm.
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash

# Make Helm aware of the JupyterHub Helm chart repo.
helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
helm repo update

# Re-installs the chart configured by your config.yaml.
RELEASE=jhub
JUPYTERHUB_VERSION=0.9.0
helm upgrade $RELEASE jupyterhub/jupyterhub \
  --version=${JUPYTERHUB_VERSION} \
  --values config.yaml

【讨论】:

    【解决方案2】:

    当我尝试在 GKE 中更新我的 config.yaml 文件时遇到了同样的问题。实际上对我有用的是重做这些步骤:

    1. 运行curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash

    2. helm init --service-account tiller --history-max 100 --wait

    3. [可选]helm version 验证您是否有与文档类似的输出

    4. 添加仓库

    helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
    helm repo update
    
    1. 运行升级
    RELEASE=jhub
    NAMESPACE=jhub
    
    helm upgrade $RELEASE jupyterhub/jupyterhub \
      --namespace $NAMESPACE  \
      --version=0.9.0 \
      --values config.yaml
    

    【讨论】:

      【解决方案3】:

      在 kubeconfig 更改后,下一个解决方案对我有用

      helm init --tiller-namespace=<ns> --upgrade
      

      适用于 kubectl 1.10.0 和 helm 2.3.0。我想这会将分蘖升级到兼容的 helm 版本。

      不要忘记在使用此命令之前设置 KUBECONFIG 变量 - 如果您在更改 kubeconfig 后没有这样做,此步骤本身可能会解决您的问题。

      export KUBECONFIG=<*.kubeconfig>
      

      在我的例子中,配置 cluster.server 字段已更改,但我留下的 context.name 和 current-context 字段与之前的配置相同,不确定是否重要。我在第一次尝试使用 helm 部署新版本时遇到了同样的问题,但是在第一次成功部署后,更改 KUBECONFIG 变量就足够了。 希望对你有帮助。

      【讨论】:

      • 多解释一下你的答案
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多