issues with bitbucket pipeline with AWS EKS

Asad October 26, 2022

Hello community, I have setup bitbucket-pipelines for auto deployment to my AWS EKS cluster, below is the pipeline;

 - step:

     name: "Apply Billing App Latest Version"

     services:

        - docker

     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-region

              CLUSTER_NAME: 'My-Cluster-Name'

              KUBECTL_COMMAND: 'apply'

              RESOURCE_PATH: 'infra/k8s/billing-dep.yaml'

              KUBECTL_APPLY_ARGS: '-f'

 

Now, the problem is when Devs pushes their code to the bitbucket in a specific branch, the pipeline starts and build a docker image, then pushes the image to the AWS ECR, and then comes the deployment on EKS cluster, here I face the issue, the pipeline does not apply the latest docker image, I dont know why?

2 answers

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 28, 2022

@Asad hi , Thanks for your question.

 

You docker image is set in your 

infra/k8s/billing-dep.yaml

file, is this true?

 `the pipeline starts and build a docker image, then pushes the image to the AWS ECR` -- maybe instead of latest tag provide some custom tag (exact version of latest image) ? And than update your yaml deployment  file with new correct docker image version

Regards, Igor

0 votes
Asad October 26, 2022

for now, what I am doing, I just delete the old deployment using pipeline and apply new one and I know this is not the best.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events