Commit 9228b942 by 王庭威

增加kpl_replace_cfg

1 parent b064e552
ENV: ksy #必须修改
TMP_RESOURCE: /root
DEBS_SRC_FILES: "{{ TMP_RESOURCE }}/debs-apt-1804.tar.gz" #如果系统是1604,无网环境下则修改为debs-apt-1604.tar.gz
BASE_K8S_DIR: /opt/kubernetes
KPL_WORKSPACE: /workspace/seetaas
DEBS_TMP_PATH: /tmp
DEBS_DST_FILES: "{{ DEBS_TMP_PATH}}/data/apt-1804/debs"
HARBOR_HOST: 10.0.0.239:5000 #必须修改
BOOTSTRAP_TOKEN: 92c068405aa491239b56140ea6b3b44b
ANSIBLE_WORKSPACE: /root/seetaas-deploy
NEW_HARBOR_IP: 10.0.0.239 #必须修改
HARBOR_PASSWD: admin
HARBOR_USER: admin
HARBOR_AUTH_TOKEN: YWRtaW46YWRtaW4=
NFS_SERVER: 10.0.0.239 #必须修改
NFS_PATH: /data/storage/ #必须修改
NFS_2_SERVER: 10.0.0.239 #必须修改
NFS_2_PATH: /data/storage/ #必须修改
NFS_3_SERVER: 10.0.0.239 #必须修改
NFS_3_PATH: /data/storage/ #必须修改
TMP_NODES: "{% for h in groups['etcd'] %}{{ hostvars[h]['NODE_NAME'] }}=https://{{ h }}:2380,{% endfor %}"
ETCD_NODES: "{{ TMP_NODES.rstrip(',') }}"
TMP_FLANNEL_EP: "{% for h in groups['etcd'] %}https://{{ h }}:2379,{% endfor %}"
FLANNEL_ETCD_EP: "{{ TMP_FLANNEL_EP.rstrip(',') }}"
MASTER_IP: "{% for h in groups['master'] %}{{ h }}{% endfor %}" #用于kubelet roles中生成.kube/config文件需要的master节点ip地址。
IMAGE_PATH: /root/images
HARBOR_PROJECT: [
"k8s",
"kpl_k8s",
"core",
"seetaas",
"autodl",
"autodl_workspace"
]
IMAGE_LIST: [
"hub.kce.ksyun.com/aivc/volcanosh/vc-scheduler:latest",
"hub.kce.ksyun.com/aivc/volcanosh/vc-webhook-manager:latest",
"hub.kce.ksyun.com/aivc/volcanosh/vc-controller-manager:latest",
"hub.kce.ksyun.com/kpl_k8s/ubuntu-basic:16.04",
"hub.kce.ksyun.com/kpl_k8s/cuda:10.0-base-ubuntu16.04",
"hub.kce.ksyun.com/kpl_k8s/busybox:1.28.3",
"hub.kce.ksyun.com/kpl_k8s/coredns:1.5.0",
"hub.kce.ksyun.com/kpl_k8s/k8s-device-plugin:1.0.0-beta4",
"hub.kce.ksyun.com/kpl_k8s/nginx:latest",
"hub.kce.ksyun.com/kpl_k8s/pause-amd64:3.0",
"hub.kce.ksyun.com/kpl_k8s/core_gpu_base:cuda-10.0-base-neuware-mlu270-1.3.0-ubuntu18.04",
"hub.kce.ksyun.com/kpl_k8s/eclipse-mosquitto:latest",
"hub.kce.ksyun.com/kpl_k8s/mongo:4.0.10",
"hub.kce.ksyun.com/kpl_k8s/redis:5.0.6",
"hub.kce.ksyun.com/kpl_k8s/mysql:5.7.28"
]
mysql_host: "mysql.middleware.svc.cluster.local:3306"
mysql_user: "root"
mysql_password: "seetatech"
redis_host: "redis.middleware.svc.cluster.local:6379"
redis_password: "seetatech"
mongo_user: "admin"
mongo_password: "admin"
mongo_host: "mongodb://{{ mongo_user }}:{{ mongo_password }}@mongodb.middleware.svc.cluster.local:27017/seetaas?authSource=admin"
harbor_host: "10.0.0.239:5000" #必须修改
kpl_service_id : "seetaas3"
kpl_realy_path: "seetaas"
kpl_db_name: "seetaas"
quota_db_name: "quota"
hb_host: 'hub.kce.ksyun.com'
iot_boolean: "false"
grafana_boolean: "false"
kpl_stream: '10.0.0.239:30205' #必须修改
kpl_backend: '10.0.0.239:30180' #必须修改,用于deploy_host所需要的后端api地址
###################################################
mqtt_client_host: 'mqtt_client_host'
mqtt_host: 'mqtt_host'
node_grafana_url_string: 'node_grafana_url_string'
notebook_grafana_url_string: 'notebook_grafana_url_string'
disable_i18n_boolean: 'false'
use_fake_metric_string: 'use_fake_metric_string'
temp_oidc_create_boolean: 'temp_oidc_create_boolean'
create_from_string: 'create_from_string' #金山云自己环境是kplsso
token_endpoint_string: ' token_endpoint_string'
create_endpoint_string: 'create_endpoint_string'
client_id_string: 'client_id_string'
admin_user_string: 'admin_user_string'
admin_password_string: 'admin_password_string'
mode_type_string: 'mode_type_string'
specific_block_string: 'specific_block_string'
specific_block_weight_string: 'specific_block_weight_string'
[master]
10.0.0.239
[etcd]
10.0.0.239 NODE_NAME=etcd1
[nfs]
10.0.0.239
[node]
10.0.0.239
[new_node]
10.0.0.239
\ No newline at end of file
#!/bin/bash
workspace=/root/ksy-project-docking/kpl_replace_cfg
ansible-playbook -i $workspace/environments/$1/hosts $workspace/replace.yml
- name: 修改kpl基础镜像为私有
hosts: master
remote_user: root
roles:
- replace-configmap
vars_files:
- environments/{{ ENV }}/group_vars/all.yml
- environments/{{ ENV }}/group_vars/kpl.yml
- name: 在tmp目录创建渲染目标目录
file: path=/tmp/configmap-kpl/{{ item }} state=directory
with_items:
- autodl-core
- autodl
- kpl
- name: 渲染分发autodl-core的configmap配置文件
template: src={{ item }} dest=/tmp/configmap-kpl/autodl-core/{{ item | basename | regex_replace('.j2','') }}
with_fileglob:
- "{{ TMP_RESOURCE }}/configmap-kpl/autodl-core/*.j2"
- name: 渲染分发autodl的configmap配置文件
template: src={{ item }} dest=/tmp/configmap-kpl/autodl/{{ item | basename | regex_replace('.j2','') }}
with_fileglob:
- "{{ TMP_RESOURCE }}/configmap-kpl/autodl/*.j2"
- name: 渲染分发kpl的configmap配置文件
template: src={{ item }} dest=/tmp/configmap-kpl/kpl/{{ item | basename | regex_replace('.j2','') }}
with_fileglob:
- "{{ TMP_RESOURCE }}/configmap-kpl/kpl/*.j2"
- name: 执行kubectl apply创建configmap配置文件
shell: kubectl apply -f {{ item }}
with_items:
- /tmp/configmap-kpl/autodl-core
- /tmp/configmap-kpl/kpl
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!