codefresh-io / steps

36 stars 89 forks source link

add aws eks update-kubeconfig #383

Open 45cali opened 3 years ago

45cali commented 3 years ago

Currently the helm step only takes advantage of kube context that has already been configured. Can you add an option for this step to run this prior to running helm upgrade?

aws eks --region <region> update-kubeconfig --name <cluster name> --alias <friendly name>
45cali commented 2 years ago

or can you at least add aws-cli so in our kubeconfig this runs

- name: arn:aws:eks:<region>:<account>:cluster/<cluster>
  user:
    exec:
      apiVersion: client.authentication.k8s.io/<vesion>
      args:
      - --region
      - <region>
      - eks
      - get-token
      - --cluster-name
      - <cluster>
      command: aws
      env:
      - name: AWS_PROFILE
        value: <profile>
45cali commented 2 years ago

https://github.com/codefresh-io/steps/pull/446 can this get reviewed please.

kostis-codefresh commented 1 year ago

You should be able to run a step with aws-cli just before the Helm step.

  ChangeContext:
    title: Change K8s context
    image: 'amazon/aws-cli:2.11.23'
    commands:
      - aws eks --region <region> update-kubeconfig --name <cluster name> --alias <friendly name>
   YourHelmStep:
    [....]