Skip to content

Commit 669de79

Browse files
committed
feat(ocboot): support LightEdge product version
1 parent 0260682 commit 669de79

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

lib/ocboot.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@
4343

4444
KEY_STACK_FULLSTACK = 'FullStack'
4545
KEY_STACK_EDGE = 'Edge'
46+
KEY_STACK_LIGHT_EDGE = 'LightEdge'
4647
KEY_STACK_CMP = 'CMP'
47-
KEY_STACK_LIST = [KEY_STACK_FULLSTACK, KEY_STACK_EDGE, KEY_STACK_CMP]
48+
KEY_STACK_LIST = [KEY_STACK_FULLSTACK, KEY_STACK_EDGE, KEY_STACK_LIGHT_EDGE, KEY_STACK_CMP]
4849
KEY_TARGET_EDITION = 'TARGET_EDITION'
4950

5051
KEY_USER_DNS = 'user_dns'
@@ -484,12 +485,14 @@ class PrimaryMasterConfig(OnecloudConfig):
484485
# Cloud Management Platform product
485486
PRODUCT_VERSION_CMP = "CMP"
486487
# Private Cloud Edge on-premise product
487-
PRODUCT_VERSION_Edge = "Edge"
488+
PRODUCT_VERSION_EDGE = "Edge"
489+
PRODUCT_VERSION_LIGHT_EDGE = "LightEdge"
488490

489491
PRODUCT_VERSIONS = [
490492
PRODUCT_VERSION_FULL_STACK,
491493
PRODUCT_VERSION_CMP,
492-
PRODUCT_VERSION_Edge,
494+
PRODUCT_VERSION_EDGE,
495+
PRODUCT_VERSION_LIGHT_EDGE,
493496
]
494497

495498
def __init__(self, config, bastion_host=None):

onecloud/roles/primary-master-node/setup_cloud/tasks/k8s_create_cluster.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
name: utils/sync-user/on
44

55
- name: "Create essential services, wait for a few minutes. You can open another terminal and execute `kubectl get pods -n onecloud -w` to watch the process."
6-
shell: "/opt/yunion/bin/ocadm cluster create {{ init_cluster_args }} --wait"
6+
shell: "/opt/yunion/bin/ocadm cluster create {{ init_cluster_args }}"
77
retries: 6
88
delay: 10
9+
10+
- name: "patch product version to {{ product_version }} "
11+
shell: |
12+
KUBECONFIG={{ENV_KUBECONFIG}} kubectl -n onecloud patch onecloudcluster default --type='json' -p '[{"op": "replace", "path": "/spec/productVersion", "value": {{ product_version }} }]'

onecloud/roles/primary-master-node/setup_cloud/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301
delay: 15
302302
failed_when: false
303303
when:
304-
- product_version | default("") in ['FullStack', 'Edge']
304+
- product_version | default("") in ['FullStack', 'Edge', 'LightEdge']
305305

306306
- name: rm sync-user option
307307
include_role:

onecloud/roles/utils/onecloud-waiter/templates/wait-onecloud-services.sh.j2

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ services=(
1111
apigateway
1212
kubeserver
1313
default-web-
14-
cloudmon
1514
webconsole
1615
climc
1716
)

run.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def generate_config(
396396
'user': username,
397397
ocboot.KEY_HOSTNAME: ipv4,
398398
}
399-
enable_host = produc_stack in [ocboot.KEY_STACK_FULLSTACK, ocboot.KEY_STACK_EDGE]
399+
enable_host = produc_stack in [ocboot.KEY_STACK_FULLSTACK, ocboot.KEY_STACK_EDGE, ocboot.KEY_STACK_LIGHT_EDGE]
400400
extra_pri_dict = {
401401
'controlplane_host': ipv4,
402402
'db_host': ipv4,
@@ -437,8 +437,8 @@ def get_args():
437437
global parser
438438
parser = argparse.ArgumentParser()
439439
parser.add_argument('STACK', metavar="stack", type=str, nargs=1,
440-
help="Choose the product type from ['full', 'cmp', 'virt']",
441-
choices=['full', 'cmp', 'virt'])
440+
help="Choose the product type from ['full', 'cmp', 'virt', 'light-virt']",
441+
choices=['full', 'cmp', 'virt', 'light-virt'])
442442
parser.add_argument('IP_CONF', metavar="ip_conf", type=str, nargs='?',
443443
help="Input the target IPv4 or Config file")
444444
parser.add_argument('--offline-data-path', nargs='?',
@@ -534,6 +534,7 @@ def main():
534534
'full': ocboot.KEY_STACK_FULLSTACK,
535535
'cmp': ocboot.KEY_STACK_CMP,
536536
'virt': ocboot.KEY_STACK_EDGE,
537+
'light-virt': ocboot.KEY_STACK_LIGHT_EDGE,
537538
}
538539

539540
if not args.k8s_v115:

0 commit comments

Comments
 (0)