Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't deploy #109

Open
brandoncc opened this issue Sep 4, 2022 · 3 comments
Open

Can't deploy #109

brandoncc opened this issue Sep 4, 2022 · 3 comments

Comments

@brandoncc
Copy link

brandoncc commented Sep 4, 2022

I absolutely love the idea of Kuby, thanks for giving the Railsconf talk about it.

Unfortunately, I don't know anything about Kubernetes and I'm unable to deploy my first app. I created a new rails app and gave it a working root page. Then I followed the quick start guide and everything works up until the deploy step.

Here is the failed step output when deploying to digital ocean:

[INFO][2022-09-04 13:39:35 -0700]	------------------------------------------Result: FAILURE-------------------------------------------
[FATAL][2022-09-04 13:39:35 -0700]	Command failed: apply -f /var/folders/2d/ybxhkvf55qqf5jp90nm_mxch0000gn/t/d20220904-83925-f2cjjl
[FATAL][2022-09-04 13:39:35 -0700]
[FATAL][2022-09-04 13:39:35 -0700]	WARNING: Any resources not mentioned in the error(s) below were likely created/updated. You may wish to roll back this deploy.
[FATAL][2022-09-04 13:39:35 -0700]
[FATAL][2022-09-04 13:39:35 -0700]	Invalid template: Ingress-kubytest-ingress20220904-83925-c8a9v4.yml
[FATAL][2022-09-04 13:39:35 -0700]	> Error message:
[FATAL][2022-09-04 13:39:35 -0700]	    Error from server (InternalError): error when creating "/var/folders/2d/ybxhkvf55qqf5jp90nm_mxch0000gn/T/d20220904-83925-f2cjjl/Ingress-kubytest-ingress20220904-83925-c8a9v4.yml": Internal error occurred: failed calling webhook "validate.nginx.ingress.kubernetes.io": failed to call webhook: Post "https://ingress-nginx-controller-admission.ingress-nginx.svc:443/networking/v1/ingresses?timeout=10s": EOF
[FATAL][2022-09-04 13:39:35 -0700]	> Template content:
[FATAL][2022-09-04 13:39:35 -0700]	    ---
[FATAL][2022-09-04 13:39:35 -0700]	    apiVersion: networking.k8s.io/v1
[FATAL][2022-09-04 13:39:35 -0700]	    kind: Ingress
[FATAL][2022-09-04 13:39:35 -0700]	    metadata:
[FATAL][2022-09-04 13:39:35 -0700]	      annotations:
[FATAL][2022-09-04 13:39:35 -0700]	        kubernetes.io/ingress.class: nginx
[FATAL][2022-09-04 13:39:35 -0700]	        cert-manager.io/cluster-issuer: letsencrypt-production
[FATAL][2022-09-04 13:39:35 -0700]	      name: kubytest-ingress
[FATAL][2022-09-04 13:39:35 -0700]	      namespace: kubytest-production
[FATAL][2022-09-04 13:39:35 -0700]	    spec:
[FATAL][2022-09-04 13:39:35 -0700]	      rules:
[FATAL][2022-09-04 13:39:35 -0700]	      - host: localhost
[FATAL][2022-09-04 13:39:35 -0700]	        http:
[FATAL][2022-09-04 13:39:35 -0700]	          paths:
[FATAL][2022-09-04 13:39:35 -0700]	          - backend:
[FATAL][2022-09-04 13:39:35 -0700]	              service:
[FATAL][2022-09-04 13:39:35 -0700]	                name: kubytest-svc
[FATAL][2022-09-04 13:39:35 -0700]	                port:
[FATAL][2022-09-04 13:39:35 -0700]	                  name: http
[FATAL][2022-09-04 13:39:35 -0700]	            path: "/"
[FATAL][2022-09-04 13:39:35 -0700]	            pathType: Prefix
[FATAL][2022-09-04 13:39:35 -0700]	      - host: localhost
[FATAL][2022-09-04 13:39:35 -0700]	        http:
[FATAL][2022-09-04 13:39:35 -0700]	          paths:
[FATAL][2022-09-04 13:39:35 -0700]	          - backend:
[FATAL][2022-09-04 13:39:35 -0700]	              service:
[FATAL][2022-09-04 13:39:35 -0700]	                name: kubytest-assets-svc
[FATAL][2022-09-04 13:39:35 -0700]	                port:
[FATAL][2022-09-04 13:39:35 -0700]	                  name: http
[FATAL][2022-09-04 13:39:35 -0700]	            path: "/assets"
[FATAL][2022-09-04 13:39:35 -0700]	            pathType: Prefix
[FATAL][2022-09-04 13:39:35 -0700]	          - backend:
[FATAL][2022-09-04 13:39:35 -0700]	              service:
[FATAL][2022-09-04 13:39:35 -0700]	                name: kubytest-assets-svc
[FATAL][2022-09-04 13:39:35 -0700]	                port:
[FATAL][2022-09-04 13:39:35 -0700]	                  name: http
[FATAL][2022-09-04 13:39:35 -0700]	            path: "/packs"
[FATAL][2022-09-04 13:39:35 -0700]	            pathType: Prefix
[FATAL][2022-09-04 13:39:35 -0700]	      tls:
[FATAL][2022-09-04 13:39:35 -0700]	      - hosts:
[FATAL][2022-09-04 13:39:35 -0700]	        - localhost
[FATAL][2022-09-04 13:39:35 -0700]	        secretName: kubytest-tls
[FATAL][2022-09-04 13:39:35 -0700]
Command failed: apply -f /var/folders/2d/ybxhkvf55qqf5jp90nm_mxch0000gn/T/d20220904-83925-f2cjjl

Is have tried both Kubernetes server 1.24 and 1.23.

Is this a known problem? I don't know where to start to debug. Thanks for the help.

@camertron
Copy link
Member

camertron commented Sep 5, 2022

Hey @brandoncc, thanks for filing an issue! What you're seeing is indeed weird. Based on the other issue you filed recently, it looks like you're hosting your app on Linode's infrastructure. A couple of thoughts come to mind:

  1. Check to make sure the ingress controller is running:

    bundle exec kuby -e production kubectl -- -n ingress-nginx get pods

    There should be one pod running in that namespace called ingress-nginx-controller-<some id>. If there isn't, or its status isn't "Running," then that's likely the cause of the problem. Try running kuby setup again.

  2. How many nodes (servers, linodes, instances, etc) do you have running in your node pool? How many CPUs and GBs of memory does the pool have in total?

  3. It looks like you've set the hostname to localhost, which is probably fine but might be causing trouble. I also use Linode, so I tried to deploy a test app using localhost as the hostname and it worked just fine. Just to rule it out, it might be worth changing the hostname to a dummy domain (eg. mytestsite.com), then seeing if you can hit it with curl:

    curl -k -H "Host: mytestsite.com" https://<IP address of Linode node balancer here>

Let me know what you find out!

@brandoncc
Copy link
Author

I haven't had time to try any of this, but this issue was when I tried deploying to digital ocean. I tried linode after failing with digital ocean. 😔

@camertron
Copy link
Member

Oh fascinating, it failed in the same way? I'd say that indicates a bug in Kuby somewhere. Are you able to share the code with me so I can debug further?

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

No branches or pull requests

2 participants