This commit is contained in:
root 2023-08-29 15:50:57 +08:00
commit ccccd5cd60
16 changed files with 1634 additions and 207 deletions

View File

@ -95,4 +95,4 @@
`systemctl stop firewalld` #关闭防火墙 `systemctl stop firewalld` #关闭防火墙
`sh tools/docker/install.sh` `sh tools/docker/install.sh`
2. 运行ansible镜像执行k8s安装 2. 运行ansible镜像执行k8s安装
`/opt/k8s/bin/docker run --name ansible -it --privileged -v /root/k8s-install:/etc/ansible toyangdon/ansible:latest` #进入容器内执行ansible脚本 `/opt/k8s/bin/docker run --name ansible -it --privileged -v /root/ccyunchina-deploy:/etc/ansible toyangdon/ansible:latest` #进入容器内执行ansible脚本

3
hosts
View File

@ -77,3 +77,6 @@ monitorEmailPort=465
monitorEmailUsername=hnck monitorEmailUsername=hnck
monitorEmailFrom=hnck@greatwall.com.cn monitorEmailFrom=hnck@greatwall.com.cn
monitorEmailPassword=Eghucn-91406 monitorEmailPassword=Eghucn-91406
#ES 索引使用的mysql binlog服务器root密码, 取mysql的第一个服务器的密码
mysqlBinlogServerPassword=greatwall@123

View File

@ -6,8 +6,7 @@ def projectProperties = [
string(name: 'VERSION', defaultValue: "1.0", description: '包版本'), string(name: 'VERSION', defaultValue: "1.0", description: '包版本'),
string(name: 'GENERATE_IMAGES_LISTS', defaultValue: "true", description: '是否生成images_list文件'), string(name: 'GENERATE_IMAGES_LISTS', defaultValue: "true", description: '是否生成images_list文件'),
string(name: 'INCLUDE_APPS_IMAGES', defaultValue: "true", description: '是否包含应用镜像'), string(name: 'INCLUDE_APPS_IMAGES', defaultValue: "true", description: '是否包含应用镜像'),
string(name: 'DEST_PATH_PREFIX', defaultValue: "/var/jenkins_home", description: '打包文件保存目录'), string(name: 'DEST_PATH_PREFIX', defaultValue: "/var/jenkins_home", description: '打包文件保存目录')
string(name: 'HARBOR_SRC', defaultValue: 'docker.io', description: '源镜像仓库')
]) ])
] ]
@ -16,7 +15,7 @@ properties(projectProperties)
node('master') { node('master') {
//部署文件路径 //部署文件路径
DEPLOY_PROJECT_PATH="${WORKSPACE}/k8s_deploy"; DEPLOY_PROJECT_PATH="${WORKSPACE}/ccyunchina-deploy";
//镜像文件保存目录 //镜像文件保存目录
IMAGES_PATH="${DEPLOY_PROJECT_PATH}/images" IMAGES_PATH="${DEPLOY_PROJECT_PATH}/images"
@ -31,7 +30,7 @@ node('master') {
DEST_PATH="${DEST_PATH_PREFIX}/k8s_data/${VERSION}" DEST_PATH="${DEST_PATH_PREFIX}/k8s_data/${VERSION}"
//源harobr镜像库地址 //源harobr镜像库地址
HARBOR_SRC="docker.io" HARBOR_SRC="dev-docker-registry.ccyunchina.com"
stage('拉取k8s部署文件') { stage('拉取k8s部署文件') {
@ -39,7 +38,7 @@ node('master') {
cleanWs() cleanWs()
} }
dir(DEPLOY_PROJECT_PATH){ dir(DEPLOY_PROJECT_PATH){
git branch: "${BRANCH_NAME}", url: 'https://git.trustie.net/toyangdon/proprietary-cloud-deploy.git' git branch: "${BRANCH_NAME}", url: 'https://gitlink.org.cn/toyangdon/ccyunchina-deploy.git'
} }
} }
@ -61,21 +60,21 @@ node('master') {
} }
stage('拉取并导出ansible镜像') { stage('拉取并导出ansible镜像') {
sh "docker pull toyangdon/ansible:latest" sh "docker pull dev-docker-registry.ccyunchina.com/toyangdon/ansible:latest"
sh "docker save toyangdon/ansible:latest -o k8s_deploy/ansible_image.tar" sh "docker save dev-docker-registry.ccyunchina.com/toyangdon/ansible:latest -o ccyunchina-deploy/ansible_image.tar"
} }
stage('打包部署文件') { stage('打包部署文件') {
sh "rm -rf k8s_deploy/.git" sh "rm -rf ccyunchina-deploy/.git"
sh "tar --use-compress-program=pigz -cvpf k8s_deploy.tar.gz k8s_deploy" sh "tar --use-compress-program=pigz -cvpf ccyunchina-deploy.tar.gz ccyunchina-deploy"
} }
stage('归档部署文件'){ stage('归档部署文件'){
//根据版本号创建目录,如果目录已经存在则报错退出 //根据版本号创建目录,如果目录已经存在则报错退出
sh "mkdir -p ${DEST_PATH}" sh "mkdir -p ${DEST_PATH}"
sh "cp k8s_deploy.tar.gz ${DEST_PATH}/" sh "cp ccyunchina-deploy.tar.gz ${DEST_PATH}/"
} }
} }

View File

@ -1,6 +1,6 @@
--- ---
kind: StorageClass kind: StorageClass
apiVersion: storage.k8s.io/v1beta1 apiVersion: storage.k8s.io/v1
metadata: metadata:
name: gluster-heketi name: gluster-heketi
namespace: kube-system namespace: kube-system
@ -15,4 +15,3 @@ parameters:
{% else %} {% else %}
volumetype: replicate:{{ groups['kube-storage-node']|length }} volumetype: replicate:{{ groups['kube-storage-node']|length }}
{% endif %} {% endif %}
allowVolumeExpansion: "true"

View File

@ -38,7 +38,7 @@ es_api_image: uat/pumpkin-es-api-uat:RC-V2.5.20210629.34976.79
mall_api_image: uat/pumpkin-mall-api-uat:RC-V2.5.20210629.33594.14 mall_api_image: uat/pumpkin-mall-api-uat:RC-V2.5.20210629.33594.14
recruit_api_image: uat/pumpkin-recruit-api-uat:RC-V2.5.20210629.33596.11 recruit_api_image: uat/pumpkin-recruit-api-uat:RC-V2.5.20210629.33596.11
file_api_image: uat/pumpkin-file-api-uat:RC-V2.5.20210629.33592.25 file_api_image: uat/pumpkin-file-api-uat:RC-V2.5.20210629.33592.25
comment_api_image: uat/pumpkin-comment-api-uat:RC-V2.5.20210629.33589.20 comment_api_image: uat/pumpkin-comment-api-uat:RC-V2.5.20210629.33589.20
charts_api_image: uat/pumpkin-charts-api-uat:RC-V2.5.20210629.33587.10 charts_api_image: uat/pumpkin-charts-api-uat:RC-V2.5.20210629.33587.10
auth_image: uat/pumpkin-auth-uat:RC-V2.5.20210629.33581.33 auth_image: uat/pumpkin-auth-uat:RC-V2.5.20210629.33581.33
mcu_image: uat/pumpkin-mcu-uat:RC-V2.5.20210629.33605.12 mcu_image: uat/pumpkin-mcu-uat:RC-V2.5.20210629.33605.12

View File

@ -22,7 +22,6 @@
- daily-api - daily-api
- recruit-api - recruit-api
- gateway - gateway
- doc-api
- name: 创建组件文件 - name: 创建组件文件
template: src={{ item }} dest={{ base_dir }}/manifests/proprietary-cloud/{{item |relpath('/etc/ansible/roles/proprietary-cloud/templates')}} template: src={{ item }} dest={{ base_dir }}/manifests/proprietary-cloud/{{item |relpath('/etc/ansible/roles/proprietary-cloud/templates')}}
@ -48,7 +47,6 @@
- "{{ base_dir }}/roles/proprietary-cloud/templates/daily-api/*" - "{{ base_dir }}/roles/proprietary-cloud/templates/daily-api/*"
- "{{ base_dir }}/roles/proprietary-cloud/templates/recruit-api/*" - "{{ base_dir }}/roles/proprietary-cloud/templates/recruit-api/*"
- "{{ base_dir }}/roles/proprietary-cloud/templates/gateway/*" - "{{ base_dir }}/roles/proprietary-cloud/templates/gateway/*"
- "{{ base_dir }}/roles/proprietary-cloud/templates/doc-api/*"
- name: 部署组件 - name: 部署组件
shell: "{{bin_dir}}/kubectl apply -f {{ base_dir }}/manifests/proprietary-cloud/{{item}}/ -n {{namespace}}" shell: "{{bin_dir}}/kubectl apply -f {{ base_dir }}/manifests/proprietary-cloud/{{item}}/ -n {{namespace}}"
@ -72,9 +70,8 @@
- auth - auth
- campaigns-api - campaigns-api
- daily-api - daily-api
- recruit-api # - recruit-api
- gateway - gateway
- doc-api
- name: 创建cloud-servcie所需的命名空间 - name: 创建cloud-servcie所需的命名空间
shell: "{{bin_dir}}/kubectl create ns cloud-service" shell: "{{bin_dir}}/kubectl create ns cloud-service"

View File

@ -28,9 +28,10 @@
with_items: with_items:
- db.sql - db.sql
- user-data.sql - user-data.sql
- biz-data.sql
- init_config.sql - init_config.sql
- name: 执行初始化sql脚本 - name: 执行初始化sql脚本
shell: "cd {{base_dir}}/manifests/proprietary-cloud ; cat db.sql user-data.sql init_config.sql|{{bin_dir}}/kubectl exec -i -c mysql `{{bin_dir}}/kubectl get pods -l 'mysql.presslabs.org/cluster=mysql-cluster,role=master' -n {{namespace}} -o jsonpath='{.items[0].metadata.name}'` -n {{namespace}} -- mysql -u{{db_username}} -p{{db_password}} --default-character-set=utf8 " shell: "cd {{base_dir}}/manifests/proprietary-cloud ; cat db.sql user-data.sql biz-data.sql init_config.sql|{{bin_dir}}/kubectl exec -i -c mysql `{{bin_dir}}/kubectl get pods -l 'mysql.presslabs.org/cluster=mysql-cluster,role=master' -n {{namespace}} -o jsonpath='{.items[0].metadata.name}'` -n {{namespace}} -- mysql -u{{db_username}} -p{{db_password}} --default-character-set=utf8 "
- include_tasks : cloud.yml - include_tasks : cloud.yml

View File

@ -18,5 +18,5 @@
delay: 8 delay: 8
- name: 执行nacos sql脚本 - name: 执行nacos sql脚本
shell: "cat {{base_dir}}/manifests/proprietary-cloud/nacos.sql {{base_dir}}/manifests/proprietary-cloud/config.sql |{{bin_dir}}/kubectl exec -i -c mysql `{{bin_dir}}/kubectl get pods -l 'mysql.presslabs.org/cluster=mysql-cluster,role=master' -n {{namespace}} -o jsonpath='{.items[0].metadata.name}'` -n {{namespace}} -- mysql -u{{db_username}} -p{{db_password}} -D nacos --default-character-set=utf8 " shell: "cat {{base_dir}}/manifests/proprietary-cloud/nacos.sql {{base_dir}}/manifests/proprietary-cloud/config.sql |{{bin_dir}}/kubectl exec -i -c mysql `{{bin_dir}}/kubectl get pods -l 'mysql.presslabs.org/cluster=mysql-cluster,role=master' -n {{namespace}} -o jsonpath='{.items[0].metadata.name}'` -n {{namespace}} -- mysql -u{{db_username}} -p{{db_password}} -D nacos --default-character-set=utf8 "
ignore_errors: true ignore_errors: true

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,9 @@
DELETE FROM `pumpkin-cloud`.`cloud_region`;
INSERT INTO `pumpkin-cloud`.`cloud_region` (id, area_name, area_code, status, creator_id, create_time, update_time, remark, platform_type) VALUES (1, '一区', 'cn-cs-1', 1, 15, '2020-04-30 22:55:27', null, null, 'ZSTACK');
-- 插入区域cloud-serivce配置数据为了支持重复执行先删除后插入 -- 插入区域cloud-serivce配置数据为了支持重复执行先删除后插入
DELETE FROM `pumpkin-cloud`.z_cloud_db_region_settings; DELETE FROM `pumpkin-cloud`.z_cloud_db_region_settings;
INSERT INTO `pumpkin-cloud`.z_cloud_db_region_settings (id, region,create_time, update_time, k8s_master_url, k8s_oauth_token, external_ip) VALUES (1, '{{defaultRegionCode}}', now(), now(), 'https://{{MASTER_IP}}:{{MASTER_PORT}}', '{{k8s_admin_token.stdout}}', '{{MASTER_IP}}'); INSERT INTO `pumpkin-cloud`.z_cloud_db_region_settings (id, region,create_time, update_time, k8s_master_url, k8s_oauth_token, external_ip) VALUES (1, '{{defaultRegionCode}}', now(), now(), 'https://{{MASTER_IP}}:{{MASTER_PORT}}', '{{k8s_admin_token.stdout}}', '{{MASTER_IP}}');
@ -23,3 +28,17 @@ INSERT INTO app_category (category_name, parent_id, sort_no, status, create_time
INSERT INTO app_category (category_name, parent_id, sort_no, status, create_time, category_code, create_id) VALUES ('测试', 0, 62, 0, '2023-03-31 03:42:35', '16', 102); INSERT INTO app_category (category_name, parent_id, sort_no, status, create_time, category_code, create_id) VALUES ('测试', 0, 62, 0, '2023-03-31 03:42:35', '16', 102);
INSERT INTO app_category (category_name, parent_id, sort_no, status, create_time, category_code, create_id) VALUES ('测试', 29, 3, 0, '2023-04-05 03:51:05', '0201', 102); INSERT INTO app_category (category_name, parent_id, sort_no, status, create_time, category_code, create_id) VALUES ('测试', 29, 3, 0, '2023-04-05 03:51:05', '0201', 102);
use `pumpkin-user-0801`;
DELETE FROM `user` where mobile like '1771111111%'
INSERT INTO `user` (uid, wx_open_id, name, nick_name, mobile, password, salt, avatar, sex, status, source, profile, province, position, ip, ip_city, city, last_login_time, creator_id, create_time, update_time, zstack_password, zstack_uuid, invite_code, personal_id, identitification_status, email, original_uid, current_mobile, site_region, reg_topic, trustie_open_id, mac, keep_status) VALUES (1, null, '管理员账号', '管理员账号', '17711111111', 'rzivI6K7T60qNJ3ifOnNCab3BsULmHEql4WKBxuR78GTkva0J5%2BvmnuBid%2FzFUSl', '$2a$10$h1whGu', null, null, 0, null, null, null, null, '42.48.104.45', null, null, '2023-06-25 10:46:52', null, '2019-12-23 09:19:28', '2021-09-29 12:43:40', '$2a$10$APZWU.', '09661e8ac12c48afadfc89fe13fef35b', 168168, 17246775788042, 1, null, null, '17711111111', '430000', null, null, null, 0);
INSERT INTO `user` (uid, wx_open_id, name, nick_name, mobile, password, salt, avatar, sex, status, source, profile, province, position, ip, ip_city, city, last_login_time, creator_id, create_time, update_time, zstack_password, zstack_uuid, invite_code, personal_id, identitification_status, email, original_uid, current_mobile, site_region, reg_topic, trustie_open_id, mac, keep_status) VALUES (2, null, '普通业务账号', '普通业务账号', '17711111112', 'rzivI6K7T60qNJ3ifOnNCab3BsULmHEql4WKBxuR78GTkva0J5%2BvmnuBid%2FzFUSl', '$2a$10$h1whGu', null, null, 0, null, null, null, null, '42.48.104.45', null, null, '2023-06-25 10:46:52', null, '2019-12-23 09:19:28', '2021-09-29 12:43:40', '$2a$10$APZWU.', '09661e8ac12c48afadfc89fe13fef35b', 168168, 17246775788042, 1, null, null, '17711111112', '430000', null, null, null, 0);
DELETE FROM enterprise where id=0;
INSERT INTO enterprise (id, enterprise_identification_id, enterprise_name, certificate_type, certificate_url, certificate_code, legal_person, legal_person_id_card_no, identity_type, identity_card_front_url, identity_card_verso_url, authorization_url, creator_id, create_time, update_id, update_time, account_id, account_name, parent_id, pay_discount, points_discount, other_pay_discount) VALUES (0, 0, '中国长城科技集团股份有限公司', null, null, null, null, null, null, null, null, null, 1, null, null, null, 1, '王婷婷', null, 0.00, 0.00, 0.00);
DELETE FROM `enterprise_user` where id=1;
INSERT INTO enterprise_user (id, enterprise_id, enterprise_name, uid, u_name, email, is_leader, position, is_master, create_time) VALUES (1, 0, '中国长城科技集团股份有限公司', 2, '罗琨', '1@1.com', null, '领导', 1, '2019-12-24 04:49:09');
DELETE FROM user_role_mapping where id=1;
INSERT INTO user_role_mapping (id, uid, user_role_id, create_time, update_time, enterprise_id, sys_type) VALUES (1, 1, 1, '2019-12-17 22:52:29', '2019-12-17 22:52:29', 0, 1);

View File

@ -1487,9 +1487,9 @@ mybatis-plus:
binlog: binlog:
server: server:
host: 10.2.1.235 host: {{groups['mysql'][0]}}
user: root user: root
password: greatwall@123 password: {{mysqlBinlogServerPassword}}
sid: 1 sid: 1
host: mysql-cluster-mysql-master host: mysql-cluster-mysql-master
port: 3306 port: 3306

File diff suppressed because one or more lines are too long

View File

@ -61,9 +61,9 @@ data:
server pumpkin-daily-api:80; server pumpkin-daily-api:80;
} }
upstream doc-api { # upstream doc-api {
server pumpkin-doc-api:80; # server pumpkin-doc-api:80;
} # }
upstream gateway { upstream gateway {
server pumpkin-gateway:80; server pumpkin-gateway:80;
@ -74,7 +74,7 @@ data:
} }
upstream pumpkin-auth { upstream pumpkin-auth {
server pumpkin-auth:80; server pumpkin-auth.{{namespace}}:80;
} }
upstream mirror { upstream mirror {

View File

@ -1,6 +1 @@
toyangdon/dm:7-arm64 toyangdon/dm:7-arm64
toyangdon/tongweb:7
toyangdon/antdb_alone:5.0
toyangdon/kingbase:v8r3
toyangdon/redis:5.0-arm64-jemalloc
toyangdon/busybox:latest

View File

@ -0,0 +1,5 @@
toyangdon/dm:7-arm64
toyangdon/antdb_alone:5.0
toyangdon/kingbase:v8r3
toyangdon/redis:5.0-arm64-jemalloc
toyangdon/busybox:latest