Skip to content

bug: failed to run the tutorial sample and setup minikube as CI step in Github actions #13595

@HarikrishnanBalagopal

Description

@HarikrishnanBalagopal

Problem

Following the sample workflow in the documentation https://minikube.sigs.k8s.io/docs/tutorials/setup_minikube_in_github_actions/
does not work as expected. The curl on the service url fails to connect.

Code

https://github.com/HarikrishnanBalagopal/test-github-actions-2/blob/main/.github/workflows/sample.yaml

Expected Output

Expected the curl to succeed with 200 OK. Building and running the image locally:

$ docker build -f ./Dockerfile -t local/example .
[+] Building 0.2s (5/5) FINISHED                                                                                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 101B                                                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/python:latest                                                                                                                                                                                         0.0s
 => [1/1] FROM docker.io/library/python                                                                                                                                                                                                                  0.1s
 => exporting to image                                                                                                                                                                                                                                   0.0s
 => => exporting layers                                                                                                                                                                                                                                  0.0s
 => => writing image sha256:c02208d0a1249bc450852de63f209d8558d12f2697a9fbb571c420bb8d61678b                                                                                                                                                             0.0s
 => => naming to docker.io/local/example                                                                                                                                                                                                                 0.0s

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
$ docker run --rm -it -p 8080:8080 local/example
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
172.17.0.1 - - [10/Feb/2022 04:43:02] "GET / HTTP/1.1" 200 -

In another terminal

$ curl localhost:8080
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Directory listing for /</title>
</head>
<body>
<h1>Directory listing for /</h1>
<hr>
<ul>
<li><a href=".dockerenv">.dockerenv</a></li>
<li><a href="bin/">bin/</a></li>
<li><a href="boot/">boot/</a></li>
<li><a href="dev/">dev/</a></li>
<li><a href="etc/">etc/</a></li>
<li><a href="home/">home/</a></li>
<li><a href="lib/">lib/</a></li>
<li><a href="lib64/">lib64/</a></li>
<li><a href="media/">media/</a></li>
<li><a href="mnt/">mnt/</a></li>
<li><a href="opt/">opt/</a></li>
<li><a href="proc/">proc/</a></li>
<li><a href="root/">root/</a></li>
<li><a href="run/">run/</a></li>
<li><a href="sbin/">sbin/</a></li>
<li><a href="srv/">srv/</a></li>
<li><a href="sys/">sys/</a></li>
<li><a href="tmp/">tmp/</a></li>
<li><a href="usr/">usr/</a></li>
<li><a href="var/">var/</a></li>
</ul>
<hr>
</body>
</html>

Actual Output

https://github.com/HarikrishnanBalagopal/test-github-actions-2/runs/5135942372?check_suite_focus=true#step:7:22

Run minikube service list
  minikube service list
  minikube service example --url
  echo "------------------opening the service------------------"
  curl $(minikube service example --url)        
  shell: /usr/bin/bash -e {0}
|-------------|------------|--------------|---------------------------|
|  NAMESPACE  |    NAME    | TARGET PORT  |            URL            |
|-------------|------------|--------------|---------------------------|
| default     | example    |         8080 | http://19[2](https://github.com/HarikrishnanBalagopal/test-github-actions-2/runs/5135942372?check_suite_focus=true#step:7:2).168.49.2:[3](https://github.com/HarikrishnanBalagopal/test-github-actions-2/runs/5135942372?check_suite_focus=true#step:7:3)2117 |
| default     | kubernetes | No node port |
| kube-system | kube-dns   | No node port |
|-------------|------------|--------------|---------------------------|
http://192.168.[4](https://github.com/HarikrishnanBalagopal/test-github-actions-2/runs/5135942372?check_suite_focus=true#step:7:4)9.2:32117
------------------opening the service------------------
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to 192.1[6](https://github.com/HarikrishnanBalagopal/test-github-actions-2/runs/5135942372?check_suite_focus=true#step:7:6)8.49.2 port 3211[7](https://github.com/HarikrishnanBalagopal/test-github-actions-2/runs/5135942372?check_suite_focus=true#step:7:7): Connection refused
Error: Process completed with exit code 7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage/needs-informationIndicates an issue needs more information in order to work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions