not able to start aerokube moon on linux (ubuntu) - aerokube-moon

I am trying to setup aerokube moon on a linux machine(Ubuntu 16.04) .
Steps followed :
minikube installed and ingress is enabled.
moon installed using https://aerokube.com/moon/latest/#install-helm .
started minikube using docker driver
$ minikube status
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured
kubectl get pods -n moon
NAME READY STATUS RESTARTS AGE
moon-5f6fd5f9fd-7b945 3/3 Running 0 10m
moon-5f6fd5f9fd-fcct6 3/3 Running 0 10m
$minikube tunnel
Status:
machine: minikube
pid: 148130
route: 10.96.0.0/12 -> xxx.xxx.xx.x
minikube: Running
services: []
errors:
minikube: no errors
router: no errors
loadbalancer emulator: no errors
$
cat /etc/hosts
127.0.0.1 localhost moon.aerokube.local
xxx.xxx.xxx.xxx moon.aerokube.local --> this ip is output of `$minikube ip`
Issue 1 : when I try to access http://moon.aerokube.local/ .I get
Issue2 how to change the default port for selenium
I would like to change the default port for selenium in moon as my 8080 and 4444 port are already occupied.
I would like to use some other port for moon ui and /wd/hub
I assume ,this probably will be accessible from that linux machine itself(I can't check directly on that machine) as it is pointed to localhost in /etc/host. but I dont know how to make it accessible from other places (facing issues no 2 mentioned in this post) like from our laptops for people working on this project .
Please help

Related

how to enable port forward with micrpk8s

I'm playing around with microk8s and I simply want to run an apache server and navigate to its default page on the same machine. I'm on a mac arm m1:
microk8s kubectl run test-pod --image=ubuntu/apache2:2.4-20.04_beta --port=80
~ $ microk8s kubectl get pods 2
NAME READY STATUS RESTARTS AGE
test-pod 1/1 Running 0 8m43s
then I try to enable the forward:
◼ ~ $ microk8s kubectl port-forward test-pod :80
Forwarding from 127.0.0.1:37551 -> 80
but:
◼ ~ $ wget http://localhost:37551
--2022-12-24 18:54:37-- http://localhost:37551/
Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:8080... failed: Connection refused.
Connecting to localhost (localhost)|::1|:8080... failed: Connection refused.
the logs looks ok:
◼ ~ $ microk8s kubectl logs test-pod 130
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.1.254.96. Set the 'ServerName' directive globally to suppress this message
dashboard proxy does work fine and I can navigate to it:
◼ ~ $ microk8s dashboard-proxy
Checking if Dashboard is running.
Dashboard will be available at https://192.168.64.2:10443
Answering myself:
I should use the Multipass' guest machine assigned IP. This is not docker :)
For some reason I haven't figured out, as asked here, the forwarding from the guest does not work properly on mac. I should open a guest's shell and forward from there. that way, it will work. See the answer on the linked post.
Hope this will spare some time on future mac users.

Multipass VM not reachable via specific http ports from host

I'm running an Ubuntu VM with multipass hyperkit do run microk8s. Within the VM all things checkout and available with skaffold/kubectl port forwarding. For instance:
$ multipass list
Name State IPv4 Image
microk8s-vm Running 192.168.64.2 Ubuntu 20.04 LTS
10.0.1.1
172.17.0.1
10.1.254.64
Port forwarding service/my-app in namespace default, remote port 80 -> 127.0.0.1:4503
Within the VM:curl localhost:4503 ✅
From the host: curl 192.168.64.2:4503🛑
I know the VM is reachable on port 80 because curl 192.168.64.2 returns default ngnix not found page. FWIW I never installed ngnix and the service doesn't seem to be running /cannot turn it off.
I've been at this for a day and I'm stumped. I even tried the Vbox driver and manually configured a bridge adapter. I even created my own adapter...
$ multipass exec -- microk8s-vm sudo bash -c "cat > /etc/netplan/60-bridge.yaml" <<EOF
network:
ethernets:
enp0s8: # this is the interface name from above
dhcp4: true
dhcp4-overrides: # this is needed so the default gateway
route-metric: 200 # remains with the first interface
version: 2
EOF
$ multipass exec microk8s-vm sudo netplan apply
How can I reach this VM from the host?
You cant access your pod ip /portlike this.
If you want to access your pods port over the nodes ip address, you need to define a service type NodePort and then use ipaddressOfNode:NodePort.
curl http://ipaddressOfNode:NodePort
With port-forward you must use the localhost of your host system.
kubectl port-forward svc/myservice 8000:yourServicePort
then
curl http://localhost:8000

No services for minikube windows "No connection could be made because the target machine actively refused it."

I have installed minikube via chocolatey on my windows 10 machine
I am using virtualbox for the VM
I have done minikube start and it is successful
Sporadically minikube status says that everything is running.
Usually, after I have started, the cluster is stopped.
I have disconnected from the VPN, restarted the computer, disconnected and reconnected to the internet, upgraded dropbox.
minikube service list returns either:
Get https://10.100.99.100:8443/api/v1/services: dial tcp 10.100.99.100:8443: connectex: No connection could be made because the target machine actively refused it.
Check that minikube is running and that you have specified the correct namespace (-n flag) if required.
Or
|-----------|------------|--------------|
| NAMESPACE | NAME | URL |
|-----------|------------|--------------|
| default | kubernetes | No node port |
|-----------|------------|--------------|
I have started with multiple different commands:
minikube start --vm-driver "virtualbox" --memory 8192 --disk-size 40g --host-only-cidr "10.100.99.1/24" being the most recent.
I have deleted and removed all machine files and then used the start command again to recreate the machine.
I have updated my config.json file to ensure that all slashes are "windows" slashes
I am completely at a loss for how to get this thing running.
I got this error after my setup was running fine and I had to restart my Windows 7 machine.
Is your docker VM running as expected?
If not, $docker-machine stop default
Followed by $docker-machine start default
minikube start --docker-env HTTP_PROXY=http://$YOURPROXY:PORT \ --docker-env HTTPS_PROXY=https://$YOURPROXY:PORT
Figure out if you are being blocked by a corporate proxy: https://superuser.com/questions/346372/how-do-i-know-what-proxy-server-im-using
The method using Chrome is the easiest

Can't access docker container on port 80 on OSX

In my current job we have development environment made with docker-compose.
One container is nginx, which provide routing to other containers.
Everything seems fine and work to my colleague on windows and osx. But on my system (osx El Capitan), there is problem with accessing nginx container on port 80.
There is setup of container from docker-compose.yml
nginx:
build: ./dockerbuild/nginx
ports:
- 80:80
links:
- php
volumes_from:
- app
... and more
In ./dockerbuild/nginx there is nothing special, just nginx config as we know it from everywhere.
When I run everyting with docker-compose create and docker-compose start. Then docker ps give me
3b296c1e4775 docker_nginx "nginx -g 'daemon off" About an hour ago Up 47 minutes 0.0.0.0:80->80/tcp, 443/tcp docker_nginx_1
But when I try to access it for example via curl I get error. curl: (7) Failed to connect to localhost port 80: Connection refused
I try to run container with port 81 and everything works fine.
Port is really binded to docker
22:47 $ sudo lsof -i -n -P | grep TCP
...
com.docke 14718 schovi 38u IPv4 0x6e9c93c51ec4b617 0t0 TCP *:80 (LISTEN)
...
Firewall in osx is turned off and I have no other security.
if you are using docker-for-mac:
Accessing by localhost:80 is correct, though you still have to ensure you do not have a local apache/nginx service running. Often leftovers from boxen/homebrew exist binding that port, because thats what developers did back then :)
if you are using dockertoolbox/virtualbox/whatever hypervisor
You will not be able to access it by localhost, by by the docker-machine ip, so write docker-machine ip default and the use http://$ip:80 in your browser
if that does not help
Ensure your nginx container actually does work, so connect to the container: docker exec -i -t <containerid> bash
and then run ps aux nginx or if telnet is installed try to connect to localhost
Solved!
Problem was, that long long time ago I installed pow (super simple automated rails server which run application on app_name.local domain). And this beast left LaunchAgent script which update pf to forward port 80 to pow port.
In my current job we have development environment made with docker-compose.
A privilege to use.
[W]hen I try to access [nginx on port 80] for example via curl I get error.
Given there's nothing from causing you from accessing docker on your host os you should look at the app running inside the container to ensure it's binding to the correct host, e.g. 0.0.0.0 and not localhost.
For example, if you're running Nuxt inside a container with nuxt-ts observe Nuxt will default to localhost thereby causing the container not to connect to the docker network whereas npx nuxt-ts -H 0.0.0.0 gets things squared away with the container's internal server connecting to the ip of the docker network used (verify ip like docker container inspect d8af01990363).

Cannot browse dockerized web app from other computers on network

I would like any computer on the same network as my Mac to be able to access the dockerized Rails web app running on my Mac.
On my Mac (10.9.5) my Rails 4.2.4 web app is running fine in Docker when I access it via the docker ip and the port I assigned, 192.168.99.100:3000
Docker 1.8.1 is running under Virtualbox 5.0.2.
I'm using Docker-compose and the relevant part of the docker-compose.yml file is:
web:
build: .
command: 'bash -c ''bundle exec unicorn -p $PORT -c ./config/unicorn-local.rb'''
working_dir: /app/user
env_file:
- .docker_dev_env_config
- .docker_dev_env_personal
environment:
PORT: 3000
DATABASE_URL: 'postgres://postgres:#herokuPostgresql:5432/postgres'
ports:
- '3000:3000'
links:
- herokuPostgresql
and my Dockerfile is
FROM heroku-ruby2.0.0 # a local image based on heroku/ruby with ruby 2.0.0
EXPOSE 3000
ENV widget foo
My Mac's ip address on the local network is always set to 192.168.0.33.
How do I permit testers on the local network to access the running dockerized app via 192.168.0.33:3000 ?
(FWIW if I run my web app under Vagrant - instead of Docker - other testers on the network can access the web app by browsing 192.168.0.33:3000. My Vagrant is also running under Virtualbox. My Vagrantfile contains config.vm.network :forwarded_port, guest: 3000, host: 3000 but I do not see any equivalent for docker-compose.yml)
You need to port forward the port 3000 from the VM to your localhost. For this you can run the following script
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$3000,tcp,,$3000,,$3000";
VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$3000,udp,,$3000,,$3000";
This will port forward to your localhost. In case you want to port forward to some other interface, you have to provide that interface's IP address in the command. This is the general syntax for the --natpf command
[--natpf<1-N> [<rulename>],tcp|udp,[<hostip>],<hostport>,[<guestip>],<guestport>]
So you can modify it accordingly.
Refer to this for further reading. Docker on Mac. The Missing Guide
The 'default' Virtualbox created when using docker-toolkit's Docker Quickstart Terminal app does not have any port other than an ssh defined.
The solution on the Mac, when using VirtualBox with Docker is:
Run VirtualBox
click the 'default' box (or whichever box your Docker setup uses)
go to 'Settings > Network > Adapter 1
click 'Port Forwarding'
create a new rule the example below fwds 3000 to 3000
(be sure to leave the host ip column blank)

Resources