restartPolicy:不支持的值:“从不":支持的值:“始终"; [英] restartPolicy: Unsupported value: "Never": supported values: "Always"

查看:2032
本文介绍了restartPolicy:不支持的值:“从不":支持的值:“始终";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的广告连播具有以下配置:

I have the following configuration for my pod:

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: my-app
  labels:
    app: my-app
spec:
  serviceName: my-app
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
      restartPolicy: Never
      containers:
      - name: my-app
        image: myregistry:443/mydomain/my-app
        imagePullPolicy: Always

并且它无需重新启动策略即可正常部署.但是,我不希望该过程一旦完成就再次运行,因此我添加了"restartPolicy:从不".不幸的是,当我尝试部署时,出现以下错误:

And it deploys fine without the restartPolicy. However, I do not want the process to be run again once finished, hence I added the 'restartPolicy: Never'. Unfortunately I get the following error when I attempt to deploy:

Error from server (Invalid): error when creating "stack.yaml": StatefulSet.apps "my-app" is invalid: spec.template.spec.restartPolicy: Unsupported value: "Never": supported values: "Always"

我想念什么?

谢谢

推荐答案

请参阅 https://github.com/kubernetes/kubernetes/issues/24725

似乎仅支持始终".

这篇关于restartPolicy:不支持的值:“从不":支持的值:“始终";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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