-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[connection]: Unable to access kind cluster inside a custom Github Action #1619
Comments
glancing at this, the second to last step looks suspect. |
@BenTheElder Thanks for a quick response The last step is actually running this script |
I see, the set-env is some GitHub actions magic. stomping kubeconfig like that seems less than desirable, but I don't see a bug in it, skimming your script. I would still suspect a big with this, especially if kubectl get nodes worked in the previous step. there are community supported GitHub actions for kind BTW. |
Ah... Github action community would be a better place for this. Okay one thing for using this cluster in a separate environment, the kubeconfig will be enough or should I change anything else? like IP of apiserver or listeningaddress? |
I don't know, that depends on implementation details of the GitHub actions environment. |
Github Actions Ubuntu images come pre-installed with kind. You can find it out here or send a pr if you want to update it. https://github.com/actions/virtual-environments/search?q=kind&unscoped_q=kind If you want a specific version of kind, use https://github.com/engineerd/setup-kind wihtout any issues. This works flawlessly. |
Thanks, @aledbf, and @tamalsaha that's cool to know that the ubuntu image itself contains kind. But I'm facing issues in my custom action uditgaurav/[email protected], So when I'm using this action it takes me to a different environment i.e my docker environment used for this action and now I'm not using ubuntu-latest. |
Taking a second look: does this last action run in a container? Localhost / the loopback interface is unique to each container. 127.0.0.1 is local to each container... You can use kind export kubeconfig --internal on 0.7, on 0.8+ you'd either need this step to run on the kind network somehow (not sure if this is possible with GitHub actions), or else maybe #1558 |
Thanks @BenTheElder So, I passed this to action and now it seems to be running fine for me.
|
I forgot we only have "kind get kubeconfig --internal >$HOME/.kube/config"
This may be an issue on 0.8+ ... I'm not sure if github exposes what docker
network they use for actions or any way to configure it. it looks like no
and no.
…On Wed, May 27, 2020 at 1:53 PM UDIT GAURAV ***@***.***> wrote:
My kind version is 0.7
kind export kubeconfig --internal gives ERROR: unknown flag: --internal
maybe I'm missing some parameter?
So, I passed this to action and now it seems to be running fine for me.
- name: Export kubeconfig
run: |
kind get kubeconfig --name "kind" --internal | sed "s/kind-control-plane/$(docker inspect "kind-control-plane" --format "{{ .NetworkSettings.Networks.kind.IPAddress }}")/g" > config
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1619 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHADK3BS4Q5BGCH4YRHVODRTV4SRANCNFSM4NISAQSQ>
.
|
Ok, So now after using |
awesome thanks! I'd like to figure out 0.8+, but we can revisit that later :-) |
Hi @BenTheElder, It looks like now with kind kind get kubeconfig --name "kind" --internal | sed "s/kind-control-plane/$(docker inspect "kind-control-plane" --format "{{ .NetworkSettings.Networks.kind.IPAddress }}")/g" > config But it also gives when ran with actions (inside a container): Unable to connect to the server: dial tcp 172.18.0.5:6443: i/o timeout $kubectl cluster-info --context kind-kind
Kubernetes control plane is running at https://172.18.0.5:6443
CoreDNS is running at https://172.18.0.5:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy Do we have any solution for version 0.8+? |
we run kind in github actions and don't do anything special at all. |
Thanks for a quick response. |
you need to make sure that container is on or attached to the we have some mention of the network in the release notes for v0.8 |
like, basically this is just docker networking, kind can't do anything here. if you run containers on a different network and don't connect them docker intentionally isolates them. you can connect them either by changing the container network when creating it or using the loopback address is only reachable from host networking because linux. |
What is happening?
kubectl get nodes
Workflow-yaml
The text was updated successfully, but these errors were encountered: