9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/kuber_kit/service_deployer/strategies/kubernetes.rb', line 9
def deploy(shell, service)
service_config = reader.read(shell, service)
config_path = "#{configs.service_config_dir}/#{service.name}.yml"
shell.write(config_path, service_config)
kubeconfig_path = KuberKit.current_configuration.kubeconfig_path
deployer_namespace = KuberKit.current_configuration.deployer_namespace
kubectl_commands.apply_file(shell, config_path, kubeconfig_path: kubeconfig_path, namespace: deployer_namespace)
deployer_restart_enabled = service.attribute(:deployer_restart_enabled, default: true)
deployer_restart_name = service.attribute(:deployer_restart_name, default: service.uri)
if deployer_restart_enabled
kubectl_commands.rolling_restart(shell, deployer_restart_name, kubeconfig_path: kubeconfig_path, namespace: deployer_namespace)
end
end
|