krane 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -0
- data/{ISSUE_TEMPLATE.md → .github/ISSUE_TEMPLATE.md} +0 -0
- data/{pull_request_template.md → .github/pull_request_template.md} +0 -0
- data/.rubocop-http---shopify-github-io-ruby-style-guide-rubocop-yml +24 -30
- data/.rubocop.yml +0 -12
- data/.shopify-build/krane.yml +20 -6
- data/1.0-Upgrade.md +2 -2
- data/CHANGELOG.md +61 -0
- data/CONTRIBUTING.md +2 -2
- data/README.md +14 -16
- data/bin/ci +1 -1
- data/bin/test +2 -2
- data/dev.yml +1 -1
- data/krane.gemspec +7 -5
- data/lib/krane/annotation.rb +11 -0
- data/lib/krane/cli/deploy_command.rb +3 -4
- data/lib/krane/cli/global_deploy_command.rb +3 -3
- data/lib/krane/cli/render_command.rb +3 -3
- data/lib/krane/cluster_resource_discovery.rb +10 -6
- data/lib/krane/concerns/template_reporting.rb +0 -6
- data/lib/krane/container_logs.rb +1 -1
- data/lib/krane/container_overrides.rb +33 -0
- data/lib/krane/deploy_task.rb +16 -13
- data/lib/krane/ejson_secret_provisioner.rb +1 -2
- data/lib/krane/global_deploy_task.rb +4 -7
- data/lib/krane/kubectl.rb +11 -1
- data/lib/krane/kubernetes_resource.rb +19 -46
- data/lib/krane/kubernetes_resource/custom_resource.rb +2 -2
- data/lib/krane/kubernetes_resource/custom_resource_definition.rb +13 -10
- data/lib/krane/kubernetes_resource/deployment.rb +5 -7
- data/lib/krane/kubernetes_resource/pod.rb +12 -8
- data/lib/krane/psych_k8s_compatibility.rb +36 -0
- data/lib/krane/render_task.rb +2 -2
- data/lib/krane/renderer.rb +2 -0
- data/lib/krane/resource_deployer.rb +7 -2
- data/lib/krane/resource_watcher.rb +1 -1
- data/lib/krane/restart_task.rb +2 -2
- data/lib/krane/runner_task.rb +16 -17
- data/lib/krane/statsd.rb +2 -2
- data/lib/krane/template_sets.rb +1 -1
- data/lib/krane/version.rb +1 -1
- metadata +27 -17
- 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
|