Skip to content

Commit

Permalink
Merge pull request #5 from QingCloudAppcenter/feature/storage-node
Browse files Browse the repository at this point in the history
Add Storage Node Role
  • Loading branch information
hlwanghl authored Nov 29, 2018
2 parents fbbdcef + b6121fc commit e15fb32
Show file tree
Hide file tree
Showing 31 changed files with 342 additions and 80 deletions.
7 changes: 0 additions & 7 deletions 1.1.1/vm-image/etc/confd/conf.d/hosts.toml

This file was deleted.

3 changes: 0 additions & 3 deletions 1.1.1/vm-image/etc/confd/templates/env.sh.tmpl

This file was deleted.

78 changes: 66 additions & 12 deletions 1.1.1/app/cluster.json.mustache → app/cluster.json.mustache
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": {{cluster.name}},
"description": {{cluster.description}},
"upgrade_policy": ["appv-sn0liyi6","appv-9we6rg37","appv-32b0fb93","appv-kilcnvix"],
"upgrade_policy": [ "appv-t2kn8lrz", "appv-sn0liyi6", "appv-9we6rg37", "appv-32b0fb93", "appv-kilcnvix" ],
"upgrade_roles": { "add": [ "storage_node" ] },
"vxnet": {{cluster.vxnet}},
"nodes": [{
"role": "log_node",
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-hpp0n6xj"
"image": "img-8fmo1vww"
},
"instance_class": {{cluster.log_node.instance_class}},
"count": 1,
Expand All @@ -35,13 +36,57 @@
"cmd": "/opt/harbor/bin/manager.sh restart /opt/harbor/bin/docker-compose.log.yml"
}
}
},
{
}, {
"role": "storage_node",
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-8fmo1vww"
},
"instance_class": {{cluster.storage_node.instance_class}},
"count": {{cluster.storage_node.count}},
"cpu": {{cluster.storage_node.cpu}},
"memory": {{cluster.storage_node.memory}},
"volume": {
"size": {{cluster.storage_node.volume_size}},
"mount_point": "/data/registry",
"mount_options": "defaults,noatime",
"filesystem": "ext4",
"class": {{cluster.storage_node.volume_class}}
},
"user_access": false,
"services": {
"init": {
"order": 1,
"cmd": "/opt/harborapp/bin/app.sh init storage"
},
"start": {
"order": 1,
"cmd": "/opt/harborapp/bin/app.sh reset storage"
},
"stop": {
"order": 4,
"cmd": "/opt/harborapp/bin/app.sh stop storage"
},
"restart": {
"cmd": "/opt/harborapp/bin/app.sh reset storage"
}
},
"health_check": {
"enable": true,
"interval_sec": 60,
"timeout_sec": 10,
"action_timeout_sec": 30,
"healthy_threshold": 2,
"unhealthy_threshold": 2,
"check_cmd": "/opt/harborapp/bin/app.sh check storage"
}
}, {
"role": "db_node",
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-hpp0n6xj"
"image": "img-8fmo1vww"
},
"instance_class": {{cluster.db_node.instance_class}},
"count": 1,
Expand Down Expand Up @@ -74,7 +119,7 @@
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-hpp0n6xj"
"image": "img-8fmo1vww"
},
"instance_class": {{cluster.cache_node.instance_class}},
"count": 1,
Expand All @@ -99,7 +144,7 @@
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-hpp0n6xj"
"image": "img-8fmo1vww"
},
"instance_class": {{cluster.job_node.instance_class}},
"count": {{cluster.job_node.count}},
Expand All @@ -108,17 +153,21 @@
"advanced_actions": ["scale_horizontal"],
"user_access": false,
"services": {
"init": {
"order": 4,
"cmd": "/opt/harborapp/bin/app.sh init job"
},
"start": {
"order": 4,
"cmd": "/opt/harbor/bin/manager.sh start /opt/harbor/bin/docker-compose.job.yml"
"cmd": "/opt/harborapp/bin/app.sh start job"
},
"stop": {
"order": 2,
"cmd": "/opt/harbor/bin/manager.sh stop /opt/harbor/bin/docker-compose.job.yml"
},
"restart": {
"order": 2,
"cmd": "/opt/harbor/bin/manager.sh restart /opt/harbor/bin/docker-compose.job.yml"
"cmd": "/opt/harborapp/bin/app.sh restart job"
}
},
"env": {
Expand All @@ -128,14 +177,15 @@
"QS_SECRET": {{env.QS_SECRET}},
"QS_BUCKET": {{env.QS_BUCKET}},
"QS_ZONE": {{env.QS_ZONE}},
"QS_URL": {{env.QS_URL}},
"QS_ROOT_DIRECTORY": {{env.QS_ROOT_DIRECTORY}}
}
},{
"role": "web_node",
"container": {
"type": "kvm",
"zone": "pek3a",
"image": "img-hpp0n6xj"
"image": "img-8fmo1vww"
},
"instance_class": {{cluster.web_node.instance_class}},
"count": {{cluster.web_node.count}},
Expand All @@ -145,16 +195,20 @@
"advanced_actions": ["scale_horizontal"],
"user_access": false,
"services": {
"init": {
"order": 3,
"cmd": "/opt/harborapp/bin/app.sh init web"
},
"start": {
"order": 3,
"cmd": "/opt/harbor/bin/manager.sh start /opt/harbor/bin/docker-compose.web.yml"
"cmd": "/opt/harborapp/bin/app.sh start web"
},
"stop": {
"order": 1,
"cmd": "/opt/harbor/bin/manager.sh stop /opt/harbor/bin/docker-compose.web.yml"
},
"restart": {
"cmd": "/opt/harbor/bin/manager.sh restart /opt/harbor/bin/docker-compose.web.yml"
"cmd": "/opt/harborapp/bin/app.sh restart web"
},
"cleanImage": {
"type": "custom",
Expand Down
114 changes: 96 additions & 18 deletions 1.1.1/app/config.json → app/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,81 @@
],
"required": "yes"
}]
}, {
"key": "storage_node",
"description": "",
"label": "storage_node",
"type": "array",
"properties": [{
"key": "cpu",
"label": "CPU",
"description": "CPUs of each node",
"type": "integer",
"default": 2,
"range": [
1,
2,
4,
8
],
"required": "yes"
}, {
"key": "memory",
"label": "Memory",
"description": "Memory of each node",
"type": "integer",
"default": 1024,
"range": [
1024,
2048,
4096,
8192
],
"required": "yes"
}, {
"key": "count",
"label": "Count",
"description": "If QingStor will be used as Harbor's backend, then DO NOT create this node; otherwise please create one; default to 0 meaning not to create",
"type": "integer",
"default": 0,
"range": [
0,
1
],
"changeable": false,
"required": "yes"
}, {
"key": "instance_class",
"label": "Instance Class",
"description": "The instance type for the cluster to run, such as high performance, high performance plus",
"type": "integer",
"default": 0,
"range": [
0,
1
],
"required": "yes"
}, {
"key": "volume_class",
"label": "Volume Class",
"description": "The volume type for each instance,such as high performance,high performance plus",
"type": "integer",
"default": 0,
"range": [
0,
3
],
"required": "yes"
}, {
"key": "volume_size",
"label": "Volume Size",
"description": "The volume size for each instance",
"type": "integer",
"default": 50,
"min": 10,
"step": 10,
"required": "yes"
}]
}, {
"key": "job_node",
"description": "",
Expand Down Expand Up @@ -228,8 +303,10 @@
"description": "Number of nodes for replica cluster to create",
"type": "integer",
"default": 0,
"max": 1,
"min": 0,
"range": [
0,
1
],
"required": "yes"
}, {
"key": "instance_class",
Expand Down Expand Up @@ -315,50 +392,51 @@
"properties": [{
"key": "HARBOR_HOST",
"label": "HARBOR_HOST",
"description": "The address of harbor service",
"description": "The address of harbor service, e.g. https://harbor.example.com (notice not to end with slash '/')",
"type": "string",
"changeable": true,
"default": "http://127.0.0.1",
"pattern": "^https?://[^:/]+(:[0-9]+)?$",
"required": "yes"
}, {
"key": "QS_ACCESS",
"label": "QS_ACCESS",
"description": "Provide the accesskey to connect QingStor for storing Image data",
"description": "Provide the accesskey to connect QingStor for storing Image data; keep untouched if not using QingStor",
"type": "string",
"changeable": true,
"default": "",
"default": "accesskey",
"required": "yes"
}, {
"key": "QS_SECRET",
"label": "QS_SECRET",
"description": "Provide the secretkey to connect QingStor for storing Image data",
"description": "Provide the secretkey to connect QingStor for storing Image data; keep untouched if not using QingStor",
"type": "password",
"changeable": true,
"default": "",
"default": "secretkey",
"required": "yes"
}, {
"key": "QS_ZONE",
"label": "QS_ZONE",
"description": "Provide the zone of bucket to use",
"type": "string",
"changeable": true,
"default": "pek3a",
"required": "yes"
}, {
"key": "QS_BUCKET",
"label": "QS_BUCKET",
"description": "Provide the bucket name to use",
"description": "Provide the bucket name to use; keep untouched if not using QingStor",
"type": "string",
"changeable": false,
"default": "",
"default": "harbor",
"required": "yes"
}, {
"key": "QS_ROOT_DIRECTORY",
"label": "QS_ROOT_DIRECTORY",
"description": "The root direcotry or prefix for Harbor image storage",
"description": "The root direcotry or prefix for Harbor image storage; keep untouched if not using QingStor",
"type": "string",
"changeable": false,
"default": "",
"required": "yes"
}, {
"key": "QS_ZONE",
"label": "QS_ZONE",
"description": "Provide the zone of bucket to use",
"type": "string",
"changeable": true,
"default": "pek3a",
"required": "no"
}, {
"key": "QS_URL",
Expand Down
6 changes: 1 addition & 5 deletions 1.1.1/app/locale/en.json → app/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
"The instance type for the cluster to run, such as high performance, high performance plus": "The instance type for the cluster to run, such as high performance, high performance plus",
"The volume type for each instance,such as high performance,high performance plus":"The volume type for each instance,such as high performance,high performance plus",
"access_key_id": "access_key_id",
"Provide the secretkey to connect QingStor for storing Image data": "Provide the Secret_Access_Key to connect QingStor for storing Image data",
"secret_access_key": "secret_access_key",
"Provide the accesskey to connect QingStor for storing Image data": "Provide the Access_Key_ID to connect QingStor for storing Image data",
"zone": "zone",
"Provide the zone of bucket to use": "Provide the zone of bucket to use, see detail from User-Guide",
"bucket": "bucket",
"Provide the bucket name to use": "Provide the bucket name to use",
"The root direcotry or prefix for Harbor image storage":"The root direcotry or prefix for Harbor image storage",
"access_address": "access_address",
"volume size": "volume size",
"Volume Size":"Volume Size",
Expand All @@ -47,13 +43,13 @@
"Number of nodes for replica cluster to create":"Number of nodes for replica cluster to create, unworkable when set 0",
"web_node":"Main Service Node",
"log_node":"Log Node",
"storage_node":"Storage Node",
"Configuration properties":"Configuration properties",
"HARBOR_HOST":"Harbor Host",
"HARBOR_MYSQL_PW":"MySQL Password",
"The password of Database MySQL":"Password of Harbor Database MySQL",
"REGISTRY_READONLY":"Readonly",
"Turn on readonly mode,only allow pull action":"Turn on readonly mode,only allow pull action,use it when GC",
"The address of harbor service":"The address of harbor service,",
"QS_ACCESS":"Access_Key_ID",
"QS_SECRET":"Secret_Access_Key",
"QS_BUCKET":"QingStor Bucket",
Expand Down
Loading

0 comments on commit e15fb32

Please sign in to comment.