Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

apiservice v1alpha1.tenancy.kiosk.sh is unready even though kiosk is running #88

Closed
iliyahoo opened this issue Sep 20, 2020 · 16 comments
Closed

Comments

@iliyahoo
Copy link

I'm getting an error on the kiosk pod:

controller.go:498] unable to retrieve the complete list of server APIs: tenancy.kiosk.sh/v1alpha1: the server is currently unable to handle the request

Helm chart: kiosk-0.1.20
Kubernetes: v1.16.13-gke.1 (GKE)

Please have a look on the attached kiosk pod's log.
kiosk.log

@FabianKramm
Copy link
Member

@iliyahoo thanks for reporting this issue! Does kiosk crash because of this error or is it only displayed in the logs?

@iliyahoo
Copy link
Author

iliyahoo commented Sep 21, 2020

Pod is running without restarts.
Only this error is displayed in logs.

$ kc get po
NAME READY STATUS RESTARTS AGE
kiosk-746bbcb4b4-mw79n 1/1 Running 0 15h

$ kc get crd | grep kiosk
accountquotas.config.kiosk.sh 2020-09-16T19:40:28Z
accounts.config.kiosk.sh 2020-09-16T19:40:28Z
templateinstances.config.kiosk.sh 2020-09-16T19:40:28Z
templates.config.kiosk.sh 2020-09-16T19:40:28Z

@FabianKramm
Copy link
Member

FabianKramm commented Sep 21, 2020

@iliyahoo ah okay I see! Yes this can occur and shouldn't have any effect on kiosk itself, the problem is that the apiservice v1alpha1.tenancy.kiosk.sh is not ready yet (because kiosk is just starting up), but already registered at the kubernetes api server, it will be ready after kiosk started.

@iliyahoo
Copy link
Author

$ cat <<EOF | kc apply -f -


apiVersion: tenancy.kiosk.sh/v1alpha1
kind: Account
metadata:
name: johns-account
spec:
space:
limit: 2
subjects:

  • kind: User
    name: john
    apiGroup: rbac.authorization.k8s.io
    EOF
    error: unable to recognize "STDIN": no matches for kind "Account" in version "tenancy.kiosk.sh/v1alpha1"

@iliyahoo
Copy link
Author

$ kc api-resources | grep kiosk
accountquotas config.kiosk.sh false AccountQuota
accounts config.kiosk.sh false Account
templateinstances config.kiosk.sh true TemplateInstance
templates config.kiosk.sh false Template
error: unable to retrieve the complete list of server APIs: tenancy.kiosk.sh/v1alpha1: the server is currently unable to handle the request

@FabianKramm
Copy link
Member

FabianKramm commented Sep 21, 2020

@iliyahoo thanks for the information. Does this still occur after:

kubectl delete apiservice v1alpha1.tenancy.kiosk.sh
kubectl delete pods --selector app=kiosk --namespace kiosk

I will add this as a bug, since kiosk could sort this out during startup. The problem is that the apiservice object is not that often updated by kuberentes and could stay in a non ready state.

@FabianKramm FabianKramm changed the title Controller error apiservice v1alpha1.tenancy.kiosk.sh is unready even though kiosk is running Sep 21, 2020
@iliyahoo
Copy link
Author

Yes, it still persists after deleting apiservice and pod.

$ kubectl describe apiservice v1alpha1.tenancy.kiosk.sh
...
Message: failing or missing response from https://10.204.3.20:8443/apis/tenancy.kiosk.sh/v1alpha1: Get https://10.204.3.20:8443/apis/tenancy.kiosk.sh/v1alpha1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Reason: FailedDiscoveryCheck
Status: False
Type: Available
...

@FabianKramm
Copy link
Member

FabianKramm commented Sep 21, 2020

@iliyahoo okay that is really strange, it should definitely work after deleting the apiservice and pod. I just tested it in gke with 1.16.13 and it works for me, even after deleting the deployment and recreating it. Maybe the service for the apiservice is somehow broken, can you do a kubectl get apiservices | grep kiosk.sh? Did you maybe install kiosk in multiple namespaces or did you install loft as well?

@iliyahoo
Copy link
Author

This is a GKE cluster.
Server Version: version.Info{Major:"1", Minor:"16+", GitVersion:"v1.16.13-gke.1", GitCommit:"688c6543aa4b285355723f100302d80431e411cc", GitTreeState:"clean", BuildDate:"2020-07-21T02:37:26Z", GoVersion:"go1.13.9b4", Compiler:"gc", Platform:"linux/amd64"}

@iliyahoo
Copy link
Author

$ kubectl get apiservices | grep kiosk.sh
v1alpha1.config.kiosk.sh Local True 4h17m
v1alpha1.tenancy.kiosk.sh kiosk/kiosk-apiservice False (FailedDiscoveryCheck) 38m

$ kubectl get po --all-namespaces | grep kiosk
kiosk kiosk-746bbcb4b4-5dw4d 1/1 Running 0 40m
]$

@FabianKramm
Copy link
Member

@iliyahoo thanks for the information! Do you have a NetworkPolicy configured or is there any other special configuration in the GKE cluster?

@iliyahoo
Copy link
Author

I'll install a GKE cluster from scratch and retest it again.

@iliyahoo
Copy link
Author

Thank you very much, Fabian !
I've just deployed it on a fresh GKE cluster and there are not any errors.
The issue is definitely on my side.
Thank you again and I'm closing the issue.

@iliyahoo
Copy link
Author

You can reproduce the issue if you create a private GKE cluster.
It works on a public one.

@iliyahoo iliyahoo reopened this Sep 21, 2020
@FabianKramm
Copy link
Member

FabianKramm commented Sep 22, 2020

@iliyahoo thanks for the information! Ah okay, yes that makes sense, the master API server cannot access kiosk, because the api server and cluster are isolated. You'll have to allow this in GKE and create a firewall rule, check elastic/cloud-on-k8s#1437 for a solution. (also see https://cloud.google.com/run/docs/gke/troubleshooting#deployment_to_private_cluster_failure_failed_calling_webhook_error)

@FabianKramm
Copy link
Member

I'm closing this since it is mostly a GKE configuration issue and there is not much we can do in kiosk itself

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants