abiosoft / abiosoft/colima

Can colima with k3s and a nginx-ingress point to locally hosted service?

未關閉
#653 8 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Go
星號
30.8k
分支
613
PR 合併指標
30 天內沒有已合併 PR

描述

### Description

Deploy colima with kubernetes enabled, I then normally would deploy a service as a POD, expose the service via ingress using nginx-ingress. This works well.

Now the problem/question I am trying to solve is having my ingress point to a service that is external running on my localhost.

Example:

The service I create runs on lets say port `8080` and what I want to do is run it on my local host on port `8080` and code/debug locally - not running the service in a pod; but ideally still being able to access this via the ingress URL - example: `demo.example.com` which should then direct to my service on `localhost` port `8080`.

But I get "Bad Gateway" as my ingress cannot get to the correct destination.
And what seem to happen is the traffic is hitting the ingress External-IP - 192.168.106.10 on port 8080, but this will not work as it will not get to my local host.

```
$ kubectl get service ingress-nginx-controller --namespace=ingress-nginx
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
ingress-nginx-controller LoadBalancer 10.43.254.45 192.168.106.10 80:31912/TCP,443:30173/TCP 23h
```

Environment is on Apple Mac M1 using Colima 0.5.4 with command below to create the environment:

```
colima --profile local-demo start \
--cpu 6 \
--memory 8 \
--disk 20 \
--with-kubernetes \
--kubernetes-disable="traefik" \
--kubernetes-version="v1.24.3+k3s1" \
--network-address \
--ssh-agent \
--mount-type 9p
```

```
$ colima list
PROFILE STATUS ARCH CPUS MEMORY DISK RUNTIME ADDRESS
local-demo Running aarch64 6 8GiB 20GiB docker+k3s 192.168.106.10
```

Is this possible with colima with kubernetes? Is tunnels needed like what is required in minikube with "minikube tunnel" etc?

I will work on creating a basic example to post as my current one is getting complex, but wanted to confirm if this is even possible. Any pointers much appreciated.

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。