简体   繁体   English

Bitbucket Pippelines EKS 容器镜像变更

[英]Bitbucket Pippelines EKS Container image Change

  • It is required to deploy the ECR Image to EKS via Bitbucket pipelines.需要通过 Bitbucket 管道将 ECR Image 部署到 EKS。

So I have created the step below.所以我创建了下面的步骤。 But I am not sure about the correct command for the KUBECTL_COMMAND to change (set) the deployment image with the new one in a namespace in the EKS cluster:但是我不确定KUBECTL_COMMAND在 EKS 集群的命名空间中用新部署映像更改(设置)部署映像的正确命令:

    - step:
        name: 'Deployment to Production'
        deployment: Production
        trigger: 'manual'
        script:
          - pipe: atlassian/aws-eks-kubectl-run:2.2.0
            variables:
              AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
              AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
              AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
              CLUSTER_NAME: 'xxx-zaferu-dev'
              KUBECTL_COMMAND: 'set image deployment.apps/xxx-dev xxx-application=123456789.dkr.ecr.eu-west-1.amazonaws.com/ci-cd-test:latest'
          - echo " Deployment has been finished successfully..."


  • So I am looking for the correct way for this step!所以我正在寻找这一步的正确方法!

  • If this is not the best way for the CI/CD deployment, I am planning to use basic command to change the conatiner image:如果这不是 CI/CD 部署的最佳方式,我计划使用基本命令来更改容器映像:

image: python:3.8

pipelines:
  default:
    - step:
        name: Update EKS deployment
        script:
          - aws eks update-kubeconfig --name <cluster-name>
          - kubectl set image deployment/<deployment-name> <container-name>=<new-image>:<tag> -n <namespace>
          - aws eks describe-cluster --name <cluster-name>


I tried to use:我尝试使用:

KUBECTL_COMMAND: 'set image deployment.apps/xxx-dev xxx-application=123456789.dkr.ecr.eu-west-1.amazonaws.com/ci-cd-test:latest'

but it gives an error:但它给出了一个错误:

INFO: Successfully updated the kube config.
Error from server (NotFound): deployments.apps "xxx-app" not found

sorry I got my bug, a missing namespace:)抱歉,我遇到了错误,缺少名称空间:)

- kubectl set image deployment/<deployment-name> <container-name>=<new-image>:<tag> -n <namespace> 

I forgot to add -n and then I realized.我忘了加 -n 然后我意识到了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 aws eks bitbucket 管道权限错误 - Aws eks bitbucket pipeline permission error 为什么 python 代码无法在 EKS pod 容器内运行? - Why python code is unable to run inside a EKS pod container? Terraform 即使配置一样也想换EKS节点组 - Terraform wants to change EKS node groups even if configuration is the same 为什么 EKS pod 引用旧的人工图像地址? - Why EKS pods referring to old artifactory image address? Jetbrain Space Automation 如何将图像部署到 AWS EKS (Kube.netes)? - Jetbrain Space Automation how to deploy an image to AWS EKS (Kubernetes)? 您最终为 Container Insights for EKS 为短期 Pod 创建的每个指标支付了多少费用? - How much do you end up paying for each metric created by Container Insights for EKS for short lived pods? EKS 容器操作系统 kernel 的版本是否可以高于主机(节点)操作系统 kernel? - Can EKS container OS kernel have higher version than host (node) OS kernel? 如何检查我的 EKS 容器运行时是否为 docker(针对 k8s 1.24 更新) - How to check if my EKS container runtime is docker (for k8s 1.24 update) 尝试在 EKS 上运行 jitsi/web 镜像,但面临“无法拉取和解压镜像”的问题 - Trying to run jitsi/web image on EKS but facing the "failed to pull and unpack image" issue 无法修改(补丁)docker eks(aws)上现有 kube.netes 部署定义的图像 ID - Can't modify(patch) docker image id of existing kubernetes deployment definition on eks(aws)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM