带有私有存储库映像的 Openshift 自定义部署策略

问题描述 投票:0回答:1

我正在 openshift 中开发 DeploymentConfig 的自定义部署策略。我希望我的图像是从需要身份验证的私人文物中获取的。但是,在自定义策略参数中,我没有看到任何与 imagePullSecrets

相关的内容

openshift的example也没有提到任何关于imagePull Secret的内容:

如何使用镜像拉取密钥在 DeploymentConfig.spec.strategy.customParams.image 拉取镜像?

kubernetes openshift
1个回答
0
投票

:“imagePullSecrets”`在“spec.template.spec.imagePullSecrets”中指定,而不是在“策略”下指定:

spec:
  replicas: 3
  template:
    spec:
      containers:
        - name: container
          image: xxxx
          {...}
      imagePullSecrets: []
  strategy: 
    type: Rolling
    {...}

另请注意,“DeploymentConfig”和“BuildConfig”已弃用,并将在 OCP 的未来版本中删除(很快?):

参考:https://docs.okd.io/latest/applications/deployments/what-deployments-are.html

As of OKD 4.14, DeploymentConfig objects are deprecated. DeploymentConfig objects are still supported, but are not recommended for new installations. Only security-related and critical issues will be fixed.
Instead, use Deployment objects or another alternative to provide declarative updates for pods.
© www.soinside.com 2019 - 2024. All rights reserved.