uffizzi-cli 2.3.3 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -170
- data/lib/uffizzi/cli/cluster.rb +43 -28
- data/lib/uffizzi/cli/dev.rb +1 -1
- data/lib/uffizzi/cli/install.rb +252 -0
- data/lib/uffizzi/cli/status.rb +43 -0
- data/lib/uffizzi/cli/uninstall.rb +98 -0
- data/lib/uffizzi/cli.rb +12 -0
- data/lib/uffizzi/clients/api/api_client.rb +35 -0
- data/lib/uffizzi/clients/api/api_routes.rb +12 -0
- data/lib/uffizzi/services/cluster_service.rb +32 -28
- data/lib/uffizzi/services/install_service.rb +153 -0
- data/lib/uffizzi/services/preview_service.rb +3 -1
- data/lib/uffizzi/version.rb +1 -1
- data/man/uffizzi +1 -1
- data/man/uffizzi-cluster +7 -1
- data/man/uffizzi-cluster-create +1 -1
- data/man/uffizzi-cluster-delete +1 -1
- data/man/uffizzi-cluster-disconnect +1 -1
- data/man/uffizzi-cluster-sleep +39 -0
- data/man/uffizzi-cluster-update-kubeconfig.ronn +10 -3
- data/man/uffizzi-cluster-wake +37 -0
- data/man/uffizzi-dev +1 -1
- data/man/uffizzi-dev-delete +33 -0
- data/man/uffizzi-dev-describe +2 -8
- data/man/uffizzi-dev-ingress +1 -1
- data/man/uffizzi-dev-ingress-open +1 -1
- data/man/uffizzi-dev-start +1 -14
- data/man/uffizzi-dev-stop +6 -18
- data/man/uffizzi-install +57 -0
- data/man/uffizzi-install.ronn +52 -0
- data/man/uffizzi-login +1 -1
- metadata +11 -2
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uffizzi'
|
4
|
+
require 'uffizzi/config_file'
|
5
|
+
require 'uffizzi/services/install_service'
|
6
|
+
require 'uffizzi/services/kubeconfig_service'
|
7
|
+
|
8
|
+
module Uffizzi
|
9
|
+
class Cli::Uninstall < Thor
|
10
|
+
include ApiClient
|
11
|
+
|
12
|
+
default_task :controller
|
13
|
+
|
14
|
+
desc 'controller [HOSTNMAE]', 'Install uffizzi controller to cluster'
|
15
|
+
method_option :namespace, type: :string
|
16
|
+
method_option :context, type: :string
|
17
|
+
def controller
|
18
|
+
Uffizzi::AuthHelper.check_login
|
19
|
+
|
20
|
+
InstallService.kubectl_exists?
|
21
|
+
InstallService.helm_exists?
|
22
|
+
|
23
|
+
if options[:context].present? && options[:context] != InstallService.kubeconfig_current_context
|
24
|
+
InstallService.set_current_context(options[:context])
|
25
|
+
end
|
26
|
+
|
27
|
+
ask_confirmation
|
28
|
+
delete_controller_settings
|
29
|
+
InstallService.helm_uninstall!(namespace)
|
30
|
+
|
31
|
+
helm_unset_repo
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def helm_unset_repo
|
37
|
+
return if InstallService.helm_repo_search.blank?
|
38
|
+
|
39
|
+
InstallService.helm_repo_remove
|
40
|
+
end
|
41
|
+
|
42
|
+
def ask_confirmation
|
43
|
+
msg = "This command will uninstall Uffizzi from the '#{namespace}'"\
|
44
|
+
" namespace of the '#{InstallService.kubeconfig_current_context}' context."\
|
45
|
+
"\r\n"\
|
46
|
+
"To uninstall a different installation, use options '--namespace' and/or '--context'."\
|
47
|
+
"\r\n\r\n"\
|
48
|
+
"After uninstalling, new environments created for account '#{account_name}'"\
|
49
|
+
"\r\n"\
|
50
|
+
'will be deployed to Uffizzi Cloud (app.uffizzi.com).'\
|
51
|
+
"\r\n\r\n"
|
52
|
+
|
53
|
+
Uffizzi.ui.say(msg)
|
54
|
+
|
55
|
+
question = 'Okay to proceed?'
|
56
|
+
Uffizzi.ui.say_error_and_exit('Uninstallation canceled') unless Uffizzi.prompt.yes?(question)
|
57
|
+
end
|
58
|
+
|
59
|
+
def fetch_controller_settings
|
60
|
+
response = get_account_controller_settings(server, account_id)
|
61
|
+
return Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
|
62
|
+
|
63
|
+
response.dig(:body, :controller_settings)
|
64
|
+
end
|
65
|
+
|
66
|
+
def delete_controller_settings
|
67
|
+
return if existing_controller_setting.blank?
|
68
|
+
|
69
|
+
response = delete_account_controller_settings(server, account_id, existing_controller_setting[:id])
|
70
|
+
|
71
|
+
if ResponseHelper.no_content?(response)
|
72
|
+
Uffizzi.ui.say('Controller settings deleted')
|
73
|
+
else
|
74
|
+
ResponseHelper.handle_failed_response(response)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def namespace
|
79
|
+
options[:namespace] || InstallService::DEFAULT_NAMESPACE
|
80
|
+
end
|
81
|
+
|
82
|
+
def server
|
83
|
+
@server ||= ConfigFile.read_option(:server)
|
84
|
+
end
|
85
|
+
|
86
|
+
def account_id
|
87
|
+
@account_id ||= ConfigFile.read_option(:account, :id)
|
88
|
+
end
|
89
|
+
|
90
|
+
def account_name
|
91
|
+
@account_name ||= ConfigFile.read_option(:account, :name)
|
92
|
+
end
|
93
|
+
|
94
|
+
def existing_controller_setting
|
95
|
+
@existing_controller_setting ||= fetch_controller_settings[0]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
data/lib/uffizzi/cli.rb
CHANGED
@@ -75,6 +75,18 @@ module Uffizzi
|
|
75
75
|
require_relative 'cli/dev'
|
76
76
|
subcommand 'dev', Cli::Dev
|
77
77
|
|
78
|
+
desc 'install', 'install'
|
79
|
+
require_relative 'cli/install'
|
80
|
+
subcommand 'install', Cli::Install
|
81
|
+
|
82
|
+
desc 'uninstall', 'uninstall'
|
83
|
+
require_relative 'cli/uninstall'
|
84
|
+
subcommand 'uninstall', Cli::Uninstall
|
85
|
+
|
86
|
+
desc 'status', 'status'
|
87
|
+
require_relative 'cli/status'
|
88
|
+
subcommand 'status', Cli::Status
|
89
|
+
|
78
90
|
map preview: :compose
|
79
91
|
|
80
92
|
class << self
|
@@ -276,6 +276,13 @@ module ApiClient
|
|
276
276
|
build_response(response)
|
277
277
|
end
|
278
278
|
|
279
|
+
def sync_cluster(server, project_slug, cluster_name)
|
280
|
+
uri = sync_cluster_uri(server, project_slug, cluster_name)
|
281
|
+
response = http_client.make_put_request(uri)
|
282
|
+
|
283
|
+
build_response(response)
|
284
|
+
end
|
285
|
+
|
279
286
|
def create_access_token(server, session_id)
|
280
287
|
uri = access_tokens_url(server)
|
281
288
|
|
@@ -321,6 +328,34 @@ module ApiClient
|
|
321
328
|
build_response(response)
|
322
329
|
end
|
323
330
|
|
331
|
+
def get_account_controller_settings(server, account_id)
|
332
|
+
uri = account_controller_settings_uri(server, account_id)
|
333
|
+
response = http_client.make_get_request(uri)
|
334
|
+
|
335
|
+
build_response(response)
|
336
|
+
end
|
337
|
+
|
338
|
+
def create_account_controller_settings(server, account_id, params = {})
|
339
|
+
uri = account_controller_settings_uri(server, account_id)
|
340
|
+
response = http_client.make_post_request(uri, params)
|
341
|
+
|
342
|
+
build_response(response)
|
343
|
+
end
|
344
|
+
|
345
|
+
def update_account_controller_settings(server, account_id, id, params = {})
|
346
|
+
uri = account_controller_setting_uri(server, account_id, id)
|
347
|
+
response = http_client.make_put_request(uri, params)
|
348
|
+
|
349
|
+
build_response(response)
|
350
|
+
end
|
351
|
+
|
352
|
+
def delete_account_controller_settings(server, account_id, id)
|
353
|
+
uri = account_controller_setting_uri(server, account_id, id)
|
354
|
+
response = http_client.make_delete_request(uri)
|
355
|
+
|
356
|
+
build_response(response)
|
357
|
+
end
|
358
|
+
|
324
359
|
private
|
325
360
|
|
326
361
|
def http_client
|
@@ -124,6 +124,10 @@ module ApiRoutes
|
|
124
124
|
"#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}/scale_down"
|
125
125
|
end
|
126
126
|
|
127
|
+
def sync_cluster_uri(server, project_slug, cluster_name)
|
128
|
+
"#{server}/api/cli/v1/projects/#{project_slug}/clusters/#{cluster_name}/sync"
|
129
|
+
end
|
130
|
+
|
127
131
|
def access_token_url(server, code)
|
128
132
|
"#{server}/api/cli/v1/access_tokens/#{code}"
|
129
133
|
end
|
@@ -139,4 +143,12 @@ module ApiRoutes
|
|
139
143
|
def account_clusters_uri(server, account_id)
|
140
144
|
"#{server}/api/cli/v1/accounts/#{account_id}/clusters"
|
141
145
|
end
|
146
|
+
|
147
|
+
def account_controller_settings_uri(server, account_id)
|
148
|
+
"#{server}/api/cli/v1/accounts/#{account_id}/controller_settings"
|
149
|
+
end
|
150
|
+
|
151
|
+
def account_controller_setting_uri(server, account_id, id)
|
152
|
+
"#{server}/api/cli/v1/accounts/#{account_id}/controller_settings/#{id}"
|
153
|
+
end
|
142
154
|
end
|
@@ -8,6 +8,7 @@ class ClusterService
|
|
8
8
|
CLUSTER_STATE_DEPLOYING = 'deploying'
|
9
9
|
CLUSTER_STATE_DEPLOYED = 'deployed'
|
10
10
|
CLUSTER_STATE_SCALING_DOWN = 'scaling_down'
|
11
|
+
CLUSTER_STATE_SCALED_DOWN = 'scaled_down'
|
11
12
|
CLUSTER_STATE_SCALING_UP = 'scaling_up'
|
12
13
|
CLUSTER_FAILED_SCALING_UP = 'failed_scaling_up'
|
13
14
|
CLUSTER_STATE_FAILED_DEPLOY_NAMESPACE = 'failed_deploy_namespace'
|
@@ -38,53 +39,35 @@ class ClusterService
|
|
38
39
|
cluster_state === CLUSTER_STATE_SCALING_DOWN
|
39
40
|
end
|
40
41
|
|
42
|
+
def scaled_down?(cluster_state)
|
43
|
+
cluster_state === CLUSTER_STATE_SCALED_DOWN
|
44
|
+
end
|
45
|
+
|
41
46
|
def failed_scaling_up?(cluster_state)
|
42
47
|
cluster_state === CLUSTER_FAILED_SCALING_UP
|
43
48
|
end
|
44
49
|
|
45
|
-
def wait_cluster_deploy(
|
50
|
+
def wait_cluster_deploy(cluster_name, cluster_api_connection_params)
|
46
51
|
loop do
|
47
|
-
|
48
|
-
cluster_name: cluster_name,
|
49
|
-
oidc_token: oidc_token,
|
50
|
-
}
|
51
|
-
response = get_cluster(Uffizzi::ConfigFile.read_option(:server), project_slug, params)
|
52
|
-
return Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
|
53
|
-
|
54
|
-
cluster_data = response.dig(:body, :cluster)
|
55
|
-
|
52
|
+
cluster_data = fetch_cluster_data(cluster_name, **cluster_api_connection_params)
|
56
53
|
return cluster_data unless deploying?(cluster_data[:state])
|
57
54
|
|
58
55
|
sleep(5)
|
59
56
|
end
|
60
57
|
end
|
61
58
|
|
62
|
-
def wait_cluster_scale_up(
|
59
|
+
def wait_cluster_scale_up(cluster_name, cluster_api_connection_params)
|
63
60
|
loop do
|
64
|
-
|
65
|
-
cluster_name: cluster_name,
|
66
|
-
}
|
67
|
-
response = get_cluster(Uffizzi::ConfigFile.read_option(:server), project_slug, params)
|
68
|
-
return Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
|
69
|
-
|
70
|
-
cluster_data = response.dig(:body, :cluster)
|
71
|
-
|
61
|
+
cluster_data = fetch_cluster_data(cluster_name, **cluster_api_connection_params)
|
72
62
|
return cluster_data unless scaling_up?(cluster_data[:state])
|
73
63
|
|
74
64
|
sleep(5)
|
75
65
|
end
|
76
66
|
end
|
77
67
|
|
78
|
-
def wait_cluster_scale_down(
|
68
|
+
def wait_cluster_scale_down(cluster_name, cluster_api_connection_params)
|
79
69
|
loop do
|
80
|
-
|
81
|
-
cluster_name: cluster_name,
|
82
|
-
}
|
83
|
-
response = get_cluster(Uffizzi::ConfigFile.read_option(:server), project_slug, params)
|
84
|
-
return Uffizzi::ResponseHelper.handle_failed_response(response) unless Uffizzi::ResponseHelper.ok?(response)
|
85
|
-
|
86
|
-
cluster_data = response.dig(:body, :cluster)
|
87
|
-
|
70
|
+
cluster_data = fetch_cluster_data(cluster_name, **cluster_api_connection_params)
|
88
71
|
return unless scaling_down?(cluster_data[:state])
|
89
72
|
|
90
73
|
sleep(3)
|
@@ -120,6 +103,16 @@ class ClusterService
|
|
120
103
|
end
|
121
104
|
end
|
122
105
|
|
106
|
+
def sync_cluster_data(cluster_name, server:, project_slug:)
|
107
|
+
response = sync_cluster(server, project_slug, cluster_name)
|
108
|
+
|
109
|
+
if Uffizzi::ResponseHelper.ok?(response)
|
110
|
+
response.dig(:body, :cluster)
|
111
|
+
else
|
112
|
+
Uffizzi::ResponseHelper.handle_failed_response(response)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
123
116
|
def build_render_data(cluster_data)
|
124
117
|
{
|
125
118
|
name: cluster_data[:name],
|
@@ -128,5 +121,16 @@ class ClusterService
|
|
128
121
|
host: cluster_data[:host],
|
129
122
|
}
|
130
123
|
end
|
124
|
+
|
125
|
+
def cluster_status_text_map
|
126
|
+
{
|
127
|
+
CLUSTER_STATE_SCALING_UP => 'The cluster is scaling up',
|
128
|
+
CLUSTER_STATE_SCALED_DOWN => 'The cluster is scaled down',
|
129
|
+
CLUSTER_STATE_SCALING_DOWN => 'The cluster is scaling down',
|
130
|
+
CLUSTER_FAILED_SCALING_UP => 'The cluster failed scaling up',
|
131
|
+
CLUSTER_STATE_FAILED_DEPLOY_NAMESPACE => 'The cluster failed',
|
132
|
+
CLUSTER_STATE_FAILED => 'The cluster failed',
|
133
|
+
}
|
134
|
+
end
|
131
135
|
end
|
132
136
|
end
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'uffizzi/response_helper'
|
4
|
+
require 'uffizzi/clients/api/api_client'
|
5
|
+
|
6
|
+
class InstallService
|
7
|
+
DEFAULT_HELM_RELEASE_NAME = 'uffizzi'
|
8
|
+
INGRESS_NAME = "#{DEFAULT_HELM_RELEASE_NAME}-controller"
|
9
|
+
DEFAULT_HELM_REPO_NAME = 'uffizzi'
|
10
|
+
DEFAULT_CONTROLLER_CHART_NAME = 'uffizzi-controller'
|
11
|
+
HELM_DEPLOYED_STATUS = 'deployed'
|
12
|
+
VALUES_FILE_NAME = 'helm_values.yaml'
|
13
|
+
DEFAULT_NAMESPACE = 'default'
|
14
|
+
DEFAULT_CLUSTER_ISSUER = 'letsencrypt'
|
15
|
+
DEFAULT_CONTROLLER_REPO_URL = 'https://uffizzicloud.github.io/uffizzi_controller'
|
16
|
+
DEFAULT_CONTROLLER_DOMAIN_PREFIX = 'controller'
|
17
|
+
|
18
|
+
class << self
|
19
|
+
include ApiClient
|
20
|
+
|
21
|
+
def kubectl_exists?
|
22
|
+
cmd = 'kubectl version -o json'
|
23
|
+
execute_command(cmd, say: false).present?
|
24
|
+
end
|
25
|
+
|
26
|
+
def helm_exists?
|
27
|
+
cmd = 'helm version --short'
|
28
|
+
execute_command(cmd, say: false).present?
|
29
|
+
end
|
30
|
+
|
31
|
+
def helm_repo_remove
|
32
|
+
cmd = "helm repo remove #{DEFAULT_HELM_REPO_NAME}"
|
33
|
+
execute_command(cmd, skip_error: true)
|
34
|
+
end
|
35
|
+
|
36
|
+
def helm_repo_search
|
37
|
+
cmd = "helm search repo #{DEFAULT_HELM_REPO_NAME}/#{DEFAULT_CONTROLLER_CHART_NAME} -o json"
|
38
|
+
|
39
|
+
execute_command(cmd) do |result, err|
|
40
|
+
err.present? ? nil : JSON.parse(result)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def helm_repo_add(repo_url)
|
45
|
+
repo_url = repo_url || DEFAULT_CONTROLLER_REPO_URL
|
46
|
+
cmd = "helm repo add #{DEFAULT_HELM_REPO_NAME} #{repo_url}"
|
47
|
+
execute_command(cmd)
|
48
|
+
end
|
49
|
+
|
50
|
+
def helm_install!(namespace)
|
51
|
+
Uffizzi.ui.say('Start helm release installation')
|
52
|
+
|
53
|
+
repo = "#{DEFAULT_HELM_REPO_NAME}/#{DEFAULT_CONTROLLER_CHART_NAME}"
|
54
|
+
cmd = "helm upgrade #{DEFAULT_HELM_RELEASE_NAME} #{repo}" \
|
55
|
+
" --values #{helm_values_file_path}" \
|
56
|
+
" --namespace #{namespace}" \
|
57
|
+
' --create-namespace' \
|
58
|
+
' --install' \
|
59
|
+
' --output json'
|
60
|
+
|
61
|
+
res = execute_command(cmd, say: false)
|
62
|
+
info = JSON.parse(res)['info']
|
63
|
+
|
64
|
+
return if info['status'] == HELM_DEPLOYED_STATUS
|
65
|
+
|
66
|
+
Uffizzi.ui.say_error_and_exit(info)
|
67
|
+
end
|
68
|
+
|
69
|
+
def helm_uninstall!(namespace)
|
70
|
+
Uffizzi.ui.say('Start helm release uninstallation')
|
71
|
+
|
72
|
+
cmd = "helm uninstall #{DEFAULT_HELM_RELEASE_NAME} --namespace #{namespace}"
|
73
|
+
|
74
|
+
execute_command(cmd)
|
75
|
+
end
|
76
|
+
|
77
|
+
def set_current_context(context)
|
78
|
+
cmd = "kubectl config use-context #{context}"
|
79
|
+
execute_command(cmd)
|
80
|
+
end
|
81
|
+
|
82
|
+
def kubeconfig_current_context
|
83
|
+
cmd = 'kubectl config current-context'
|
84
|
+
|
85
|
+
execute_command(cmd, say: false) { |stdout| stdout.present? && stdout.chop }
|
86
|
+
end
|
87
|
+
|
88
|
+
def get_controller_ip(namespace)
|
89
|
+
cmd = "kubectl get ingress -n #{namespace} -o json"
|
90
|
+
res = execute_command(cmd, say: false)
|
91
|
+
ingress = JSON.parse(res)['items'].detect { |i| i['metadata']['name'] = INGRESS_NAME }
|
92
|
+
|
93
|
+
return if ingress.blank?
|
94
|
+
|
95
|
+
load_balancers = ingress.dig('status', 'loadBalancer', 'ingress')
|
96
|
+
return if load_balancers.blank?
|
97
|
+
|
98
|
+
load_balancers.map { |i| i['ip'] }[0]
|
99
|
+
end
|
100
|
+
|
101
|
+
def get_certificate_request(namespace, uri)
|
102
|
+
cmd = "kubectl get certificaterequests -n #{namespace} -o json"
|
103
|
+
res = execute_command(cmd, say: false)
|
104
|
+
certificate_request = JSON.parse(res)['items'].detect { |i| i['metadata']['name'].include?(uri.host) }
|
105
|
+
|
106
|
+
return [] if certificate_request.nil?
|
107
|
+
|
108
|
+
conditions = certificate_request.dig('status', 'conditions') || []
|
109
|
+
conditions.map { |c| c.slice('type', 'status') }
|
110
|
+
end
|
111
|
+
|
112
|
+
def build_controller_host(host)
|
113
|
+
[DEFAULT_CONTROLLER_DOMAIN_PREFIX, host].join('.')
|
114
|
+
end
|
115
|
+
|
116
|
+
def delete_helm_values_file
|
117
|
+
File.delete(helm_values_file_path) if File.exist?(helm_values_file_path)
|
118
|
+
end
|
119
|
+
|
120
|
+
def create_helm_values_file(values)
|
121
|
+
FileUtils.mkdir_p(helm_values_dir_path) unless File.directory?(helm_values_dir_path)
|
122
|
+
File.write(helm_values_file_path, values.to_yaml)
|
123
|
+
end
|
124
|
+
|
125
|
+
def helm_values_file_path
|
126
|
+
File.join(helm_values_dir_path, VALUES_FILE_NAME)
|
127
|
+
end
|
128
|
+
|
129
|
+
def helm_values_dir_path
|
130
|
+
File.dirname(Uffizzi::ConfigFile.config_path)
|
131
|
+
end
|
132
|
+
|
133
|
+
private
|
134
|
+
|
135
|
+
def execute_command(command, say: true, skip_error: false)
|
136
|
+
stdout_str, stderr_str, status = Uffizzi.ui.capture3(command)
|
137
|
+
|
138
|
+
return yield(stdout_str, stderr_str) if block_given?
|
139
|
+
|
140
|
+
if !status.success? && !skip_error
|
141
|
+
return Uffizzi.ui.say_error_and_exit(stderr_str)
|
142
|
+
end
|
143
|
+
|
144
|
+
if !status.success? && skip_error
|
145
|
+
return Uffizzi.ui.say(stderr_str)
|
146
|
+
end
|
147
|
+
|
148
|
+
say ? Uffizzi.ui.say(stdout_str) : stdout_str
|
149
|
+
rescue Errno::ENOENT => e
|
150
|
+
Uffizzi.ui.say_error_and_exit(e.message)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
end
|
@@ -56,7 +56,9 @@ class PreviewService
|
|
56
56
|
|
57
57
|
Uffizzi.ui.say('Deployed')
|
58
58
|
Uffizzi.ui.say("Deployment url: https://#{deployment[:preview_url]}")
|
59
|
-
|
59
|
+
if deployment[:proxy_preview_url].present?
|
60
|
+
Uffizzi.ui.say("Deployment proxy url: https://#{deployment[:proxy_preview_url]}")
|
61
|
+
end
|
60
62
|
|
61
63
|
activity_items
|
62
64
|
rescue ApiClient::ResponseError => e
|
data/lib/uffizzi/version.rb
CHANGED
data/man/uffizzi
CHANGED
data/man/uffizzi-cluster
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with Ronn-NG/v0.9.1
|
2
2
|
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
-
.TH "UFFIZZI\-CLUSTER" "" "
|
3
|
+
.TH "UFFIZZI\-CLUSTER" "" "November 2023" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBuffizzi\-cluster\fR \- manage clusters
|
6
6
|
.SH "SYNOPSIS"
|
@@ -30,6 +30,12 @@ COMMAND is one of the following:
|
|
30
30
|
list
|
31
31
|
List all clusters
|
32
32
|
|
33
|
+
sleep
|
34
|
+
Put a cluster to sleep (non\-destructive)
|
35
|
+
|
36
|
+
wake
|
37
|
+
Wake a cluster that is sleeping
|
38
|
+
|
33
39
|
update\-kubeconfig
|
34
40
|
Update kubeconfig file
|
35
41
|
.fi
|
data/man/uffizzi-cluster-create
CHANGED
data/man/uffizzi-cluster-delete
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with Ronn-NG/v0.9.1
|
2
2
|
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
-
.TH "UFFIZZI\-CLUSTER\-DELETE" "" "
|
3
|
+
.TH "UFFIZZI\-CLUSTER\-DELETE" "" "November 2023" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBuffizzi\-cluster\-delete\fR \- delete a cluster
|
6
6
|
.SH "SYNOPSIS"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
.\" generated with Ronn-NG/v0.9.1
|
2
2
|
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
-
.TH "UFFIZZI\-CLUSTER\-DISCONNECT" "" "
|
3
|
+
.TH "UFFIZZI\-CLUSTER\-DISCONNECT" "" "November 2023" ""
|
4
4
|
.SH "NAME"
|
5
5
|
\fBuffizzi\-cluster\-disconnect\fR \- disconnect from current cluster context
|
6
6
|
.SH "SYNOPSIS"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
.\" generated with Ronn-NG/v0.9.1
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
+
.TH "UFFIZZI\-CLUSTER\-SLEEP" "" "November 2023" ""
|
4
|
+
.SH "NAME"
|
5
|
+
\fBuffizzi\-cluster\-sleep\fR
|
6
|
+
.P
|
7
|
+
$ uffizzi cluster sleep \-h uffizzi\-cluster\-sleep \- put a cluster to sleep (non\-destructive) ================================================================
|
8
|
+
.SH "SYNOPSIS"
|
9
|
+
.nf
|
10
|
+
uffizzi cluster sleep [CLUSTER_NAME]
|
11
|
+
.fi
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
.nf
|
14
|
+
Scales a Uffizzi cluster down to zero resource utilization
|
15
|
+
while keeping the namespace and any stateful resources,
|
16
|
+
like persistent volume claims\. If no CLUSTER_NAME is
|
17
|
+
specified, the kubeconfig current context is used\.
|
18
|
+
|
19
|
+
For more information on Uffizzi clusters, see:
|
20
|
+
https://docs\.uffizzi\.com/references/cli/
|
21
|
+
.fi
|
22
|
+
.SH "OPTIONS"
|
23
|
+
.nf
|
24
|
+
CLUSTER_NAME
|
25
|
+
The name of the target Uffizzi cluster
|
26
|
+
.fi
|
27
|
+
.SH "EXAMPLES"
|
28
|
+
.nf
|
29
|
+
To put the Uffizzi cluster in the current context to
|
30
|
+
sleep, run:
|
31
|
+
|
32
|
+
$ uffizzi cluster sleep
|
33
|
+
|
34
|
+
To put a Uffizzi cluster outside the current context to
|
35
|
+
sleep, run:
|
36
|
+
|
37
|
+
$ uffizzi cluster sleep my\-cluster
|
38
|
+
.fi
|
39
|
+
|
@@ -1,3 +1,4 @@
|
|
1
|
+
$ uffizzi cluster update-kubeconfig -h
|
1
2
|
uffizzi-cluster-update-kubeconfig - update a kubeconfig
|
2
3
|
================================================================
|
3
4
|
|
@@ -5,7 +6,8 @@ uffizzi-cluster-update-kubeconfig - update a kubeconfig
|
|
5
6
|
uffizzi cluster update-kubeconfig [CLUSTER_NAME]
|
6
7
|
|
7
8
|
## DESCRIPTION
|
8
|
-
Update your kubeconfig file
|
9
|
+
Update your kubeconfig file such that you can use kubectl to connect
|
10
|
+
to a Uffizzi cluster.
|
9
11
|
|
10
12
|
This command can fail for the following reasons:
|
11
13
|
- Your kubeconfig file out of specification
|
@@ -13,6 +15,11 @@ uffizzi-cluster-update-kubeconfig - update a kubeconfig
|
|
13
15
|
For more information on Uffizzi clusters, see:
|
14
16
|
https://docs.uffizzi.com/references/cli/
|
15
17
|
|
18
|
+
## POSITIONAL ARGUMENTS
|
19
|
+
CLUSTER_NAME
|
20
|
+
The name of the cluster for which to create a kubeconfig entry.
|
21
|
+
This cluster must exist in your account.
|
22
|
+
|
16
23
|
## FLAGS
|
17
24
|
--kubeconfig="/path/to/your/kubeconfig"
|
18
25
|
Path to kubeconfig file you want to update
|
@@ -24,6 +31,6 @@ uffizzi-cluster-update-kubeconfig - update a kubeconfig
|
|
24
31
|
Quiet mode
|
25
32
|
|
26
33
|
## EXAMPLES
|
27
|
-
To update kubeconfig file, run:
|
34
|
+
To update kubeconfig file for cluster 'my-cluster', run:
|
28
35
|
|
29
|
-
$ uffizzi cluster update-kubeconfig --kubeconfig="/file/path/to/kubeconfig"
|
36
|
+
$ uffizzi cluster update-kubeconfig my-cluster --kubeconfig="/file/path/to/kubeconfig"
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.\" generated with Ronn-NG/v0.9.1
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
+
.TH "UFFIZZI\-CLUSTER\-WAKE" "" "November 2023" ""
|
4
|
+
.SH "NAME"
|
5
|
+
\fBuffizzi\-cluster\-wake\fR
|
6
|
+
.P
|
7
|
+
$ uffizzi cluster wake \-h uffizzi\-cluster\-wake \- wake a cluster that is sleeping ================================================================
|
8
|
+
.SH "SYNOPSIS"
|
9
|
+
.nf
|
10
|
+
uffizzi cluster wake [CLUSTER_NAME]
|
11
|
+
.fi
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
.nf
|
14
|
+
Scales up a Uffizzi cluster to its original resource
|
15
|
+
utilization from zero (see \'uffizzi cluster sleep \-h\')\.
|
16
|
+
If no CLUSTER_NAME is specified, the kubeconfig current
|
17
|
+
context is used\.
|
18
|
+
|
19
|
+
For more information on Uffizzi clusters, see:
|
20
|
+
https://docs\.uffizzi\.com/references/cli/
|
21
|
+
.fi
|
22
|
+
.SH "OPTIONS"
|
23
|
+
.nf
|
24
|
+
CLUSTER_NAME
|
25
|
+
The name of the target Uffizzi cluster
|
26
|
+
.fi
|
27
|
+
.SH "EXAMPLES"
|
28
|
+
.nf
|
29
|
+
To wake the Uffizzi cluster in the current context, run:
|
30
|
+
|
31
|
+
$ uffizzi cluster wake
|
32
|
+
|
33
|
+
To wake a Uffizzi cluster outside the current context, run:
|
34
|
+
|
35
|
+
$ uffizzi cluster wake my\-cluster
|
36
|
+
.fi
|
37
|
+
|
data/man/uffizzi-dev
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
.\" generated with Ronn-NG/v0.9.1
|
2
|
+
.\" http://github.com/apjanke/ronn-ng/tree/0.9.1
|
3
|
+
.TH "UFFIZZI\-DEV\-DELETE" "" "November 2023" ""
|
4
|
+
.SH "NAME"
|
5
|
+
\fBuffizzi\-dev\-delete\fR
|
6
|
+
.P
|
7
|
+
uffizzi dev delete \-h uffizzi\-dev\-delete \- delete a development environment ================================================================
|
8
|
+
.SH "SYNOPSIS"
|
9
|
+
.nf
|
10
|
+
uffizzi dev delete
|
11
|
+
.fi
|
12
|
+
.SH "DESCRIPTION"
|
13
|
+
.nf
|
14
|
+
Deletes a dev environment and associated Uffizzi
|
15
|
+
cluster resources, including any persistent
|
16
|
+
volumes, and the namespace itself\. The Uffizzi
|
17
|
+
cluster config is deleted from the kubeconfig file\.
|
18
|
+
|
19
|
+
For more information on Uffizzi clusters, see:
|
20
|
+
https://docs\.uffizzi\.com/references/cli/
|
21
|
+
.fi
|
22
|
+
.SH "FLAGS"
|
23
|
+
.nf
|
24
|
+
\-\-help, \-h
|
25
|
+
Show this message and exit\.
|
26
|
+
.fi
|
27
|
+
.SH "EXAMPLES"
|
28
|
+
.nf
|
29
|
+
To delete a dev environment, run:
|
30
|
+
|
31
|
+
$ uffizzi dev delete
|
32
|
+
.fi
|
33
|
+
|