kontena / pharos-cluster

Pharos - The Kubernetes Distribution
https://k8spharos.dev/
Apache License 2.0
311 stars 43 forks source link

GET /apis/openebs.io/v1alpha1 => HTTP 404 Not Found: 404 page not found #523

Closed jakolehm closed 6 years ago

jakolehm commented 6 years ago

1.3.0-beta.2 fails to install OpenEBS addon.

SpComb commented 6 years ago

This is because the stack itself includes some CRD resources, but those CRDs are not loaded yet, so the attempt to map the CRD kind => the resources URL to check if they need to be created or updated fails:

GET /apis/certmanager.k8s.io/v1alpha1 => HTTP 404 Not Found: 404 page not found
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/transport.rb:171:in `parse_response'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/transport.rb:215:in `block in requests'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/transport.rb:213:in `map'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/transport.rb:213:in `requests'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/transport.rb:254:in `gets'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/client.rb:72:in `apis'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/client.rb:123:in `get_resources'
/usr/local/bundle/gems/k8s-client-0.3.0/lib/k8s/stack.rb:72:in `apply'
/app/lib/pharos/addon.rb:205:in `apply_resources'
/app/lib/pharos/addon.rb:171:in `apply_install'
/app/lib/pharos/addon.rb:157:in `apply'
/app/lib/pharos/cluster_manager.rb:126:in `block in apply_addons'
/app/lib/pharos/addon_manager.rb:74:in `block in each'
/app/lib/pharos/addon_manager.rb:86:in `block in with_enabled_addons'
/app/lib/pharos/addon_manager.rb:83:in `each'
/app/lib/pharos/addon_manager.rb:83:in `with_enabled_addons'
/app/lib/pharos/addon_manager.rb:70:in `each'
/app/lib/pharos/cluster_manager.rb:123:in `apply_addons'
/app/lib/pharos/up_command.rb:107:in `configure'
/app/lib/pharos/up_command.rb:44:in `block in execute'
/app/lib/pharos/up_command.rb:43:in `chdir'
/app/lib/pharos/up_command.rb:43:in `execute'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/command.rb:63:in `run'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/command.rb:63:in `run'
/usr/local/bundle/gems/clamp-1.2.1/lib/clamp/command.rb:132:in `run'
/app/lib/pharos/root_command.rb:16:in `run'
bin/pharos-cluster:12:in `<main>'
SpComb commented 6 years ago

Testing with https://github.com/kontena/k8s-client/pull/14, it now handles the GET /apis/certmanager.k8s.io/v1alpha1] => HTTP [404] and skips the list requests for the custom resource types.

Note that the GET /apis/certmanager.k8s.io/v1alpha1 => HTTP 200 still happens once it needs to actually create the custom resources. That request would still explode if the resources were not defined yet.

==> Enabling addon cert-manager
I, [2018-08-13T09:34:07.790367 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: [GET /apis/certmanager.k8s.io/v1alpha1] => HTTP [404] in 0.045s
I, [2018-08-13T09:34:07.906055 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: [GET /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/certificates.certmanager.k8s.io, GET /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/clusterissuers.certmanager.k8s.io, GET /apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/cert-manager, GET /apis/rbac.authorization.k8s.io/v1beta1/clusterroles/cert-manager, GET /apis/extensions/v1beta1/namespaces/kube-system/deployments/cert-manager, GET /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/issuers.certmanager.k8s.io, GET /api/v1/namespaces/kube-system/serviceaccounts/cert-manager] => HTTP [404, 404, 404, 404, 404, 404, 404] in 0.106s
I, [2018-08-13T09:34:07.906904 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource apiextensions.k8s.io/v1beta1:CustomResourceDefinition/certificates.certmanager.k8s.io in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:07.966031 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.057s
I, [2018-08-13T09:34:07.967707 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource apiextensions.k8s.io/v1beta1:CustomResourceDefinition/clusterissuers.certmanager.k8s.io in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.024874 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.054s
I, [2018-08-13T09:34:08.025791 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource rbac.authorization.k8s.io/v1beta1:ClusterRoleBinding/cert-manager in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.076916 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.049s
I, [2018-08-13T09:34:08.077132 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource rbac.authorization.k8s.io/v1beta1:ClusterRole/cert-manager in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.131021 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/rbac.authorization.k8s.io/v1beta1/clusterroles <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.052s
I, [2018-08-13T09:34:08.132521 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource extensions/v1beta1:Deployment/cert-manager in namespace kube-system with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.189191 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/extensions/v1beta1/namespaces/kube-system/deployments <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.053s
I, [2018-08-13T09:34:08.190253 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource apiextensions.k8s.io/v1beta1:CustomResourceDefinition/issuers.certmanager.k8s.io in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.248855 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.055s
I, [2018-08-13T09:34:08.250164 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource certmanager.k8s.io/v1alpha1:Issuer/letsencrypt in namespace default with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.301880 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: GET /apis/certmanager.k8s.io/v1alpha1 => HTTP 200: <K8s::API::MetaV1::APIResourceList> in 0.050s
I, [2018-08-13T09:34:08.377105 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /apis/certmanager.k8s.io/v1alpha1/namespaces/default/issuers <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.075s
I, [2018-08-13T09:34:08.377394 #1]  INFO -- Pharos::Kube::Stack<cert-manager>: Create resource v1:ServiceAccount/cert-manager in namespace kube-system with checksum=2abb8acc77447c95f0dda7450d84d1a8
I, [2018-08-13T09:34:08.504574 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: POST /api/v1/namespaces/kube-system/serviceaccounts <K8s::Resource> => HTTP 201: <K8s::Resource> in 0.126s
W, [2018-08-13T09:34:08.953178 #1]  WARN -- K8s::Transport<https://167.99.39.233:6443>: Retry GET /apis/metrics.k8s.io/v1beta1/nodes => HTTP 503 Service Unavailable: Error: 'context canceled'
Trying to reach: 'https://10.250.163.130:443/apis/metrics.k8s.io/v1beta1/nodes?labelSelector=pharos.kontena.io%2Fstack%3Dcert-manager' in 0.429s
I, [2018-08-13T09:34:09.179792 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: GET /apis/metrics.k8s.io/v1beta1/nodes?labelSelector=pharos.kontena.io%2Fstack%3Dcert-manager => HTTP 200: <K8s::API::MetaV1::List> in 0.225s
I, [2018-08-13T09:34:09.181723 #1]  INFO -- K8s::Transport<https://167.99.39.233:6443>: [GET /api/v1/componentstatuses, GET /api/v1/configmaps, GET /api/v1/endpoints, GET /api/v1/events, GET /api/v1/limitranges, GET /api/v1/namespaces, GET /api/v1/nodes, GET /api/v1/persistentvolumeclaims, GET /api/v1/persistentvolumes, GET /api/v1/pods, GET /api/v1/podtemplates, GET /api/v1/replicationcontrollers, GET /api/v1/resourcequotas, GET /api/v1/secrets, GET /api/v1/serviceaccounts, GET /api/v1/services, GET /apis/apiregistration.k8s.io/v1/apiservices, GET /apis/extensions/v1beta1/daemonsets, GET /apis/extensions/v1beta1/deployments, GET /apis/extensions/v1beta1/ingresses, GET /apis/extensions/v1beta1/networkpolicies, GET /apis/extensions/v1beta1/podsecuritypolicies, GET /apis/extensions/v1beta1/replicasets, GET /apis/apps/v1/controllerrevisions, GET /apis/apps/v1/daemonsets, GET /apis/apps/v1/deployments, GET /apis/apps/v1/replicasets, GET /apis/apps/v1/statefulsets, GET /apis/events.k8s.io/v1beta1/events, GET /apis/autoscaling/v1/horizontalpodautoscalers, GET /apis/batch/v1/jobs, GET /apis/certificates.k8s.io/v1beta1/certificatesigningrequests, GET /apis/networking.k8s.io/v1/networkpolicies, GET /apis/policy/v1beta1/poddisruptionbudgets, GET /apis/policy/v1beta1/podsecuritypolicies, GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings, GET /apis/rbac.authorization.k8s.io/v1/clusterroles, GET /apis/rbac.authorization.k8s.io/v1/rolebindings, GET /apis/rbac.authorization.k8s.io/v1/roles, GET /apis/storage.k8s.io/v1/storageclasses, GET /apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations, GET /apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations, GET /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions, GET /apis/scheduling.k8s.io/v1beta1/priorityclasses, GET /apis/crd.projectcalico.org/v1/hostendpoints, GET /apis/crd.projectcalico.org/v1/ippools, GET /apis/crd.projectcalico.org/v1/clusterinformations, GET /apis/crd.projectcalico.org/v1/networkpolicies, GET /apis/crd.projectcalico.org/v1/bgpconfigurations, GET /apis/crd.projectcalico.org/v1/bgppeers, GET /apis/crd.projectcalico.org/v1/felixconfigurations, GET /apis/crd.projectcalico.org/v1/globalnetworkpolicies, GET /apis/crd.projectcalico.org/v1/globalnetworksets, GET /apis/metrics.k8s.io/v1beta1/nodes, GET /apis/metrics.k8s.io/v1beta1/pods] => HTTP [200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 503, 200] in 0.429s
D, [2018-08-13T09:34:09.188417 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource v1:ServiceAccount/cert-manager in namespace kube-system with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.189501 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource extensions/v1beta1:Deployment/cert-manager in namespace kube-system with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.190553 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource apps/v1:Deployment/cert-manager in namespace kube-system with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.191504 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource rbac.authorization.k8s.io/v1:ClusterRoleBinding/cert-manager in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.192420 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource rbac.authorization.k8s.io/v1:ClusterRole/cert-manager in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.193390 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource apiextensions.k8s.io/v1beta1:CustomResourceDefinition/certificates.certmanager.k8s.io in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.194344 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource apiextensions.k8s.io/v1beta1:CustomResourceDefinition/clusterissuers.certmanager.k8s.io in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8
D, [2018-08-13T09:34:09.195474 #1] DEBUG -- Pharos::Kube::Stack<cert-manager>: List resource apiextensions.k8s.io/v1beta1:CustomResourceDefinition/issuers.certmanager.k8s.io in namespace  with checksum=2abb8acc77447c95f0dda7450d84d1a8