krane 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -0
  3. data/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
  4. data/{pull_request_template.md → .github/pull_request_template.md} +0 -0
  5. data/.rubocop-http---shopify-github-io-ruby-style-guide-rubocop-yml +24 -30
  6. data/.rubocop.yml +0 -12
  7. data/.shopify-build/krane.yml +20 -6
  8. data/1.0-Upgrade.md +2 -2
  9. data/CHANGELOG.md +61 -0
  10. data/CONTRIBUTING.md +2 -2
  11. data/README.md +14 -16
  12. data/bin/ci +1 -1
  13. data/bin/test +2 -2
  14. data/dev.yml +1 -1
  15. data/krane.gemspec +7 -5
  16. data/lib/krane/annotation.rb +11 -0
  17. data/lib/krane/cli/deploy_command.rb +3 -4
  18. data/lib/krane/cli/global_deploy_command.rb +3 -3
  19. data/lib/krane/cli/render_command.rb +3 -3
  20. data/lib/krane/cluster_resource_discovery.rb +10 -6
  21. data/lib/krane/concerns/template_reporting.rb +0 -6
  22. data/lib/krane/container_logs.rb +1 -1
  23. data/lib/krane/container_overrides.rb +33 -0
  24. data/lib/krane/deploy_task.rb +16 -13
  25. data/lib/krane/ejson_secret_provisioner.rb +1 -2
  26. data/lib/krane/global_deploy_task.rb +4 -7
  27. data/lib/krane/kubectl.rb +11 -1
  28. data/lib/krane/kubernetes_resource.rb +19 -46
  29. data/lib/krane/kubernetes_resource/custom_resource.rb +2 -2
  30. data/lib/krane/kubernetes_resource/custom_resource_definition.rb +13 -10
  31. data/lib/krane/kubernetes_resource/deployment.rb +5 -7
  32. data/lib/krane/kubernetes_resource/pod.rb +12 -8
  33. data/lib/krane/psych_k8s_compatibility.rb +36 -0
  34. data/lib/krane/render_task.rb +2 -2
  35. data/lib/krane/renderer.rb +2 -0
  36. data/lib/krane/resource_deployer.rb +7 -2
  37. data/lib/krane/resource_watcher.rb +1 -1
  38. data/lib/krane/restart_task.rb +2 -2
  39. data/lib/krane/runner_task.rb +16 -17
  40. data/lib/krane/statsd.rb +2 -2
  41. data/lib/krane/template_sets.rb +1 -1
  42. data/lib/krane/version.rb +1 -1
  43. metadata +27 -17
  44. data/lib/krane/kubernetes_resource/cloudsql.rb +0 -44
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
- module Krane
3
- class Cloudsql < KubernetesResource
4
- TIMEOUT = 10.minutes
5
- SYNC_DEPENDENCIES = %w(Deployment Service)
6
-
7
- def sync(cache)
8
- super
9
- @proxy_deployment = cache.get_instance(Deployment.kind, "cloudsql-#{cloudsql_resource_uuid}")
10
- @proxy_service = cache.get_instance(Service.kind, "cloudsql-#{@name}")
11
- end
12
-
13
- def status
14
- deploy_succeeded? ? "Provisioned" : "Unknown"
15
- end
16
-
17
- def deploy_succeeded?
18
- proxy_deployment_ready? && proxy_service_ready?
19
- end
20
-
21
- def deploy_failed?
22
- false
23
- end
24
-
25
- private
26
-
27
- def proxy_deployment_ready?
28
- return false unless (status = @proxy_deployment["status"])
29
- # all cloudsql-proxy pods are running
30
- status.fetch("availableReplicas", -1) == status.fetch("replicas", 0)
31
- end
32
-
33
- def proxy_service_ready?
34
- return false unless @proxy_service.present?
35
- # the service has an assigned cluster IP and is therefore functioning
36
- @proxy_service.dig("spec", "clusterIP").present?
37
- end
38
-
39
- def cloudsql_resource_uuid
40
- return unless @instance_data
41
- @instance_data.dig("metadata", "uid")
42
- end
43
- end
44
- end