Skip to content

Commit

Permalink
Merge pull request #1410 from zexi/pv-light-edge
Browse files Browse the repository at this point in the history
feat(ocboot): support LightEdge product version
  • Loading branch information
zexi authored Feb 18, 2025
2 parents 0260682 + 669de79 commit 95968b3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
9 changes: 6 additions & 3 deletions lib/ocboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@

KEY_STACK_FULLSTACK = 'FullStack'
KEY_STACK_EDGE = 'Edge'
KEY_STACK_LIGHT_EDGE = 'LightEdge'
KEY_STACK_CMP = 'CMP'
KEY_STACK_LIST = [KEY_STACK_FULLSTACK, KEY_STACK_EDGE, KEY_STACK_CMP]
KEY_STACK_LIST = [KEY_STACK_FULLSTACK, KEY_STACK_EDGE, KEY_STACK_LIGHT_EDGE, KEY_STACK_CMP]
KEY_TARGET_EDITION = 'TARGET_EDITION'

KEY_USER_DNS = 'user_dns'
Expand Down Expand Up @@ -484,12 +485,14 @@ class PrimaryMasterConfig(OnecloudConfig):
# Cloud Management Platform product
PRODUCT_VERSION_CMP = "CMP"
# Private Cloud Edge on-premise product
PRODUCT_VERSION_Edge = "Edge"
PRODUCT_VERSION_EDGE = "Edge"
PRODUCT_VERSION_LIGHT_EDGE = "LightEdge"

PRODUCT_VERSIONS = [
PRODUCT_VERSION_FULL_STACK,
PRODUCT_VERSION_CMP,
PRODUCT_VERSION_Edge,
PRODUCT_VERSION_EDGE,
PRODUCT_VERSION_LIGHT_EDGE,
]

def __init__(self, config, bastion_host=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
name: utils/sync-user/on

- 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."
shell: "/opt/yunion/bin/ocadm cluster create {{ init_cluster_args }} --wait"
shell: "/opt/yunion/bin/ocadm cluster create {{ init_cluster_args }}"
retries: 6
delay: 10

- name: "patch product version to {{ product_version }} "
shell: |
KUBECONFIG={{ENV_KUBECONFIG}} kubectl -n onecloud patch onecloudcluster default --type='json' -p '[{"op": "replace", "path": "/spec/productVersion", "value": {{ product_version }} }]'
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
delay: 15
failed_when: false
when:
- product_version | default("") in ['FullStack', 'Edge']
- product_version | default("") in ['FullStack', 'Edge', 'LightEdge']

- name: rm sync-user option
include_role:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services=(
apigateway
kubeserver
default-web-
cloudmon
webconsole
climc
)
Expand Down
7 changes: 4 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ def generate_config(
'user': username,
ocboot.KEY_HOSTNAME: ipv4,
}
enable_host = produc_stack in [ocboot.KEY_STACK_FULLSTACK, ocboot.KEY_STACK_EDGE]
enable_host = produc_stack in [ocboot.KEY_STACK_FULLSTACK, ocboot.KEY_STACK_EDGE, ocboot.KEY_STACK_LIGHT_EDGE]
extra_pri_dict = {
'controlplane_host': ipv4,
'db_host': ipv4,
Expand Down Expand Up @@ -437,8 +437,8 @@ def get_args():
global parser
parser = argparse.ArgumentParser()
parser.add_argument('STACK', metavar="stack", type=str, nargs=1,
help="Choose the product type from ['full', 'cmp', 'virt']",
choices=['full', 'cmp', 'virt'])
help="Choose the product type from ['full', 'cmp', 'virt', 'light-virt']",
choices=['full', 'cmp', 'virt', 'light-virt'])
parser.add_argument('IP_CONF', metavar="ip_conf", type=str, nargs='?',
help="Input the target IPv4 or Config file")
parser.add_argument('--offline-data-path', nargs='?',
Expand Down Expand Up @@ -534,6 +534,7 @@ def main():
'full': ocboot.KEY_STACK_FULLSTACK,
'cmp': ocboot.KEY_STACK_CMP,
'virt': ocboot.KEY_STACK_EDGE,
'light-virt': ocboot.KEY_STACK_LIGHT_EDGE,
}

if not args.k8s_v115:
Expand Down

0 comments on commit 95968b3

Please sign in to comment.