Closed erran closed 3 years ago
Closing since I figured out how to add a simple step to accomplish my goal: https://github.com/WyriHaximus/github-action-helm3/issues/18#issuecomment-698582423
- name: Generate kubeconfig
id: generate-kubeconfig
run: |-
aws eks --region ${{ env.AWS_REGION }} update-kubeconfig --name ${{ env.CLUSTER_NAME }}
KUBECONFIG="$(cat ~/.kube/config)"
KUBECONFIG="${KUBECONFIG//'%'/'%25'}"
KUBECONFIG="${KUBECONFIG//$'\n'/'%0A'}"
KUBECONFIG="${KUBECONFIG//$'\r'/'%0D'}"
echo "::set-output name=kubeconfig::$KUBECONFIG"
Since similar to how it is described in that issue this is a docker action I'll close this out since access could be tricky. 😄
Hello @erran, this is actually great stuff! I hadn't thought of that at all to be honest, but it seems like a great option to have. Do you think contributing docs in this action for this would be useful for other users too? If yes, feel free to send in a PR and we can discuss further if "internal" support for this would make more sense in the future!
Thanks for the great idea once again!
I’d be happy to contribute a docs update around this and I’ll make sure to include how I was able to use the output with this action. 😃
Dropping this as a note to myself/others for tracking — I also found https://github.com/actions-hub/gcloud/issues/11 when I got an error from this action base64: truncated base64 input
. My above snippet will need to be updated to base64 encode the output.
Sorry for not updating anyone sooner. In my use case I ended up using the built-in helm
binary instead of this action due to issues using the KUBECONFIG environment variable regardless of what I tried with base64 decoding/replacing newlines.
👋🏽 Hey @koslib what are your thoughts on leveraging update-kubeconfig as per Amazon's Create kubeconfig documentation? I'd be happy to contribute if it's something you're interested in.
We'd be able to optionally use this over
KUBE_CONFIG_DATA
using a few new arguments underwith:
like so:cluster_name
which is passed into the update-kubeconfig command's--name
argument.update_kubeconfig_path
which if supplied is passed into the update-kubeconfig command's--kubeconfig
argument.