Description
OpenFaaS fails to start in Kubernetes clusters whose base domain is not cluster.local
, e.g. cluster2.local
.
Expected Behaviour
OpenFaaS should deploy successfully to Kubernetes cluster when kubernetesDNSDomain
is set to cluster2.local
(i.e. not cluster.local
).
Current Behaviour
OpenFaaS is not deployed successfully.
The first sign is that faas-idler
enters CrashLoopBackoff
state and does not recover.
Other issues arise later on (accessing the GW and so forth), but it's all related to the irregular base domain.
Possible Solution
Use kubernetesDNSDomain
in all service references within chart templates.
I've made a few modifications in my branch in a fork which I believe should fix the issue, but they may collide with other features which I haven't tested. I can open a Pull Request if required.
Steps to Reproduce (for bugs)
k3d cluster create mycluster
kubectl edit configmap -n kube-system coredns
-
+ kubernetes cluster2.local in-addr.arpa ip6.arpa { - kubernetes cluster.local in-addr.arpa ip6.arpa {
kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
helm repo add openfaas https://openfaas.github.io/faas-netes/
-
helm repo update \ && helm upgrade openfaas --install openfaas/openfaas \ --namespace openfaas \ --set functionNamespace=openfaas-fn \ --set generateBasicAuth=true \ --set kubernetesDNSDomain=cluster2.local
-
$ kubectl -n openfaas get pods NAME READY STATUS RESTARTS AGE nats-7d86c64647-kv879 1/1 Running 0 3m23s queue-worker-596c8949d4-pqnwz 1/1 Running 0 3m23s basic-auth-plugin-bc899c574-bzk7s 1/1 Running 0 3m23s alertmanager-5475697f88-smfwb 1/1 Running 0 3m23s prometheus-697d845647-nhjnw 1/1 Running 0 3m23s faas-idler-57bd579645-cql2r 0/1 CrashLoopBackOff 4 3m23s gateway-7bf8dd5cd7-8mjlx 2/2 Running 0 3m23s
-
$ kubectl -n openfaas logs faas-idler-57bd579645-cql2r 2020/12/02 04:20:00 cannot connect to OpenFaaS on URL: http://gateway.openfaas:8080 panic: interface conversion: interface {} is nil, not map[string]interface {} goroutine 1 [running]: main.main() /go/src/github.com/openfaas-incubator/faas-idler/main.go:104 +0xa51
Context
Attempting to deploy OpenFaaS using Helm to a Kubernetes cluster whose base domain is not cluster.local
.
Your Environment
- k3d version:
k3d version v3.3.0
k3s version v1.19.3-k3s3 (default)
- FaaS-CLI version ( Full output from:
faas-cli version
):
___ _____ ____
/ _ \ _ __ ___ _ __ | ___|_ _ __ _/ ___|
| | | | '_ \ / _ \ '_ \| |_ / _` |/ _` \___ \
| |_| | |_) | __/ | | | _| (_| | (_| |___) |
\___/| .__/ \___|_| |_|_| \__,_|\__,_|____/
|_|
CLI:
commit: 35ac0cefa5116ecdeed838726f11d8f99eefdc9d
version: 0.12.14-2-g35ac0ce
Your faas-cli version (0.12.14-2-g35ac0ce) may be out of date. Version: 0.12.19 is now available on GitHub.
- Docker version
docker version
(e.g. Docker 17.0.05 ):
Client:
Version: 19.03.13-ce
API version: 1.40
Go version: go1.15.2
Git commit: 4484c46d9d
Built: Sat Sep 26 12:04:46 2020
OS/Arch: linux/amd64
Experimental: false
Server:
Engine:
Version: 19.03.13-ce
API version: 1.40 (minimum version 1.12)
Go version: go1.15.2
Git commit: 4484c46d9d
Built: Sat Sep 26 12:03:35 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.4.3
GitCommit: 269548fa27e0089a8b8278fc4fc781d7f65a939b.m
runc:
Version: 1.0.0-rc92
GitCommit: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
docker-init:
Version: 0.18.0
GitCommit: fec3683
- What version and distriubtion of Kubernetes are you using?
kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.4", GitCommit:"d360454c9bcd1634cf4cc52d1867af5491dc9c5f", GitTreeState:"archive", BuildDate:"2020-11-25T13:19:56Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3+k3s3", GitCommit:"0e4fbfefe1dd8734756dfa4f9ab4fc89665cece4", GitTreeState:"clean", BuildDate:"2020-11-13T07:19:02Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}
- Operating System and version (e.g. Linux, Windows, MacOS):
Arch Linux
Kernel 5.9