Kubernetes 1.25 containerd 环境部署 SuperMap iManager
超图官网目提供的Kubernetes 版本为 1.20 版本,容器运行时为 docker
本次部署使用已有的 Kubernetes 1.25 版本集群,容器运行时为 containerd
Kubernetes ,containerd 部署请自行了解,本次不做介绍,下面介绍在此环境上如何部署 iManager 11i 并创建云套件
1. 环境介绍
虚拟机 | CPU | 内存 | 操作系统 | Kubernetes |
k8s master | 华为鲲鹏 920(64 核) | 64GB | Kylin 10SP1 64 bit with ARM | 1.25 |
k8s node1 | 华为鲲鹏 920(64 核) | 64GB | Kylin 10SP1 64 bit with ARM | 1.25 |
k8s node2 | 华为鲲鹏 920(64 核) | 64GB | Kylin 10SP1 64 bit with ARM | 1.25 |
registry,nfs | 华为鲲鹏 920(64 核) | 64GB | Kylin 10SP1 64 bit with ARM |
2. 软件包准备
- supermap-imanager-for-kubernetes-registry-all-11.1.1-linux-arm64.tar.gz
- supermap-imanager-for-kubernetes-11.1.1-linux-arm64.tar.gz
文件提取地址: iManager 部署包 - 百度网盘https://pan.baidu.com/s/1lWLyyT1jAbADGuxEG3m4gA
提取码:ge4d
3. iManager 私有镜像仓库
3.1. 仓库部署
准备一台有 docker 的服务器,用于部署 iManager 私有镜像仓库。
3.1.1. 解压镜像包
将镜像包放置在服务器的任意目录,如:/home/,使用以下命令解压(若 实际包名与示例中的包名不一致,在执行命令时请替换为实际包名):
tar -zvxf supermap-imanager-for-kubernetes-registry-all-11.1.1-linux-arm64.tar.gz
3.1.2. 进入解压后目录
cd supermap-imanager-for-kubernetes-registry-all-11.1.0-linux-x64
3.1.3. 安装镜像库
chmod +x startup.sh && ./startup.sh
安装后可以看到registry的镜像和容器:
3.1.4. 验证镜像仓库
docker pull IP:5000/supermap/scratch:latest-amd64
# 其中为仓库所在主机IP ,如果结果无error,则表示启动成功
3.2. k8s 所有节点添加私有仓库地址
3.2.1. 编辑config.toml
vi /etc/containerd/config.toml
添加如下内容:
[plugins."io.containerd.grpc.v1.cri".registry.configs."IP:5000".auth] # 其中为仓库所在主机IP
username = "supermap"
password = "supermap"
3.2.2. 添加仓库 hosts.toml
进入certs.d文件夹,添加如下内容:
cd /etc/containerd/certs.d
添加文件夹:仓库IP:5000
在文件夹192.168.12.161:5000下添加文件hosts.toml,内容如下:
server = "http://192.168.12.161:5000"
[host."http://192.168.12.161:5000"]
capabilities = ["pull", "resolve", "push"]
skip_verify = true
3.2.3. 重启containerd服务
systemctl restart containerd
4. 部署 iManager
4.1. 解压iManager安装包
将 iManager 包放置在在Kubernetes master 节点所在服务器的任意目录,如:/home/,使用以下命令解压(若 实际包名与示例中的包名不一致,在执行命令时请替换为实际包名)
tar -zvxf supermap-imanager-for-kubernetes-11.1.1-linux-arm64.tar.gz
4.2. 编辑 iManager 配置文件
cd /nas/SuperMap/IManager/supermap-imanager-for-kubernetes-11.1.1-linux-arm64
vi values.yaml
修改内容:
deploy_registry: 192.168.2.90:5000 #必填,iManager镜像仓库的地址,用于拉取部署iManager所需镜像
deploy_kubernetes_public_ip: 192.168.2.7 # 必填,外部访问Kubernetes时用的IP
deploy_nfs_server: sealos.hub # NFS Server地址,NFS Server用于存储iManager数据,可以是IP或者域名
deploy_nfs_path: /Imanager # NFS Server提供挂载的路径,默认根路径(/)
# 选填,是否禁用iManager的Ingress控制器,禁用将不能设置域名,取值范围:[true|false]。默认为false;
# 如果Kubernetes版本为1.19以下,将不支持Ingress功能,需禁用Ingress控制器;
# true:禁用Ingress控制器;
# false:开启Ingress控制器。
deploy_disable_ingress: true
deploy_domain_ip: 192.168.2.7 # 选填,iManager创建的GIS云套件配置域名时必填,GIS云套件域名映射的Kubernetes节点IP(即域名在DNS服务器上配置指向的IP)。默认使用第一个Kubernetes节点IP。
# 选填,是否禁用metrics_server服务,metrics_server用于Kubernetes资源监控,可支撑动态伸缩功能。取值范围:[true|false]。默认false;
# 如果您配置的是私有仓库,并开启metrics_server服务,需在Kubernetes中kube-system所在命名空间下创建与Secret同名的资源,详情请参见教程->附录->常见问题解答->问题6;
# true:禁用metrics_server服务;
# false:开启metrics_server服务。
deploy_disable_metrics_server: true
完整描述参考:安装iManagerhttps://help.supermap.com/iManager_K8S/1111/zh/guides/InstalliManager/
实际修改后内容如下:
deploy_registry: 192.168.2.90:5000
deploy_kubernetes_public_ip: 192.168.2.7
deploy_imanager_user_name: admin
deploy_nfs_server: sealos.hub
deploy_nfs_path: /Imanager
deploy_kubernetes_master_url: https://kubernetes.default.svc
deploy_disable_ingress: true
deploy_domain_ip: 192.168.2.7
deploy_storage_class_name:
deploy_namespace: supermap
deploy_image_pull_policy: IfNotPresent
deploy_image_pull_secret: image-pull-secret
deploy_image_namespace: supermap
deploy_service_type: NodePort
deploy_imanager_service_protocol: http
deploy_cpu_limit: 2
deploy_memory_limit: 4Gi
deploy_iserver_tag: 11.1.1-arm64
deploy_iportal_tag: 11.1.1-arm64
deploy_idesktop_tag: 11.1.1-arm64
deploy_gis_app_tag: 11.1.1-arm64
deploy_imanager_port: 31100
deploy_disable_bslicense_local_volume: false
deploy_disable_hbase_nfs_volume: false
deploy_disable_weixin_hook: false
deploy_weixin_token:
deploy_weixin_corp_id:
deploy_weixin_encoding_aes_key:
deploy_weixin_to_party:
deploy_weixin_agent_id:
deploy_weixin_api_secret:
deploy_disable_web_hook: false
deploy_dingtalk_webhook:
deploy_dingtalk_secret:
deploy_timezone: Asia/Shanghai
deploy_async_function_enabled:
deploy_sync_function_enabled:
deploy_disable_bslicense: false
deploy_bslicense_server_host:
deploy_bslicense_server_port:
deploy_bslicense_ui_host:
deploy_bslicense_ui_port:
deploy_disable_imanager_database: false
deploy_imanager_database_type: mariadb
deploy_imanager_database_host:
deploy_imanager_database_port:
deploy_imanager_database_username:
deploy_imanager_database_password:
deploy_disable_imanager_phpmyadmin: false
deploy_imanager_phpmyadmin_host:
deploy_imanager_phpmyadmin_port:
deploy_disable_imanager_gateway_redis: false
deploy_imanager_gateway_redis_host:
deploy_imanager_gateway_redis_port:
deploy_imanager_gateway_redis_username:
deploy_imanager_gateway_redis_password:
deploy_disable_keycloak: false
deploy_keycloak_host:
deploy_keycloak_port:
deploy_keycloak_admin_username:
deploy_keycloak_admin_password:
deploy_disable_keycloak_postgresql: false
deploy_keycloak_postgresql_host:
deploy_keycloak_postgresql_port:
deploy_keycloak_postgresql_username:
deploy_keycloak_postgresql_password:
deploy_disable_fluentd_es: false
deploy_disable_elasticsearch: false
deploy_elasticsearch_host:
deploy_elasticsearch_tcp_port:
deploy_elasticsearch_rest_port:
deploy_disable_kibana: false
deploy_kibana_host:
deploy_kibana_port:
deploy_kibana_context_path:
deploy_disable_consul_server: false
deploy_consul_server_host:
deploy_consul_server_port:
deploy_disable_prometheus: false
deploy_disable_alert: false
deploy_disable_prometheus_node_exporter: false
deploy_disable_metrics_server: true
deploy_disable_kube_state_metrics: false
deploy_disable_blackbox_exporter: false
deploy_disable_ssl_exporter: false
deploy_ssl_exporter_host:
deploy_ssl_exporter_port:
deploy_disable_grafana: false
deploy_grafana_host:
deploy_grafana_port:
deploy_grafana_context_path:
deploy_disable_grafana_postgresql: false
deploy_grafana_postgresql_host:
deploy_grafana_postgresql_port:
deploy_grafana_postgresql_username:
deploy_grafana_postgresql_password:
deploy_disable_k8s_dashboard: false
deploy_k8s_dashboard_host:
deploy_k8s_dashboard_port:
#affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: kubernetes.io/hostname
# operator: Exists
#tolerations:
# - key: "key1"
# operator: "Equal"
# value: "value1"
# effect: "NoExecute"
# tolerationSeconds: 3600
根据实际情况修改 values.yaml 文件
4.3. 安装 iManager
cd supermap-imanager-for-kubernetes-11.1.1-linux-arm64
chmod +x startup.sh && ./startup.sh
部署后会在k8s创建supermap的名称空间:
等待所有安装进度完成 pod 全部启动后访问 IP:31100,会自动跳转到许可中心页面,点击下载报告按钮下载 reportc 报告文件,通过报告文件申请许可文件(web 许可,*.licc)
许可导入后进入 iManager 概览页
5. 创建 SuperMap GIS 云套件
- 打开iManager左侧导航栏站点管理;
- 点击+ 创建;
- 对GIS服务进行命名,并选择站点类型为GIS云套件
具体参数参考:
GIS云套件创建https://help.supermap.com/iManager_K8S/1111/zh/tutorial/CreateGISMicroService/
此时 k8s 会新建 icloud-native-* 命名空间,可以前往 kuboard 查看部署状态
等待部署完成后即可使用云套件了
云套件具体用户手册参考:GIS云套件-用户手册https://help.supermap.com/iManager_K8S/1111/zh/microservices/MicroserviceIntro/
6. 要点总结
containerd 兼容 docker 容器,所以与 iManager 官网部署流场区别不大,主要有两点要注意:
k8s 所有节点都要手动添加 iManager 私有仓库地址
iManager 配置文件差异需要启用 deploy_disable_ingress 与 deploy_disable_metrics_server