Kuby-core: Krane::FatalDeploymentError: Template validation failed

Created on 11 Aug 2020  ·  13Comments  ·  Source: getkuby/kuby-core

When deploying krane blows up. This is a deploy with v. 0.7.0

KUBY_DOCKER_TAG=latest bundle exec rake kuby:deploy --trace I've set the tag to latest to bypass the other issue :)

This is what I get:

* Invoke kuby:deploy (first_time)
*
Execute kuby:deploy
Validating global resource, namespace 'my-app-production'
namespace/my-app-production configured (dry run)
Deploying namespace 'my-app-production'
namespace/my-app-production unchanged
[INFO][2020-08-11 09:15:10 +0200]
[INFO][2020-08-11 09:15:10 +0200] ------------------------------------Phase 1: Initializing deploy------------------------------------
[INFO][2020-08-11 09:15:11 +0200] All required parameters and files are present
[INFO][2020-08-11 09:15:11 +0200] Discovering resources:
[INFO][2020-08-11 09:15:13 +0200] - Deployment/my-app-web
[INFO][2020-08-11 09:15:13 +0200] - Secret/my-app-web-mysql-secret
[INFO][2020-08-11 09:15:13 +0200] - ServiceAccount/my-app-sa
[INFO][2020-08-11 09:15:13 +0200] - ConfigMap/my-app-config
[INFO][2020-08-11 09:15:13 +0200] - Secret/my-app-registry-secret
[INFO][2020-08-11 09:15:13 +0200] - Ingress/my-app-ingress
[INFO][2020-08-11 09:15:13 +0200] - Secret/my-app-secrets
[INFO][2020-08-11 09:15:13 +0200] - ClusterIssuer/letsencrypt-production
[INFO][2020-08-11 09:15:13 +0200] - MySQL/my-app-web-mysql
[INFO][2020-08-11 09:15:13 +0200] - Secret/my-app-web-mysql-secret
[INFO][2020-08-11 09:15:13 +0200] - MySQL/my-app-web-mysql
[INFO][2020-08-11 09:15:13 +0200] - Service/my-app-svc
[INFO][2020-08-11 09:15:15 +0200]
[INFO][2020-08-11 09:15:15 +0200] ------------------------------------------Result: FAILURE-------------------------------------------
[FATAL][2020-08-11 09:15:16 +0200] Template validation failed
[FATAL][2020-08-11 09:15:16 +0200]
[FATAL][2020-08-11 09:15:16 +0200] Invalid template: ClusterIssuer-letsencrypt-production20200811-60914-uybj4y.yml
[FATAL][2020-08-11 09:15:16 +0200] > Error message:
[FATAL][2020-08-11 09:15:16 +0200] W0811 09:15:13.103161 60953 helpers.go:535] --dry-run is deprecated and can be replaced with --dry-run=client.
[FATAL][2020-08-11 09:15:16 +0200] error: unable to recognize "/var/folders/9l/3dw7rcl51pq4jfs0kjg99f7c0000gn/T/ClusterIssuer-letsencrypt-production20200811-60914-uybj4y.yml": no matches for kind "ClusterIssuer" in version "cert-manager.io/v1alpha2"
[FATAL][2020-08-11 09:15:16 +0200] > Template content:
[FATAL][2020-08-11 09:15:16 +0200] ---
[FATAL][2020-08-11 09:15:16 +0200] apiVersion: cert-manager.io/v1alpha2
[FATAL][2020-08-11 09:15:16 +0200] kind: ClusterIssuer
[FATAL][2020-08-11 09:15:16 +0200] metadata:
[FATAL][2020-08-11 09:15:16 +0200] name: letsencrypt-production
[FATAL][2020-08-11 09:15:16 +0200] namespace: cert-manager
[FATAL][2020-08-11 09:15:16 +0200] spec:
[FATAL][2020-08-11 09:15:16 +0200] acme:
[FATAL][2020-08-11 09:15:16 +0200] server: https://acme-v02.api.letsencrypt.org/directory
[FATAL][2020-08-11 09:15:16 +0200] email: [email protected]
[FATAL][2020-08-11 09:15:16 +0200] privateKeySecretRef:
[FATAL][2020-08-11 09:15:16 +0200] name: letsencrypt-production
[FATAL][2020-08-11 09:15:16 +0200] solvers:
[FATAL][2020-08-11 09:15:16 +0200] - http01:
[FATAL][2020-08-11 09:15:16 +0200] ingress:
[FATAL][2020-08-11 09:15:16 +0200] class: nginx
[FATAL][2020-08-11 09:15:16 +0200]
[FATAL][2020-08-11 09:15:16 +0200]
[FATAL][2020-08-11 09:15:16 +0200] Invalid template: MySQL-my-app-web-mysql20200811-60914-1rs7vqx.yml
[FATAL][2020-08-11 09:15:16 +0200] > Error message:
[FATAL][2020-08-11 09:15:16 +0200] W0811 09:15:13.122295 60956 helpers.go:535] --dry-run is deprecated and can be replaced with --dry-run=client.
[FATAL][2020-08-11 09:15:16 +0200] error: unable to recognize "/var/folders/9l/3dw7rcl51pq4jfs0kjg99f7c0000gn/T/MySQL-my-app-web-mysql20200811-60914-1rs7vqx.yml": no matches for kind "MySQL" in version "kubedb.com/v1alpha1"
[FATAL][2020-08-11 09:15:16 +0200] > Template content:
[FATAL][2020-08-11 09:15:16 +0200] ---
[FATAL][2020-08-11 09:15:16 +0200] kind: MySQL
[FATAL][2020-08-11 09:15:16 +0200] apiVersion: kubedb.com/v1alpha1
[FATAL][2020-08-11 09:15:16 +0200] spec:
[FATAL][2020-08-11 09:15:16 +0200] terminationPolicy: DoNotTerminate
[FATAL][2020-08-11 09:15:16 +0200] storageType: Durable
[FATAL][2020-08-11 09:15:16 +0200] version: 5.7-v2
[FATAL][2020-08-11 09:15:16 +0200] storage:
[FATAL][2020-08-11 09:15:16 +0200] accessModes:
[FATAL][2020-08-11 09:15:16 +0200] - ReadWriteOnce
[FATAL][2020-08-11 09:15:16 +0200] storageClassName: do-block-storage
[FATAL][2020-08-11 09:15:16 +0200] resources:
[FATAL][2020-08-11 09:15:16 +0200] requests:
[FATAL][2020-08-11 09:15:16 +0200] storage: 10Gi
[FATAL][2020-08-11 09:15:16 +0200] databaseSecret:
[FATAL][2020-08-11 09:15:16 +0200] secretName: my-app-web-mysql-secret
[FATAL][2020-08-11 09:15:16 +0200] metadata:
[FATAL][2020-08-11 09:15:16 +0200] name: my-app-web-mysql
[FATAL][2020-08-11 09:15:16 +0200] namespace: my-app-production
[FATAL][2020-08-11 09:15:16 +0200]
[FATAL][2020-08-11 09:15:16 +0200]
[FATAL][2020-08-11 09:15:16 +0200] Invalid template: MySQL-my-app-web-mysql20200811-60914-1na8no.yml
[FATAL][2020-08-11 09:15:16 +0200] > Error message:
[FATAL][2020-08-11 09:15:16 +0200] W0811 09:15:14.705164 60971 helpers.go:535] --dry-run is deprecated and can be replaced with --dry-run=client.
[FATAL][2020-08-11 09:15:16 +0200] error: unable to recognize "/var/folders/9l/3dw7rcl51pq4jfs0kjg99f7c0000gn/T/MySQL-my-app-web-mysql20200811-60914-1na8no.yml": no matches for kind "MySQL" in version "kubedb.com/v1alpha1"
[FATAL][2020-08-11 09:15:16 +0200] > Template content:
[FATAL][2020-08-11 09:15:16 +0200] ---
[FATAL][2020-08-11 09:15:16 +0200] kind: MySQL
[FATAL][2020-08-11 09:15:16 +0200] apiVersion: kubedb.com/v1alpha1
[FATAL][2020-08-11 09:15:16 +0200] spec:
[FATAL][2020-08-11 09:15:16 +0200] terminationPolicy: DoNotTerminate
[FATAL][2020-08-11 09:15:16 +0200] storageType: Durable
[FATAL][2020-08-11 09:15:16 +0200] version: 5.7-v2
[FATAL][2020-08-11 09:15:16 +0200] storage:
[FATAL][2020-08-11 09:15:16 +0200] accessModes:
[FATAL][2020-08-11 09:15:16 +0200] - ReadWriteOnce
[FATAL][2020-08-11 09:15:16 +0200] storageClassName: do-block-storage
[FATAL][2020-08-11 09:15:16 +0200] resources:
[FATAL][2020-08-11 09:15:16 +0200] requests:
[FATAL][2020-08-11 09:15:16 +0200] storage: 10Gi
[FATAL][2020-08-11 09:15:16 +0200] databaseSecret:
[FATAL][2020-08-11 09:15:16 +0200] secretName: my-app-web-mysql-secret
[FATAL][2020-08-11 09:15:16 +0200] metadata:
[FATAL][2020-08-11 09:15:16 +0200] name: my-app-web-mysql
[FATAL][2020-08-11 09:15:16 +0200] namespace: my-app-production
[FATAL][2020-08-11 09:15:16 +0200]
rake aborted!
Krane::FatalDeploymentError: Template validation failed

All 13 comments

It looks like your cluster doesn't know about the ClusterIssuer or MySQL objects. Did you run rake kuby:setup before deploying?

Ahhh, missed that step of the guide! Thanks!

@traels were you able to get things working?

Sorry - forgot to get back to you!
I managed to run kuby:setup - then my cluster crashed on Digital Ocean, so now I think I need to create a new kubernetes cluster to try again. Hoping to get some more time to play next week.

@traels oh dang, wow! What happened, if I may ask?

Don't know - Kuby just said that kubernetes was not responding. Tried restarting on DO but that did not help.

Hmm interesting. I've definitely seen hangs when trying to communicate with DOKS clusters. It usually fixes itself in an hour or so. Pretty crappy experience tho, maybe Linode would be better?

Got up early today - and now my cluster works, and the deploy was a success :)
... next issue, how to handle Rails assets in docker? all my assets are missing

Hmm that's curious... assets should be compiled into the Docker image. Oh, but I'll bet nothing is serving them! Can you try setting config.public_file_server.enabled = true in your production.rb? That should fix things. I'll file a bug as well, since that should probably work out of the box :)

So on kubernetes people serve assets with the ruby webserver?

No, but that's the quickest fix I could think of hehe. Kuby should have a better option, but it'll take some work.

I should expand a bit: most people with Rails apps with any kind of scale tend to serve static assets from a CDN. The origin of those assets is usually something like an S3 bucket, but could well be the Rails app itself. Since 99% of the time the CDN will serve the assets, querying the Rails app for them initially shouldn't impact performance too terribly.

Filed an issue yesterday to track this: https://github.com/getkuby/kuby-core/issues/12

Kuby v0.8.0 comes with a fully functional asset server (nginx), so there should be no need for the app itself to serve assets anymore :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kingdonb picture kingdonb  ·  6Comments

hovancik picture hovancik  ·  5Comments

dewski picture dewski  ·  8Comments

tsommer picture tsommer  ·  13Comments

carllerche picture carllerche  ·  10Comments