Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

issue with aws-eks-kubectl-run:2.2.0

Emmanuel Cohen-Laroque March 24, 2023

When deploying on EKS, I get the following error (see bold line below)

Here is the related pipeline script

script:
- pipe: atlassian/aws-eks-kubectl-run:2.2.0
variables:
AWS_ACCESS_KEY_ID: ${REHEARSAL_AWS_KEY}
AWS_SECRET_ACCESS_KEY: ${REHEARSAL_AWS_SECRET}
AWS_DEFAULT_REGION: "eu-west-3"
CLUSTER_NAME: "XXXXXXXXXXX"
KUBECTL_COMMAND: "apply --force=true -f"
RESOURCE_PATH: "k8s/${BITBUCKET_REPO_SLUG}-staging.yaml"
DEBUG: "true"

Status: Downloaded newer image for bitbucketpipelines/aws-eks-kubectl-run:2.2.0
DEBUG: Starting new HTTPS connection (1): bitbucket.org:443
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None
INFO: Configuring kubeconfig...
Added new context arn:aws:eks:eu-west-3:xxxxxxxxxxxx to /root/.kube/config
Entries:
context:
cluster: arn:aws:eks:eu-west-3:xxxxxxxxxxxxxx
user: arn:aws:eks:eu-west-3:xxxxxxxxxxxxxxx
name: arn:aws:eks:eu-west-3:xxxxxxxxxxxxxx
name: arn:aws:eks:eu-west-3:xxxxxxxxxxxxxxx
user:
exec:
args:
- --region
- eu-west-3
- eks
- get-token
- --cluster-name
- xxxxxxxxxxxxxx
command: aws
cluster:
certificate-authority-data: xxxxxxxxxxxxxxx==
name: arn:aws:eks:eu-west-3:xxxxxxxxxxxxxxxxx
INFO: Successfully updated the kube config.
error: the path "--v=2" does not exist
✖ kubectl apply --force=true -f failed.

1 answer

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 24, 2023

@Emmanuel Cohen-Laroque hi. Your pipe command was not resolved correctly.
Please, take a look at the pipe README, you should provide apply related arguments under  `KUBECTL_APPLY_ARGS`, but since `-f` is used by default, you could omit it. And `--force=true` argument should be passed to `KUBECTL_ARGS`. 

So your script should be like this:

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: 'my-kube-cluster'
      KUBECTL_COMMAND: 'apply'
      RESOURCE_PATH: 'k8s/${BITBUCKET_REPO_SLUG}-staging.yaml'
      KUBECTL_ARGS:
        - "--force"

 Regards, Igor.

Suggest an answer

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

Atlassian Community Events