Skip to content

Commit 804448b

Browse files
authored
Nodepool cli cloud layer etc. (#137)
Nodepool cli cloud layer etc. Reviewed-by: None <None> Reviewed-by: Rodion Gyrbu <[email protected]> Reviewed-by: Anton Sidelnikov <None> Reviewed-by: Tino Schr <None>
1 parent adbecc8 commit 804448b

File tree

8 files changed

+1410
-16
lines changed

8 files changed

+1410
-16
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/usr/bin/env python3
2+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
# not use this file except in compliance with the License. You may obtain
4+
# a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
# License for the specific language governing permissions and limitations
12+
# under the License.
13+
"""
14+
Create CCE Node Pool via OpenStack cloud layer
15+
"""
16+
import openstack
17+
18+
openstack.enable_logging(True)
19+
conn = openstack.connect(cloud='otc')
20+
21+
22+
pool = conn.create_cce_node_pool(
23+
autoscaling_enabled=False,
24+
availability_zone='random',
25+
billing_mode=0,
26+
cluster='bca73490-394c-11eb-8fe2-0255ac101123',
27+
count=0,
28+
flavor='s2.large.2',
29+
initial_node_count=0,
30+
k8s_tags={
31+
"muh": "kuh"},
32+
ssh_key='sshkey-pub',
33+
name='test',
34+
os='CentOS 7.7',
35+
root_volume_size=40,
36+
root_volume_type='SATA',
37+
network_id='25d24fc8-d019-4a34-9fff-0a09fde6a123',
38+
tags=[
39+
{
40+
'key': 'hellokey1',
41+
'value': 'hellovalue1'
42+
}, {
43+
'key': 'hellokey2',
44+
'value': 'hellovalue2'
45+
}],
46+
data_volumes=[
47+
{
48+
'volumetype': 'SATA',
49+
'size': 120,
50+
}, {
51+
'volumetype': 'SATA',
52+
'size': 100,
53+
'encrypted': True,
54+
'cmk_id': '5b16304e-aa0f-488e-9c9e-7d2402def123'
55+
}]
56+
)
57+
print(pool)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
3+
# not use this file except in compliance with the License. You may obtain
4+
# a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11+
# License for the specific language governing permissions and limitations
12+
# under the License.
13+
"""
14+
Delete CCE node pool in cloud layer
15+
"""
16+
import openstack
17+
18+
openstack.enable_logging(True)
19+
conn = openstack.connect(cloud='otc')
20+
21+
22+
cluster = 'bca73490-394c-11eb-8fe2-0255ac101123'
23+
pool = '58d24fde-4042-11eb-8fea-0255ac101123'
24+
conn.delete_cce_node_pool(
25+
cluster=cluster,
26+
node_pool=pool)

0 commit comments

Comments
 (0)