sct 0.1.29 → 0.1.35
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/cluster/lib/cluster/runner.rb +45 -3
- data/sct/lib/sct/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 730e908365c08b32f6c0bcffce79d1497b2139190f68980cb2c3d340a233dee8
|
4
|
+
data.tar.gz: 813a1f8db688ecd7ad902bf87d2415c4000933c2aac86957d08b43fe0513a8e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e813fe74dd20bc360a2644cf57bf4731b122b0916e4ccfb64259fad0e69d9f5238741b9eafcd6fa0b1a523dbd5f617b83d55dee709a61ce290fdf07e47b8031
|
7
|
+
data.tar.gz: ab9e05165e62681cb5a851eac335320ef44030351482ab7307a36fad1b900f6fe8036a10b72d593d88c6d6edd3e2fc3b3b7c5a7fda5daae5484e77606ecab0f9
|
@@ -19,6 +19,9 @@ module Cluster
|
|
19
19
|
wait_for_ingress_ip
|
20
20
|
run_command "kubectl apply -f ~/development/spend-cloud/k8s/dependencies.yml"
|
21
21
|
wait_for_pods
|
22
|
+
create_keycloak_database_user
|
23
|
+
run_command "kubectl apply -f ~/development/spend-cloud/k8s/keycloak-server.yml"
|
24
|
+
wait_for_pods
|
22
25
|
run_command "kubectl apply -f ~/development/spend-cloud/k8s/"
|
23
26
|
end
|
24
27
|
|
@@ -89,7 +92,7 @@ module Cluster
|
|
89
92
|
|
90
93
|
def start_cluster
|
91
94
|
if SctCore::Helper.operatingSystem == SctCore::Helper::MAC_OS
|
92
|
-
run_command "minikube start --driver=
|
95
|
+
run_command "minikube start --driver=hyperkit --vm=true --cpus=$(sysctl -n hw.ncpu) --memory=8G"
|
93
96
|
else
|
94
97
|
run_command "minikube start --driver=docker --cpus=$(cat /proc/cpuinfo | grep processor | wc -l) --memory=3G"
|
95
98
|
end
|
@@ -98,9 +101,14 @@ module Cluster
|
|
98
101
|
|
99
102
|
def post_start
|
100
103
|
wait_for_pods
|
101
|
-
|
104
|
+
copy_proactive_accounts_file
|
105
|
+
if SctCore::Helper.operatingSystem == SctCore::Helper::UBUNTU
|
106
|
+
UI.success("\nAdding SSH tunnel to port 443!")
|
107
|
+
run_command "sudo ssh -f -N -i $(minikube ssh-key) docker@$(minikube ip) -L 443:127.0.0.1:443"
|
108
|
+
end
|
109
|
+
# run_command "sudo sct hostfile"
|
102
110
|
run_command "minikube tunnel &", { out: "/dev/null", err: "/dev/null" } if SctCore::Helper::is_windows? # leave this running detached forever in the background
|
103
|
-
UI.success("\n✔️ You can visit your environment at 👉 https://spend-cloud.spend.cloud
|
111
|
+
UI.success("\n✔️ You can visit your environment at 👉 https://spend-cloud.dev.spend.cloud 👌")
|
104
112
|
end
|
105
113
|
|
106
114
|
def enable_addons
|
@@ -292,6 +300,40 @@ module Cluster
|
|
292
300
|
return Terminal::Table.new title: "Pods (namespace: #{namespace})".green, headings: ['Name', 'Status', 'Replicas ready'], rows: rows
|
293
301
|
end
|
294
302
|
|
303
|
+
def copy_proactive_accounts_file
|
304
|
+
container_name = "proactive-config"
|
305
|
+
pod_id = pods().select {|pod| pod[:name].start_with?(container_name)}.first[:name]
|
306
|
+
|
307
|
+
begin
|
308
|
+
UI.important("Checking ProActive accounts file...")
|
309
|
+
run_command "kubectl exec #{pod_id} -- test -e /data/proactive_accounts.ini", [:out, :err] => File::NULL
|
310
|
+
rescue => e
|
311
|
+
UI.important("Copying ProActive accounts file to deployments...")
|
312
|
+
src_path = "#{Dir.home()}/development/spend-cloud/k8s/conf/proactive_accounts.ini"
|
313
|
+
command = "kubectl cp #{src_path} #{pod_id}:/data/proactive_accounts.ini -c #{container_name}"
|
314
|
+
run_command command
|
315
|
+
end
|
316
|
+
|
317
|
+
UI.success("ProActive accounts file is available")
|
318
|
+
end
|
319
|
+
|
320
|
+
def create_keycloak_database_user
|
321
|
+
container_name = "mysql-service"
|
322
|
+
pod_id = pods().select {|pod| pod[:name].start_with?(container_name)}.first[:name]
|
323
|
+
|
324
|
+
UI.important("Creating keycloak user")
|
325
|
+
create_user = 'CREATE USER "keycloak"@"%" IDENTIFIED BY "keycloak";'
|
326
|
+
run_command "kubectl exec #{pod_id} -- mysql -e '#{create_user}' >> /dev/null"
|
327
|
+
|
328
|
+
UI.important("Creating keycloak database")
|
329
|
+
create_database = "CREATE DATABASE keycloak CHARACTER SET utf8 COLLATE UTF8_UNICODE_CI;"
|
330
|
+
run_command "kubectl exec #{pod_id} -- mysql -e '#{create_database}' >> /dev/null"
|
331
|
+
|
332
|
+
UI.important("Granting privileges to keycloak user")
|
333
|
+
grant_privileges = 'GRANT ALL PRIVILEGES ON keycloak.* TO "keycloak"@"%";'
|
334
|
+
run_command "kubectl exec #{pod_id} -- mysql -e '#{grant_privileges}' >> /dev/null"
|
335
|
+
end
|
336
|
+
|
295
337
|
def run_command command, options = {}
|
296
338
|
if ! system command, options
|
297
339
|
raise command.red
|
data/sct/lib/sct/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Reshad Farid
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
- !ruby/object:Gem::Version
|
257
257
|
version: '0'
|
258
258
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
259
|
+
rubygems_version: 3.1.2
|
260
260
|
signing_key:
|
261
261
|
specification_version: 4
|
262
262
|
summary: Spend Cloud Tool.
|