lucas2
3 years ago
53 changed files with 36894 additions and 0 deletions
@ -0,0 +1,2 @@ |
|||||
|
安心云 应用 镜像 12个 |
||||
|
make-app-tar.sh 脚本执行 后存入当前文件夹 |
@ -0,0 +1,98 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-dac-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-iota-dac-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-iota-dac-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-iota-dac-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-iota-dac #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/iota/dac:28.21-04-14 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "IOTA_DAC_RUN_MODE" #变量的名字 |
||||
|
value: "single" #变量的值 |
||||
|
- name: "IOTA_KAFKA_BROKERS" |
||||
|
value: "kafka-service:9092" |
||||
|
- name: "IOTA_MQTT" |
||||
|
value: "emqx-service:1883" |
||||
|
- name: "IOTA_REDIS" |
||||
|
value: "redis-service:6379" |
||||
|
- name: "IOTA_POSTGRES" |
||||
|
value: "postgres://postgres:example@pg-service:5432/iota?sslmode=disable" |
||||
|
- name: "IOTA_ALERT_MODE" |
||||
|
value: "simple" |
||||
|
ports: |
||||
|
- containerPort: 5000 #定义容器的端口 |
||||
|
name: tcp-5000 |
||||
|
- containerPort: 40001 #定义容器的端口 |
||||
|
name: tcp-40001 |
||||
|
- containerPort: 40002 #定义容器的端口 |
||||
|
name: tcp-40002 |
||||
|
- containerPort: 40003 #定义容器的端口 |
||||
|
name: tcp-40003 |
||||
|
- containerPort: 40004 #定义容器的端口 |
||||
|
name: tcp-40004 |
||||
|
- containerPort: 40005 #定义容器的端口 |
||||
|
name: tcp-40005 |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-hosts |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-dac-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: iota-dac-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-iota-dac-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 5000 # 集群内访问 |
||||
|
targetPort: 5000 #集群内 容器内端口 |
||||
|
name: tcp-5000 |
||||
|
#nodePort: 30500 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 40001 # 集群内访问 |
||||
|
targetPort: 40001 #集群内 容器内端口 |
||||
|
name: tcp-40001 |
||||
|
nodePort: 30401 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 40002 # 集群内访问 |
||||
|
targetPort: 40002 #集群内 容器内端口 |
||||
|
name: tcp-40002 |
||||
|
nodePort: 30402 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 40003 # 集群内访问 |
||||
|
targetPort: 40003 #集群内 容器内端口 |
||||
|
name: tcp-40003 |
||||
|
nodePort: 30403 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 40004 # 集群内访问 |
||||
|
targetPort: 40004 #集群内 容器内端口 |
||||
|
name: tcp-40004 |
||||
|
nodePort: 30404 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 40005 # 集群内访问 |
||||
|
targetPort: 40005 #集群内 容器内端口 |
||||
|
name: tcp-40005 |
||||
|
nodePort: 30405 #集群外访问 范围30000-32767 |
@ -0,0 +1,43 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-prometheus-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-iota-prometheus-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-iota-prometheus-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-iota-prometheus-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-iota-prometheus #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/iota/prometheus:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
ports: |
||||
|
- containerPort: 19090 #定义容器的端口 |
||||
|
name: tcp-19090 |
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-prometheus-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: iota-prometheus-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-iota-prometheus-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 19090 # 集群内访问 |
||||
|
targetPort: 19090 #集群内 容器内端口 |
||||
|
name: tcp-19090 |
||||
|
nodePort: 30990 #集群外访问 范围30000-32767 |
||||
|
|
@ -0,0 +1,67 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-webapi-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-iota-webapi-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-iota-webapi-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-iota-webapi-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-iota-webapi #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/iota/web-console-api:50.21-05-24 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "IOTA_SERVER_PORT" #变量的名字 |
||||
|
value: "9080" #变量的值 |
||||
|
- name: "IOTA_KAFKA_BROKERS" |
||||
|
value: "kafka-service:9092" |
||||
|
- name: "IOTA_ZOOKEEPER_NODES" |
||||
|
value: "kafka-service:2182" |
||||
|
- name: "IOTA_MQTT_BROKERS" |
||||
|
value: "emqx-service:1883" |
||||
|
- name: "IOTA_REDIS_SERVER_HOST" |
||||
|
value: "redis-service" |
||||
|
- name: "IOTA_POSTGRES" |
||||
|
value: "postgres://postgres:example@pg-service:5432/iota" |
||||
|
- name: "IOTA_ATTACHMENT_IN_CLOUD" |
||||
|
value: "true" |
||||
|
- name: "IOTA_PROMETHEUS_SERVER" |
||||
|
value: "iota-prometheus-service:19090" |
||||
|
ports: |
||||
|
- containerPort: 9080 #定义容器的端口 |
||||
|
name: tcp-9080 |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-hosts |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-webapi-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: iota-webapi-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-iota-webapi-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 9080 # 集群内访问 |
||||
|
targetPort: 9080 #集群内 容器内端口 |
||||
|
name: tcp-9080 |
||||
|
#nodePort: 30980 #集群外访问 范围30000-32767 |
||||
|
|
@ -0,0 +1,52 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-proxy-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-iota-proxy-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-iota-proxy-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-iota-proxy-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-iota-proxy #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/anxin/iota-proxy:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "ANXINCLOUD_IOTA_API" #变量的名字 |
||||
|
value: "http://iota-webapi-service:9080" #变量的值 |
||||
|
- name: "ANXINCLOUD_IOTA_AUTH" |
||||
|
value: "MGU0MmFmZTZlNzEwNTVjZWEyNWZjMDA4M2Q4MTY0MjZjNTg2N2I4OTozNWUwYWRmMGEzMDM0NWEzMTA0YTA2YmI4YTY0ODQwMGQ5NGE5YzIw" |
||||
|
- name: "ANXINCLOUD_REDIS_HOST" |
||||
|
value: "redis-service" |
||||
|
- name: "ANXINCLOUD_REDIS_PORT" |
||||
|
value: "6379" |
||||
|
ports: |
||||
|
- containerPort: 8080 #定义容器的端口 |
||||
|
name: tcp-8080 |
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: iota-proxy-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: iota-proxy-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-iota-proxy-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 8091 # 集群内访问 |
||||
|
targetPort: 8080 #集群内 容器内端口 |
||||
|
name: tcp-8080 |
||||
|
nodePort: 30891 #集群外访问 范围30000-32767 |
||||
|
|
@ -0,0 +1,43 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: rpc-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-rpc-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-rpc-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-rpc-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-rpc #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/anxinyun/py.rpc:dragon.32 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
ports: |
||||
|
- containerPort: 5000 #定义容器的端口 |
||||
|
name: tcp-5000 |
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: rpc-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: rpc-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-rpc-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 25000 # 集群内访问 |
||||
|
targetPort: 5000 #集群内 容器内端口 |
||||
|
name: tcp-5000 |
||||
|
#nodePort: 30500 #集群外访问 范围30000-32767 |
||||
|
|
@ -0,0 +1,49 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: config-center-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-config-center-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-config-center-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-config-center-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 把数据库里传感器配置,写入redis |
||||
|
- name: yaml-config-center #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/local/config_center:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "CLUSTER" #变量的名字 |
||||
|
value: "ANXINCLOUD" #变量的值 |
||||
|
- name: "ANXINCLOUD_API" |
||||
|
value: "webapi-service:8092" ##注意 这里要先启动 anxin webapi |
||||
|
command: ['java','-jar','/app/config_center.jar','db.url=jdbc:postgresql://pg-service:5432/axy','db.user=postgres','db.pwd=example','iota.api.proxy=http://iota-proxy-service:8091/_iota_api','redis.host=redis-service','redis.port=6379' ,'kafka.brokers=kafka-service:9092'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-config-centerc #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-config-centerc |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
#ET不对外提供服务 不启用service |
||||
|
# apiVersion: v1 #指定API版本标签 |
||||
|
# kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
# metadata: #定义资源的元数据信息 |
||||
|
# name: config-center-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
# namespace: lk #默认default |
||||
|
# labels: #定义资源标签 |
||||
|
# app: config-center-s |
||||
|
# spec: |
||||
|
# selector: |
||||
|
# app: yaml-config-center-d #deployment标签 |
||||
|
# type: ClusterIP |
||||
|
|
@ -0,0 +1,45 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: et-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-et-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-et-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-et-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-et #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/local/et:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
command: ['java','-cp','et.jar','et.main.singleton','db.url=jdbc:postgresql://pg-service:5432/axy','db.user=postgres','db.pwd=example','iota.api.proxy="iota-proxy-service:8091/_iota_api"','redis.host=redis-service','redis.port=6379' ,'kafka.brokers=kafka-service:9092','es.cluster.nodes=es-service:9200'] |
||||
|
#command: ['java -cp et.jar et.main.singleton db.url=jdbc:postgresql://pg-service:5432/axy db.user=postgres db.pwd=example iota.api.proxy="iota-proxy-service:8091/_iota_api" redis.host=redis-service redis.port=6379 kafka.brokers=kafka-service:9092 es.cluster.nodes=es-service:9200'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-etc #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-etc |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
#ET不对外提供服务 不启用service |
||||
|
# apiVersion: v1 #指定API版本标签 |
||||
|
# kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
# metadata: #定义资源的元数据信息 |
||||
|
# name: et-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
# namespace: lk #默认default |
||||
|
# labels: #定义资源标签 |
||||
|
# app: et-s |
||||
|
# spec: |
||||
|
# selector: |
||||
|
# app: yaml-et-d #deployment标签 |
||||
|
# type: ClusterIP |
||||
|
|
@ -0,0 +1,49 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: report-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-report-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-report-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-report-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-report #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/local/report-client:12.21-10-28 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
command: ['java','-cp','/app/report.client.jar','report.client.main','db.url=jdbc:postgresql://pg-service:5432/axy','db.user=postgres','db.pwd=example','redis.host=redis-service','redis.port=6379' ,'kafka.brokers=kafka-service:9092','es.cluster.nodes=es-service:9200','thingId_url=http://iota-webapi-service:9080/_iota_api/things/','local.attachment.baseurl=http://webapi-service:8092/attachments'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
# - name: vol-report #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
# mountPath: /app # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-hosts |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
# - name: vol-report |
||||
|
# hostPath: |
||||
|
# path: /home/anxin/static/report # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
#ET不对外提供服务 不启用service |
||||
|
# apiVersion: v1 #指定API版本标签 |
||||
|
# kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
# metadata: #定义资源的元数据信息 |
||||
|
# name: report-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
# namespace: lk #默认default |
||||
|
# labels: #定义资源标签 |
||||
|
# app: report-s |
||||
|
# spec: |
||||
|
# selector: |
||||
|
# app: yaml-report-d #deployment标签 |
||||
|
# type: ClusterIP |
||||
|
|
@ -0,0 +1,44 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: alarm-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-alarm-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-alarm-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-alarm-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-alarm #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/anxinyun/smislocal-alarm:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
command: ['java','-jar','alarm.jar','db.url=jdbc:postgresql://pg-service:5432/axy','db.user=postgres','db.pwd=example','redis.host=redis-service','redis.port=6379' ,'kafka.brokers=kafka-service:9092','es.cluster.nodes=es-service:9200'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-alarm #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-alarm |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
#ET不对外提供服务 不启用service |
||||
|
# apiVersion: v1 #指定API版本标签 |
||||
|
# kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
# metadata: #定义资源的元数据信息 |
||||
|
# name: alarm-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
# namespace: lk #默认default |
||||
|
# labels: #定义资源标签 |
||||
|
# app: alarm-s |
||||
|
# spec: |
||||
|
# selector: |
||||
|
# app: yaml-alarm-d #deployment标签 |
||||
|
# type: ClusterIP |
||||
|
|
@ -0,0 +1,77 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: webapi-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-webapi-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-webapi-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-webapi-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-webapi #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/anxinyun/api:137.21-08-17 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "ANXINCLOUD_PROXY_IOTA" #变量的名字 |
||||
|
value: "iota-proxy-service:8091" #变量的值 |
||||
|
- name: "ANXINCLOUD_HDFS_HTTP" |
||||
|
value: "http://10.8.30.155:50070" |
||||
|
- name: "ANXINCLOUD_KAFKA_BROKERS" |
||||
|
value: "kafka-service:9092" |
||||
|
- name: "ANXINCLOUD_ES_NODES_REST" |
||||
|
value: "es-service:9200" |
||||
|
- name: "ANXINCLOUD_DB" |
||||
|
value: "postgres://postgres:example@pg-service:5432/axy" |
||||
|
- name: "ANXINCLOUD_FC_UPLOAD_PATH" |
||||
|
value: "upload" |
||||
|
- name: "ANXINCLOUD_FC_LOCAL_ROOT_PATH" |
||||
|
value: "static" |
||||
|
- name: "ANXINCLOUD_FC_LOCAL_CHILD_PATH" |
||||
|
value: "child" |
||||
|
- name: "ANXINCLOUD_PYRPC_URL" |
||||
|
value: "rpc-service:25000" |
||||
|
- name: "PLATFORM_NAME" |
||||
|
value: "native" |
||||
|
ports: |
||||
|
- containerPort: 8080 #定义容器的端口 |
||||
|
name: tcp-8080 |
||||
|
command: ['node','server.js','--redis','redis-service:6379'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
- name: vol-static # 报表模板存储 |
||||
|
mountPath: /var/app/static # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-hosts |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 |
||||
|
- name: vol-static |
||||
|
hostPath: |
||||
|
path: /home/anxinlocal/static # 宿主机目录 覆盖容器内目录 |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: webapi-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: webapi-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-webapi-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 8092 # 集群内访问 |
||||
|
targetPort: 8080 #集群内 容器内端口 |
||||
|
name: tcp-8080 |
||||
|
nodePort: 30892 #集群外访问 范围30000-32767 |
@ -0,0 +1,69 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: webconsole-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-webconsole-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-webconsole-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-webconsole-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-webconsole #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/anxinyun/console-web:75.21-06-10 |
||||
|
#image: repository.anxinyun.cn/anxinyun/console:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: ANXINCLOUD_API |
||||
|
value: http://webapi-service:8092 |
||||
|
- name: ANXINCLOUD_IOTA_API |
||||
|
value: http://iota-webapi-service:9080 |
||||
|
- name: ANXINCLOUD_HDFS_HTTP |
||||
|
value: http://10.8.30.155:50070 |
||||
|
- name: ANXINCLOUD_QINIU_AK |
||||
|
value: 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu |
||||
|
- name: ANXINCLOUD_QINIU_SK |
||||
|
value: w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 |
||||
|
- name: ANXINCLOUD_QINIU_BUCKET_RESOURCE |
||||
|
value: anxinyun-test |
||||
|
- name: ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE |
||||
|
value: http://test.resources.anxinyun.cn |
||||
|
- name: "ANXINCLOUD_IOTA_AUTH" |
||||
|
value: "MGU0MmFmZTZlNzEwNTVjZWEyNWZjMDA4M2Q4MTY0MjZjNTg2N2I4OTozNWUwYWRmMGEzMDM0NWEzMTA0YTA2YmI4YTY0ODQwMGQ5NGE5YzIw" |
||||
|
ports: |
||||
|
- containerPort: 8080 #定义容器的端口 |
||||
|
name: tcp-8080 |
||||
|
command: ['node','server.js','-p','8080'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-hosts |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: webconsole-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: webconsole-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-webconsole-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 8072 # 集群内访问 |
||||
|
targetPort: 8080 #集群内 容器内端口 |
||||
|
name: tcp-8080 |
||||
|
nodePort: 30872 #集群外访问 范围30000-32767 |
Binary file not shown.
@ -0,0 +1,73 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: webproject-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yaml-webproject-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-webproject-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-webproject-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-webproject #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/anxinyun/project:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "ANXINCLOUD_API" #变量的名字 |
||||
|
value: "http://webapi-service:8092" #变量的值 |
||||
|
- name: "ANXINCLOUD_PROXY_IOTA" |
||||
|
value: "iota-proxy-service:8091" |
||||
|
- name: "ANXINCLOUD_HDFS_HTTP" |
||||
|
value: "http://10.8.30.155:50070" |
||||
|
#本地化 图片不存在 七牛# |
||||
|
- name: "ANXINCLOUD_QINIU_AK" |
||||
|
value: "5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu" |
||||
|
- name: "ANXINCLOUD_QINIU_SK" |
||||
|
value: "w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5" |
||||
|
- name: "ANXINCLOUD_QINIU_BUCKET_RESOURCE" |
||||
|
value: "anxinyun-test" |
||||
|
- name: "ANXINCLOUD_QINIU_DOMAIN_QNDMN_RESOURCE" |
||||
|
value: "http://test.resources.anxinyun.cn" |
||||
|
- name: "ANXINCLOUD_FC_UPLOAD_PATH" |
||||
|
value: "upload" |
||||
|
- name: "ANXINCLOUD_FC_LOCAL_ROOT_PATH" |
||||
|
value: "static" |
||||
|
- name: "ANXINCLOUD_FC_LOCAL_CHILD_PATH" |
||||
|
value: "child" |
||||
|
ports: |
||||
|
- containerPort: 8080 #定义容器的端口 |
||||
|
name: tcp-8080 |
||||
|
command: ['node','server.js','-p','8080'] |
||||
|
volumeMounts: #改容器内无法修改hosts 挂载出来修改 |
||||
|
- name: vol-hosts #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /etc/hosts # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-hosts |
||||
|
hostPath: |
||||
|
path: /etc/hosts # 宿主机目录 覆盖容器内目录 间接统一hosts |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: webproject-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: webproject-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-webproject-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 8073 # 集群内访问 |
||||
|
targetPort: 8080 #集群内 容器内端口 |
||||
|
name: tcp-8080 |
||||
|
nodePort: 30873 #集群外访问 范围30000-32767 |
@ -0,0 +1 @@ |
|||||
|
用户侧 项目 访问 |
@ -0,0 +1,3 @@ |
|||||
|
安心云 基础 镜像 7个 |
||||
|
|
||||
|
make-base-tar.sh 脚本执行 后存入当前文件夹 |
@ -0,0 +1,65 @@ |
|||||
|
version: '3' |
||||
|
services: |
||||
|
es: |
||||
|
image: repository.anxinyun.cn/base-images/es:6.8.2-3.21-04-21 |
||||
|
container_name: fs_elasticsearch |
||||
|
environment: |
||||
|
- "cluster.name=elasticsearch" |
||||
|
- "discovery.type=single-node" |
||||
|
- "ES_JAVA_OPTS=-Xms512m -Xmx512m" |
||||
|
volumes: |
||||
|
- /data/es/data:/usr/share/elasticsearch/data |
||||
|
ports: |
||||
|
- 9200:9200 |
||||
|
|
||||
|
|
||||
|
redis: |
||||
|
image: repository.anxinyun.cn/base-images/redis:5-1.21-04-13 |
||||
|
container_name: fs_redis |
||||
|
volumes: |
||||
|
- /data/redis/data:/data |
||||
|
- /data/redis/logs:/logs |
||||
|
command: |
||||
|
/bin/sh -c "redis-server --protected-mode 'no' --appendonly yes" |
||||
|
ports: |
||||
|
- 6379:6379 |
||||
|
|
||||
|
emqx: |
||||
|
image: emqx/emqx |
||||
|
container_name: fs_emqx |
||||
|
ports: |
||||
|
- 18083:18083 |
||||
|
- 1883:1883 |
||||
|
|
||||
|
kafka: |
||||
|
image: repository.anxinyun.cn/base-images/kafka-alpine:2.11-1.21-04-19 |
||||
|
container_name: fs_kafka |
||||
|
ports: |
||||
|
- 9092:9092 |
||||
|
- 2182:2182 |
||||
|
|
||||
|
pg: |
||||
|
image: repository.anxinyun.cn/base-images/pg:12-1.21-04-14 |
||||
|
container_name: fs_pg |
||||
|
environment: |
||||
|
- "POSTGRES_PASSWORD=example" |
||||
|
volumes: |
||||
|
- /data/pg/data:/var/lib/postgresql/data |
||||
|
- ./script:/script |
||||
|
ports: |
||||
|
- 5432:5432 |
||||
|
adminer: |
||||
|
image: adminer |
||||
|
restart: always |
||||
|
ports: |
||||
|
- 8081:8080 |
||||
|
kibana: |
||||
|
image: kibana:6.8.2 |
||||
|
environment: |
||||
|
- "ELASTICSEARCH_HOSTS=http://es:9200" |
||||
|
ports: |
||||
|
- 5601:5601 |
||||
|
networks: |
||||
|
default: |
||||
|
external: |
||||
|
name: fs-network |
@ -0,0 +1,55 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: es-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yamles-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yamles-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yamles-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yamles #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/base-images/es:6.8.2-3.21-04-21 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "cluster.name" #变量的名字 |
||||
|
value: "elasticsearch" #变量的值 |
||||
|
- name: "discovery.type" |
||||
|
value: "single-node" |
||||
|
- name: "ES_JAVA_OPTS" |
||||
|
value: "-Xms512m -Xmx512m" |
||||
|
ports: |
||||
|
- containerPort: 9200 #定义容器的对外端口 |
||||
|
volumeMounts: |
||||
|
- name: vol-data #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /usr/share/elasticsearch/data # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-data |
||||
|
hostPath: |
||||
|
path: /home/anxinlocal/esdata # 宿主机目录 |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: es-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: es-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yamles-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 9200 # 集群内访问 |
||||
|
targetPort: 9200 #集群内 容器内端口 |
||||
|
nodePort: 30092 #集群外访问 范围30000-32767 |
@ -0,0 +1,44 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: kibana-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: kibana-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yamlkibana-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yamlkibana-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yamlkibana #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/base-images/kibana:6.8.2 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "ELASTICSEARCH_HOSTS" #变量的名字 |
||||
|
value: "http://es-service:9200" #变量的值 注意这里面的es-service 是es的yaml service的name |
||||
|
ports: |
||||
|
- containerPort: 5601 #定义容器的对外端口 |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: kibana-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: kibana-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yamlkibana-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 5601 # 集群内访问 |
||||
|
targetPort: 5601 #集群内 容器内端口 |
||||
|
nodePort: 30601 #集群外访问 范围30000-32767 |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"change_data":{"dynamic":"true","properties":{"diffX":{"type":"float"},"direction":{"type":"float"},"displacement":{"type":"float"},"force":{"type":"float"},"humidity":{"type":"float"},"noise":{"type":"float"},"pm10":{"type":"float"},"pm25":{"type":"float"},"speed":{"type":"float"},"temperature":{"type":"float"},"total":{"type":"float"},"waterLevel":{"type":"float"},"x":{"type":"float"},"y":{"type":"float"},"z":{"type":"float"}}},"data":{"dynamic":"true","properties":{"alarm_status":{"type":"float"},"aqi":{"type":"long"},"aqiLevel":{"type":"long"},"bri":{"type":"float"},"co":{"type":"float"},"co_24h":{"type":"float"},"co_24h_iaqi":{"type":"long"},"co_iaqi":{"type":"long"},"diffX":{"type":"float"},"direction":{"type":"float"},"displacement":{"type":"float"},"do":{"type":"float"},"do_24h":{"type":"float"},"end_state":{"type":"long"},"end_time":{"type":"date"},"female_in":{"type":"float"},"female_out":{"type":"float"},"female_stay":{"type":"float"},"force":{"type":"float"},"frequency":{"type":"float"},"from_state":{"type":"long"},"from_time":{"type":"date"},"humidity":{"type":"float"},"inflow":{"type":"float"},"latitude":{"type":"float"},"longitude":{"type":"float"},"male_in":{"type":"float"},"male_out":{"type":"float"},"male_stay":{"type":"float"},"no2":{"type":"float"},"no2_24h":{"type":"float"},"no2_24h_iaqi":{"type":"long"},"no2_iaqi":{"type":"long"},"noise":{"type":"float"},"o3":{"type":"float"},"o3_1h_24h":{"type":"float"},"o3_1h_24h_iaqi":{"type":"long"},"o3_1h_iaqi":{"type":"long"},"o3_8h":{"type":"float"},"o3_8h_24h":{"type":"float"},"o3_8h_24h_iaqi":{"type":"long"},"o3_8h_iaqi":{"type":"long"},"o3_iaqi":{"type":"long"},"on":{"type":"float"},"on_duration":{"type":"long"},"online":{"type":"float"},"outflow":{"type":"float"},"pEnergy":{"type":"float"},"ph":{"type":"float"},"ph_24h":{"type":"float"},"pm10":{"type":"float"},"pm10_24h":{"type":"float"},"pm10_24h_iaqi":{"type":"long"},"pm10_iaqi":{"type":"long"},"pm25":{"type":"float"},"pm2_5":{"type":"float"},"pm2_5_24h":{"type":"float"},"pm2_5_24h_iaqi":{"type":"long"},"pm2_5_iaqi":{"type":"long"},"primaryPollutant":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"rainfall":{"type":"float"},"runtime":{"type":"float"},"so2":{"type":"float"},"so2_24h":{"type":"float"},"so2_24h_iaqi":{"type":"long"},"so2_iaqi":{"type":"long"},"speed":{"type":"float"},"tds":{"type":"float"},"tds_24h":{"type":"float"},"temp":{"type":"float"},"temp_24h":{"type":"float"},"temperature":{"type":"float"},"total":{"type":"float"},"turb":{"type":"float"},"turb_24h":{"type":"float"},"vocs":{"type":"float"},"vocs_24h":{"type":"float"},"voltage":{"type":"float"},"waterLevel":{"type":"float"},"wqLevel":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"x":{"type":"float"},"y":{"type":"float"},"z":{"type":"float"}}},"date":{"type":"date"},"method":{"type":"keyword"},"sensor":{"type":"long"},"type":{"type":"keyword"}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"10s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"alarmId":{"type":"keyword"},"alarmRange":{"type":"integer"},"alarm_code":{"type":"keyword"},"alarm_pic":{"type":"text","norms":false},"alarm_state":{"type":"integer"},"content":{"norms":false,"type":"text"},"current_level":{"type":"integer"},"sponsor":{"type":"keyword"},"time":{"type":"date","format":"yyyy-MM-dd'T'HH:mm:ss.SSSZ"}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"10s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"alarm_code":{"type":"keyword"},"alarm_content":{"norms":false,"type":"text"},"alarm_count":{"type":"integer"},"alarm_type_code":{"type":"keyword"},"alarm_type_id":{"type":"integer"},"current_level":{"type":"integer"},"end_time":{"type":"date","format":"yyyy-MM-dd'T'HH:mm:ss.SSSZ"},"initial_level":{"type":"integer"},"source_id":{"type":"keyword"},"source_name":{"type":"text"},"source_type_id":{"type":"integer"},"start_time":{"type":"date","format":"yyyy-MM-dd'T'HH:mm:ss.SSSZ"},"state":{"type":"integer"},"structure_id":{"type":"integer"}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"collect_time":{"type":"date","format":"date_time || yyyy-MM-dd HH:mm:ss"},"data":{"type":"text","norms":false,"fields":{"keyword":{"type":"keyword","ignore_above":512}}},"iota_device":{"type":"keyword"}}}}} |
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"change_data":{"dynamic":"true","properties":{"diffX":{"type":"float"},"direction":{"type":"float"},"displacement":{"type":"float"},"force":{"type":"float"},"humidity":{"type":"float"},"noise":{"type":"float"},"pm10":{"type":"float"},"pm25":{"type":"float"},"speed":{"type":"float"},"temperature":{"type":"float"},"total":{"type":"float"},"waterLevel":{"type":"float"},"x":{"type":"float"},"y":{"type":"float"},"z":{"type":"float"}}},"data":{"dynamic":"true","properties":{"alarm_status":{"type":"float"},"aqi":{"type":"long"},"aqiLevel":{"type":"long"},"bri":{"type":"float"},"co":{"type":"float"},"co_24h":{"type":"float"},"co_24h_iaqi":{"type":"long"},"co_iaqi":{"type":"long"},"diffX":{"type":"float"},"direction":{"type":"float"},"displacement":{"type":"float"},"do":{"type":"float"},"do_24h":{"type":"float"},"end_state":{"type":"long"},"end_time":{"type":"date"},"female_in":{"type":"float"},"female_out":{"type":"float"},"female_stay":{"type":"float"},"force":{"type":"float"},"frequency":{"type":"float"},"from_state":{"type":"long"},"from_time":{"type":"date"},"humidity":{"type":"float"},"inflow":{"type":"float"},"latitude":{"type":"float"},"longitude":{"type":"float"},"male_in":{"type":"float"},"male_out":{"type":"float"},"male_stay":{"type":"float"},"no2":{"type":"float"},"no2_24h":{"type":"float"},"no2_24h_iaqi":{"type":"long"},"no2_iaqi":{"type":"long"},"noise":{"type":"float"},"o3":{"type":"float"},"o3_1h_24h":{"type":"float"},"o3_1h_24h_iaqi":{"type":"long"},"o3_1h_iaqi":{"type":"long"},"o3_8h":{"type":"float"},"o3_8h_24h":{"type":"float"},"o3_8h_24h_iaqi":{"type":"long"},"o3_8h_iaqi":{"type":"long"},"o3_iaqi":{"type":"long"},"on":{"type":"float"},"on_duration":{"type":"long"},"online":{"type":"float"},"outflow":{"type":"float"},"pEnergy":{"type":"float"},"ph":{"type":"float"},"ph_24h":{"type":"float"},"pm10":{"type":"float"},"pm10_24h":{"type":"float"},"pm10_24h_iaqi":{"type":"long"},"pm10_iaqi":{"type":"long"},"pm25":{"type":"float"},"pm2_5":{"type":"float"},"pm2_5_24h":{"type":"float"},"pm2_5_24h_iaqi":{"type":"long"},"pm2_5_iaqi":{"type":"long"},"primaryPollutant":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"rainfall":{"type":"float"},"runtime":{"type":"float"},"so2":{"type":"float"},"so2_24h":{"type":"float"},"so2_24h_iaqi":{"type":"long"},"so2_iaqi":{"type":"long"},"speed":{"type":"float"},"tds":{"type":"float"},"tds_24h":{"type":"float"},"temp":{"type":"float"},"temp_24h":{"type":"float"},"temperature":{"type":"float"},"total":{"type":"float"},"turb":{"type":"float"},"turb_24h":{"type":"float"},"vocs":{"type":"float"},"vocs_24h":{"type":"float"},"voltage":{"type":"float"},"waterLevel":{"type":"float"},"wqLevel":{"type":"text","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"x":{"type":"float"},"y":{"type":"float"},"z":{"type":"float"}}},"date":{"type":"date"},"method":{"type":"keyword"},"sensor":{"type":"long"},"type":{"type":"keyword"}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"createTime":{"type":"date","format":"date_time || yyyy-MM-dd HH:mm:ss"},"evaluate":{"type":"keyword"},"evaluateTime":{"type":"date","format":"date_time || yyyy-MM-dd HH:mm:ss"},"id":{"type":"keyword"},"job":{"type":"keyword"},"job_id":{"type":"keyword"},"orderNum":{"type":"keyword"},"questionAddress":{"type":"nested","properties":{"sort":{"type":"long"},"t_report_address_id":{"type":"long"},"t_report_address_name":{"type":"text","norms":false,"fields":{"keyword":{"type":"keyword","ignore_above":256}}},"t_report_address_pid":{"type":"long"}}},"questionLocate":{"type":"keyword"},"real_name":{"type":"keyword"},"score":{"type":"keyword"},"status":{"type":"keyword"},"t_job_name":{"type":"keyword"},"t_organization_name":{"type":"keyword"},"t_report_id":{"type":"keyword"},"t_report_name":{"type":"keyword"},"title":{"type":"keyword"},"username":{"type":"keyword"}}}}} |
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"30s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"strict","_all":{"enabled":false},"properties":{"collect_time":{"type":"date","format":"date_time || yyy-MM-dd HH:mm:ss"},"create_time":{"type":"date","format":"date_time || yyyy-MM-dd HH:mm:ss"},"data":{"dynamic":"strict","properties":{"raw":{"type":"float"}}},"iota_device":{"type":"keyword"},"iota_device_name":{"type":"text","norms":false,"fields":{"keyword":{"type":"keyword","ignore_above":100}}},"param":{"dynamic":"strict","properties":{"filterFreq":{"type":"float"},"gainAmplifier":{"type":"long"},"sampleFreq":{"type":"float"},"triggerType":{"type":"long"},"version":{"type":"long"}}},"structId":{"type":"long"}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"describe":{"type":"text","norms":false},"structId":{"type":"integer"},"time":{"type":"date","format":"date_time || yyy-MM-dd HH:mm:ss"},"title":{"type":"text","norms":false}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"picture":{"type":"text","norms":false,"fields":{"keyword":{"type":"keyword","ignore_above":256}}},"confirm":{"type":"boolean"},"content":{"type":"text","norms":false},"diseaseDescribe":{"type":"text","norms":false,"fields":{"keyword":{"type":"keyword","ignore_above":256}}},"diseaseId":{"type":"integer"},"level":{"type":"integer"},"levelDescribe":{"type":"text","norms":false,"fields":{"keyword":{"type":"keyword","ignore_above":256}}},"opinion":{"norms":false,"type":"text"},"parts":{"type":"integer"},"position":{"norms":false,"type":"text"},"result":{"type":"boolean"},"score":{"norms":false,"type":"text"},"structId":{"type":"integer"},"time":{"type":"date","format":"date_time || yyy-MM-dd HH:mm:ss"},"title":{"norms":false,"type":"text"},"weather":{"norms":false,"type":"text"}}}}} |
@ -0,0 +1 @@ |
|||||
|
{"settings":{"index":{"refresh_interval":"300s","number_of_shards":"1","number_of_replicas":0,"translog":{"sync_interval":"60s","durability":"async"}}},"mappings":{"_doc":{"dynamic":"false","_all":{"enabled":false},"properties":{"incline":{"type":"integer"},"inclineProposal":{"type":"text","norms":false},"inclineWeight":{"type":"double"},"inspection":{"type":"integer"},"inspectionProposal":{"type":"text","norms":false},"inspectionWeight":{"type":"double"},"score":{"type":"double"},"structId":{"type":"integer"},"time":{"type":"date","format":"date_time || yyy-MM-dd HH:mm:ss"},"vehicleFlow":{"type":"integer"},"vehicleFlowProposal":{"type":"text","norms":false},"vehicleFlowWeight":{"type":"double"},"vib":{"type":"integer"},"vibProposal":{"type":"text","norms":false},"vibWeight":{"type":"double"}}}}} |
@ -0,0 +1,7 @@ |
|||||
|
#!/bin/bash |
||||
|
for i in $(ls ./baseImage_yamls/启动ES和kibana/初始化ES索引/es_index/); |
||||
|
do |
||||
|
setting=$(cat ./baseImage_yamls/启动ES和kibana/初始化ES索引/es_index/$i) |
||||
|
#30092 是k8s的es-service 的nodePort |
||||
|
curl -H "Content-Type: application/json" -XPUT "http://localhost:30092/$i" -d "$setting" |
||||
|
done |
@ -0,0 +1 @@ |
|||||
|
microk8s.kubectl apply -f local-ES.yaml |
@ -0,0 +1,51 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: emqx-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: emqx-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yamlemqx-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yamlemqx-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yamlemqx #容器名,与标签名要相同 |
||||
|
image: docker.io/emqx/emqx:4.3.9 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
ports: |
||||
|
- containerPort: 1883 #定义容器的端口 |
||||
|
name: tcp-emqx |
||||
|
- containerPort: 18083 #定义容器的端口 |
||||
|
name: tcp-emqx-web |
||||
|
|
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: emqx-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: emqx-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yamlemqx-d #deployment标签 |
||||
|
type: NodePort #ClusterIP |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 1883 # 集群内访问 |
||||
|
targetPort: 1883 #集群内 容器内端口 |
||||
|
name: tcp-1883 |
||||
|
nodePort: 30883 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 18083 # 集群内访问 |
||||
|
targetPort: 18083 #集群内 容器内端口 |
||||
|
name: tcp-18083 |
||||
|
nodePort: 30083 #集群外访问 范围30000-32767 |
@ -0,0 +1,20 @@ |
|||||
|
|
||||
|
进入容器 容器名称按照实际的来 |
||||
|
microk8s.kubectl -n lk exec -it kafka-deployment-7f8f466fd8-47z22 bash |
||||
|
|
||||
|
生产 TOPIC 主题内容 |
||||
|
cd /usr/local/kafka/kafka_2.11-2.0.0 |
||||
|
|
||||
|
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic TOPIC |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
监听 TOPIC 主题内容 |
||||
|
cd /usr/local/kafka/kafka_2.11-2.0.0 |
||||
|
|
||||
|
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic TOPIC --from-beginning |
||||
|
|
@ -0,0 +1,54 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: kafka-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: kafka-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yamlkafka-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yamlkafka-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yamlkafka #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/base-images/kafka-alpine:2.11-1.21-04-19 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
ports: |
||||
|
- containerPort: 9092 #定义容器的端口 |
||||
|
name: tcp-kafka |
||||
|
- containerPort: 2181 #定义容器的端口 |
||||
|
name: tcp-zookeeper |
||||
|
# hostNetwork: true |
||||
|
# dnsPolicy: ClusterFirstWithHostNet |
||||
|
|
||||
|
|
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: kafka-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: kafka-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yamlkafka-d #deployment标签 |
||||
|
type: NodePort #ClusterIP |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 9092 # 集群内访问 |
||||
|
targetPort: 9092 #集群内 容器内端口 |
||||
|
name: tcp-9092 |
||||
|
nodePort: 30992 #集群外访问 范围30000-32767 |
||||
|
- protocol: TCP |
||||
|
port: 2181 # 集群内访问 |
||||
|
targetPort: 2181 #集群内 容器内端口 |
||||
|
name: tcp-2181 |
||||
|
nodePort: 30181 #集群外访问 范围30000-32767 |
@ -0,0 +1,10 @@ |
|||||
|
#!/bin/bash |
||||
|
#k8s的 pod名称获取,后续需需要改进 |
||||
|
#-f 容器内脚本 不加 则 宿主机内脚本 |
||||
|
microk8s.kubectl exec -it pg-deployment-8564d489c8-7xr95 -n lk -- psql -U postgres -f script/create_db.sql |
||||
|
|
||||
|
microk8s.kubectl exec -it pg-deployment-8564d489c8-7xr95 -n lk -- psql -U postgres -d iota -f script/iota_create.sql |
||||
|
|
||||
|
microk8s.kubectl exec -it pg-deployment-8564d489c8-7xr95 -n lk -- psql -U postgres -d axy -f script/axy_schema.sql |
||||
|
|
||||
|
microk8s.kubectl exec -it pg-deployment-8564d489c8-7xr95 -n lk -- psql -U postgres -d axy -f script/axy_data.sql |
@ -0,0 +1,40 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: adminer-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: adminer-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yaml-adminer-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yaml-adminer-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yaml-adminer #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/base-images/adminer:latest #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
ports: |
||||
|
- containerPort: 8080 #定义容器的对外端口 |
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: adminer-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: adminer-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yaml-adminer-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 8081 # 集群内访问 |
||||
|
targetPort: 8080 #集群内 容器内端口 |
||||
|
nodePort: 30881 #集群外访问 范围30000-32767 |
@ -0,0 +1,50 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: pg-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: pg-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yamlpg-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yamlpg-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yamlpg #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/base-images/pg:12-1.21-04-14 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
env: #环境变量 |
||||
|
- name: "POSTGRES_PASSWORD" #变量的名字 |
||||
|
value: "example" #变量的值 |
||||
|
ports: |
||||
|
- containerPort: 5432 #定义容器的对外端口 |
||||
|
volumeMounts: |
||||
|
- name: vol-data #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /var/lib/postgresql/data # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-data |
||||
|
hostPath: |
||||
|
path: /home/anxinlocal/pgdata # 宿主机目录 |
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: pg-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: pg-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yamlpg-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 5432 # 集群内访问 |
||||
|
targetPort: 5432 #集群内 容器内端口 |
||||
|
nodePort: 30432 #集群外访问 范围30000-32767 |
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,2 @@ |
|||||
|
CREATE DATABASE IOTA; |
||||
|
CREATE DATABASE AXY; |
File diff suppressed because one or more lines are too long
@ -0,0 +1,54 @@ |
|||||
|
apiVersion: apps/v1 #指定API版本标签 |
||||
|
kind: Deployment #定义资源的类型/角色,deployment为控制器,service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: redis-deployment #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: yamlredis-d |
||||
|
spec: |
||||
|
replicas: 1 #定义副本数量 |
||||
|
selector: #定义选择器 |
||||
|
matchLabels: #匹配上边的标签 |
||||
|
app: yamlredis-d #名称 |
||||
|
template: #定义模板 |
||||
|
metadata: |
||||
|
labels: |
||||
|
app: yamlredis-d |
||||
|
spec: |
||||
|
containers: #定义容器信息 |
||||
|
- name: yamlredis #容器名,与标签名要相同 |
||||
|
image: repository.anxinyun.cn/base-images/redis:5-1.21-04-13 #容器使用的镜像以及版本 |
||||
|
imagePullPolicy: IfNotPresent #获取镜像的策略 Alawys表示下载镜像 IfNotPresent 表示优先使用本地镜像,否则下载镜像,Never表示仅使用本地镜像 |
||||
|
command: ["/bin/sh","-c","redis-server --protected-mode 'no' --appendonly yes"] #启动容器的运行命令,将覆盖容器中的Entrypoint,对应Dockefile中的ENTRYPOINT |
||||
|
ports: |
||||
|
- containerPort: 6379 #定义容器的对外端口 |
||||
|
volumeMounts: |
||||
|
- name: vol-data #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /data # 容器的数据目录 |
||||
|
- name: vol-log #挂载设备的名字,与volumes[*].name 需要对应 |
||||
|
mountPath: /logs # 容器的数据目录 |
||||
|
volumes: # volumes和container处于同一层级,别搞错了 |
||||
|
- name: vol-data |
||||
|
hostPath: |
||||
|
path: /home/anxinlocal/redisdata # 宿主机目录 |
||||
|
- name: vol-log |
||||
|
hostPath: |
||||
|
path: /home/anxinlocal/redislogs # 宿主机目录 |
||||
|
|
||||
|
--- |
||||
|
apiVersion: v1 #指定API版本标签 |
||||
|
kind: Service #定义资源的类型/角色,Deployment为控制器,Service,endpoints |
||||
|
metadata: #定义资源的元数据信息 |
||||
|
name: redis-service #定义资源的名称,在同一个namespace空间中必须是唯一的 |
||||
|
namespace: lk #默认default |
||||
|
labels: #定义资源标签 |
||||
|
app: redis-s |
||||
|
spec: |
||||
|
selector: |
||||
|
app: yamlredis-d #deployment标签 |
||||
|
type: NodePort |
||||
|
ports: |
||||
|
- protocol: TCP |
||||
|
port: 6379 # 集群内访问 |
||||
|
targetPort: 6379 #集群内 容器内端口 |
||||
|
nodePort: 30379 #集群外访问 范围30000-32767 |
@ -0,0 +1,49 @@ |
|||||
|
#!/bin/bash |
||||
|
images=( |
||||
|
k8s.gcr.io/pause:3.1=registry.cn-hangzhou.aliyuncs.com/google_containers/pause-amd64:3.1 |
||||
|
gcr.io/google_containers/defaultbackend:1.4=registry.cn-hangzhou.aliyuncs.com/google_containers/defaultbackend:1.4 |
||||
|
k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.1=registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v1.10.1 |
||||
|
k8s.gcr.io/heapster-influxdb-amd64:v1.3.3=registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-influxdb-amd64:v1.3.3 |
||||
|
k8s.gcr.io/heapster-amd64:v1.5.2=registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-amd64:v1.5.2 |
||||
|
k8s.gcr.io/heapster-grafana-amd64:v4.4.3=registry.cn-hangzhou.aliyuncs.com/google_containers/heapster-grafana-amd64:v4.4.3 |
||||
|
#1.22 microk8s版本 metrics-server |
||||
|
k8s.gcr.io/metrics-server/metrics-server:v0.5.0=registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server:v0.5.0 |
||||
|
#1.21 microk8s版本 metrics-server |
||||
|
#k8s.gcr.io/metrics-server-amd64:v0.3.6=registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-server-amd64:v0.3.6 |
||||
|
#kube-system/calico-node 离线安装需要 |
||||
|
docker.io/calico/cni:v3.19.1=docker.io/calico/cni:v3.19.1 |
||||
|
docker.io/calico/pod2daemon-flexvol:v3.19.1=docker.io/calico/pod2daemon-flexvol:v3.19.1 |
||||
|
docker.io/calico/node:v3.19.1=docker.io/calico/node:v3.19.1 |
||||
|
#kube-system/calico-kube-controllers离线安装需要 |
||||
|
docker.io/calico/kube-controllers:v3.17.3=docker.io/calico/kube-controllers:v3.17.3 |
||||
|
#kube-system/dashboard-metrics-scraper离线安装需要 |
||||
|
docker.io/kubernetesui/metrics-scraper:v1.0.6=docker.io/kubernetesui/metrics-scraper:v1.0.6 |
||||
|
#kube-system/kubernetes-dashboard离线安装需要 |
||||
|
docker.io/kubernetesui/dashboard:v2.2.0=docker.io/kubernetesui/dashboard:v2.2.0 |
||||
|
#kube-system/coredns离线安装需要 |
||||
|
docker.io/coredns/coredns:1.8.0=docker.io/coredns/coredns:1.8.0 |
||||
|
) |
||||
|
|
||||
|
OIFS=$IFS # 保存旧值 |
||||
|
|
||||
|
imagelist=() |
||||
|
imageindex=1 |
||||
|
for image in ${images[*]}; do |
||||
|
IFS='=' |
||||
|
set $image |
||||
|
echo "准备拉取 $2" |
||||
|
microk8s.ctr image pull $2 |
||||
|
if [ $1 != $2 ]; then |
||||
|
microk8s.ctr image tag $2 $1 |
||||
|
microk8s.ctr image rm $2 |
||||
|
fi |
||||
|
|
||||
|
imagelist[imageindex]=$1 |
||||
|
imageindex=$((imageindex + 1)) |
||||
|
echo "拉取成功" |
||||
|
IFS=$OIFS # 还原旧值 |
||||
|
done |
||||
|
echo "${imagelist[*]}" |
||||
|
microk8s.ctr image export ./dashboardAndCalicoImages.tar ${imagelist[*]} |
||||
|
|
||||
|
#return 0 |
@ -0,0 +1,30 @@ |
|||||
|
#! /bin/bash |
||||
|
find_list=() |
||||
|
index=0 |
||||
|
function read_dir() { |
||||
|
|
||||
|
for file in $(ls $1); do |
||||
|
local path=$1"/"$file |
||||
|
if [ -d $path ]; then #注意此处之间一定要加上空格,否则会报错 |
||||
|
read_dir $path $2 |
||||
|
else |
||||
|
#echo $path #在此处处理文件即可 |
||||
|
extendname=${file##*.} |
||||
|
if [ "$extendname" == "$2" ]; then |
||||
|
|
||||
|
find_list[index]="$path" |
||||
|
echo "找到${2}文件:${find_list[index]}" |
||||
|
index=$((index + 1)) |
||||
|
# else |
||||
|
# echo "$file不匹配 $2" |
||||
|
|
||||
|
fi |
||||
|
fi |
||||
|
done |
||||
|
#echo "数组元素个数为: ${#find_list[*]}" |
||||
|
} |
||||
|
#读取第一个参数 |
||||
|
|
||||
|
read_dir $1 $2 |
||||
|
echo "c-数组元素个数为: ${#find_list[*]}" |
||||
|
return 0 |
@ -0,0 +1,45 @@ |
|||||
|
#!/bin/bash |
||||
|
#所有app镜像 |
||||
|
images=( |
||||
|
repository.anxinyun.cn/anxinyun/smislocal-alarm:6.21-03-18=repository.anxinyun.cn/anxinyun/smislocal-alarm:6.21-03-18 |
||||
|
repository.anxinyun.cn/local/config_center:latest=repository.anxinyun.cn/local/config_center:latest |
||||
|
repository.anxinyun.cn/anxinyun/api:137.21-08-17=repository.anxinyun.cn/anxinyun/api:137.21-08-17 |
||||
|
repository.anxinyun.cn/anxinyun/console-web:75.21-06-10=repository.anxinyun.cn/anxinyun/console-web:75.21-06-10 |
||||
|
repository.anxinyun.cn/anxinyun/project:latest=repository.anxinyun.cn/anxinyun/project:latest |
||||
|
repository.anxinyun.cn/local/et:latest=repository.anxinyun.cn/local/et:latest |
||||
|
repository.anxinyun.cn/iota/dac:28.21-04-14=repository.anxinyun.cn/iota/dac:28.21-04-14 |
||||
|
repository.anxinyun.cn/iota/prometheus:latest=repository.anxinyun.cn/iota/prometheus:latest |
||||
|
repository.anxinyun.cn/anxin/iota-proxy:latest=repository.anxinyun.cn/anxin/iota-proxy:latest |
||||
|
repository.anxinyun.cn/iota/web-console-api:50.21-05-24=repository.anxinyun.cn/iota/web-console-api:50.21-05-24 |
||||
|
repository.anxinyun.cn/anxinyun/py.rpc:dragon.32=repository.anxinyun.cn/anxinyun/py.rpc:dragon.32 |
||||
|
repository.anxinyun.cn/local/report-client:12.21-10-28=repository.anxinyun.cn/local/report-client:12.21-10-28 |
||||
|
) |
||||
|
|
||||
|
OIFS=$IFS # 保存旧值 |
||||
|
imagelist=() |
||||
|
imageindex=1 |
||||
|
for image in ${images[*]}; do |
||||
|
IFS='=' |
||||
|
set $image |
||||
|
echo "准备拉取 $2" |
||||
|
microk8s.ctr image pull $2 |
||||
|
if [ $1 != $2 ]; then |
||||
|
microk8s.ctr image tag $2 $1 |
||||
|
microk8s.ctr image rm $2 |
||||
|
fi |
||||
|
imagelist[imageindex]=$1 |
||||
|
imageindex=$((imageindex + 1)) |
||||
|
echo "拉取成功" |
||||
|
tempname=${2##*/} |
||||
|
echo "tempname=$tempname" |
||||
|
newtarname=${tempname/:/-} |
||||
|
echo "tar存储镜像 $newtarname" |
||||
|
microk8s.ctr image export "./${newtarname}.tar" $1 |
||||
|
IFS=$OIFS # 还原旧值 |
||||
|
done |
||||
|
|
||||
|
echo "${imagelist[*]}" |
||||
|
#microk8s.ctr image export ./baseImages.tar ${imagelist[*]} #全部导入一个tar |
||||
|
#microk8s.ctr image export ./emqx:4.3.5.tar docker.io/emqx/emqx:4.3.9 # emqx导出问题?先用docker导出 |
||||
|
#docker save -o emqx-4.3.9.tar docker.io/emqx/emqx:4.3.9 |
||||
|
return 0 |
@ -0,0 +1,40 @@ |
|||||
|
#!/bin/bash |
||||
|
#所有app镜像 |
||||
|
images=( |
||||
|
docker.io/emqx/emqx:4.3.9=docker.io/emqx/emqx:4.3.9 |
||||
|
repository.anxinyun.cn/base-images/es:6.8.2-3.21-04-21=repository.anxinyun.cn/base-images/es:6.8.2-3.21-04-21 |
||||
|
repository.anxinyun.cn/base-images/kibana:6.8.2=repository.anxinyun.cn/base-images/kibana:6.8.2 |
||||
|
repository.anxinyun.cn/base-images/kafka-alpine:2.11-1.21-04-19=repository.anxinyun.cn/base-images/kafka-alpine:2.11-1.21-04-19 |
||||
|
repository.anxinyun.cn/base-images/pg:12-1.21-04-14=repository.anxinyun.cn/base-images/pg:12-1.21-04-14 |
||||
|
repository.anxinyun.cn/base-images/adminer:latest=repository.anxinyun.cn/base-images/adminer:latest |
||||
|
repository.anxinyun.cn/base-images/redis:5-1.21-04-13=repository.anxinyun.cn/base-images/redis:5-1.21-04-13 |
||||
|
) |
||||
|
|
||||
|
OIFS=$IFS # 保存旧值 |
||||
|
imagelist=() |
||||
|
imageindex=1 |
||||
|
for image in ${images[*]}; do |
||||
|
IFS='=' |
||||
|
set $image |
||||
|
echo "准备拉取 $2" |
||||
|
microk8s.ctr image pull $2 |
||||
|
echo "拉取成功" |
||||
|
if [ $1 != $2 ]; then |
||||
|
microk8s.ctr image tag $2 $1 |
||||
|
microk8s.ctr image rm $2 |
||||
|
fi |
||||
|
imagelist[imageindex]=$1 |
||||
|
imageindex=$((imageindex + 1)) |
||||
|
tempname=${2##*/} |
||||
|
echo "tempname=$tempname" |
||||
|
newtarname=${tempname/:/-} |
||||
|
echo "存储镜像文件名 $newtarname" |
||||
|
microk8s.ctr image export "./${newtarname}.tar" $1 |
||||
|
IFS=$OIFS # 还原旧值 |
||||
|
done |
||||
|
|
||||
|
echo "${imagelist[*]}" |
||||
|
#microk8s.ctr image export ./baseImages.tar ${imagelist[*]} #全部导入一个tar |
||||
|
#microk8s.ctr image export ./emqx:4.3.5.tar docker.io/emqx/emqx:4.3.9 # emqx导出问题?先用docker导出 |
||||
|
#docker save -o emqx-4.3.9.tar docker.io/emqx/emqx:4.3.9 |
||||
|
return 0 |
@ -0,0 +1,4 @@ |
|||||
|
microk8s_2551.assert |
||||
|
microk8s_2551.snap |
||||
|
|
||||
|
包含上述2个microk8s安装文件 |
@ -0,0 +1,182 @@ |
|||||
|
#!/bin/bash |
||||
|
#microk8s v1.22.2 |
||||
|
|
||||
|
sudo snap ack ./microk8s离线包/microk8s_2551.assert |
||||
|
sudo snap install ./microk8s离线包/microk8s_2551.snap --classic |
||||
|
|
||||
|
if [ $? != 0 ]; then |
||||
|
echo "------1-- microk8s 安装失败 code=$?---------" |
||||
|
echo "------1-- microk8s 准备退出 ---------" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
microk8s.kubectl create namespace lk |
||||
|
|
||||
|
dashboardAndCalicoImages_path="./dashboardAndCalicoImages.tar" |
||||
|
if [ ! -f "$dashboardAndCalicoImages_path" ]; then |
||||
|
echo "---------$dashboardAndCalicoImages_path dashboard组件包不存在,退出安装" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
echo "准备导入 dashboard 组件 镜像" |
||||
|
microk8s.ctr --namespace k8s.io image import "$dashboardAndCalicoImages_path" |
||||
|
|
||||
|
|
||||
|
sleep 5s |
||||
|
|
||||
|
echo "------2-- 组件 准备启动 (这步耗时较久,请等待)---------" |
||||
|
microk8s status --wait-ready && microk8s enable dashboard |
||||
|
|
||||
|
token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1) |
||||
|
microk8s kubectl -n kube-system describe secret $token >dashboard_token.txt |
||||
|
|
||||
|
sleep 5s |
||||
|
|
||||
|
microk8s enable dns |
||||
|
|
||||
|
echo "------2-- 组件 启动完成 ---------" |
||||
|
|
||||
|
echo "-------- 本地化 基础进程 开始拉取 ---------" |
||||
|
|
||||
|
#es 挂载数据路径 |
||||
|
mkdir -p /home/anxinlocal/esdata |
||||
|
chmod 777 /home/anxinlocal/esdata |
||||
|
#webapi 报表模板路径 |
||||
|
mkdir -p /home/anxinlocal/static |
||||
|
#pg 挂载数据路径 |
||||
|
mkdir -p /home/anxinlocal/pgdata |
||||
|
|
||||
|
#-----------------------------------base---------------------------- |
||||
|
#判断tar 目录是否存在 |
||||
|
baseImages_tarDir="./baseImage_tars" |
||||
|
if [ ! -d "$baseImages_tarDir" ]; then |
||||
|
echo "---------$baseImages_tarDir base组件包不存在,退出安装" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
find_list=() |
||||
|
# shellcheck source=/dev/null |
||||
|
source ./loopDirToFindYamlOrTar.sh $baseImages_tarDir "tar" |
||||
|
echo "find_list文件个数为: ${#find_list[*]}" |
||||
|
|
||||
|
#导入 base 镜像 |
||||
|
echo "------3--执行 base 镜像拉取 shell脚本 ---------" |
||||
|
echo "准备导入 baseImages 组件 镜像" |
||||
|
for item in ${find_list[*]}; do |
||||
|
echo "------3--开始 导入 压缩包 ${item} ---------" |
||||
|
microk8s.ctr image import "$item" |
||||
|
sleep 2s |
||||
|
done |
||||
|
|
||||
|
|
||||
|
|
||||
|
#判断tar 目录是否存在 |
||||
|
baseImage_yamls="./baseImage_yamls" |
||||
|
if [ ! -d "$baseImage_yamls" ]; then |
||||
|
echo "---------$baseImage_yamls base组件yaml包不存在,退出安装" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
|
||||
|
#启动 base pod |
||||
|
find_list=() |
||||
|
# shellcheck source=/dev/null |
||||
|
source ./loopDirToFindYamlOrTar.sh $baseImage_yamls "yaml" |
||||
|
echo "f-yaml文件个数为: ${#find_list[*]}" |
||||
|
|
||||
|
for item in ${find_list[*]}; do |
||||
|
echo "------3-开始拉取base镜像pod ${item} ---------" |
||||
|
microk8s.kubectl apply -f ${item} |
||||
|
sleep 5s |
||||
|
done |
||||
|
|
||||
|
|
||||
|
|
||||
|
#-----------------------------------pg 和 es---------------------------- |
||||
|
|
||||
|
echo "准备执行pg创建库脚本" |
||||
|
#测试用 |
||||
|
pgpodname=$(microk8s.kubectl get pod -n lk | grep pg-deployment- | awk '{print $1}') |
||||
|
echo " pod名称 $pgpodname" |
||||
|
|
||||
|
#测试用 |
||||
|
echo "------4--开始执行数据库脚本 ---------" |
||||
|
#pg数据库 脚本 |
||||
|
#microk8s.kubectl -n lk logs "$(microk8s.kubectl get pod -n lk | grep pg-deployment- | awk '{print $1}')" |
||||
|
|
||||
|
microk8s.kubectl exec -i "$pgpodname" -n lk -- psql -U postgres <./$baseImage_yamls/启动pg数据库/pgscript/create_db.sql |
||||
|
sleep 5s |
||||
|
microk8s.kubectl exec -i "$pgpodname" -n lk -- psql -U postgres -d iota <./$baseImage_yamls/启动pg数据库/pgscript/iota_create.sql |
||||
|
sleep 5s |
||||
|
microk8s.kubectl exec -i "$pgpodname" -n lk -- psql -U postgres -d axy <./$baseImage_yamls/启动pg数据库/pgscript/axy_schema.sql |
||||
|
sleep 5s |
||||
|
microk8s.kubectl exec -i "$pgpodname" -n lk -- psql -U postgres -d axy <./$baseImage_yamls/启动pg数据库/pgscript/axy_data.sql |
||||
|
sleep 5s |
||||
|
|
||||
|
#microk8s.kubectl exec -i pg-deployment-6b5dbdc447-l7qqk -n lk -- psql -U postgres -f script/create_db.sql |
||||
|
|
||||
|
echo "------4--开始创建es索引 ---------" |
||||
|
source ./$baseImage_yamls/启动ES和kibana/初始化ES索引/init_es_index.sh |
||||
|
echo "------4--结束创建es索引 ---------" |
||||
|
|
||||
|
#kafka pod地址 存入hosts |
||||
|
sed -i "1i $(microk8s.kubectl -n lk get pod -o wide | grep kafka-deployment- | awk '{print $6,$1}') " /etc/hosts |
||||
|
echo "------4--查看hosts ---------" |
||||
|
cat /etc/hosts |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
#-----------------------------------app---------------------------- |
||||
|
#判断tar 目录是否存在 |
||||
|
appImages_tarDir="./appImage_tars" |
||||
|
if [ ! -d "$appImages_tarDir" ]; then |
||||
|
echo "---------$appImages_tarDir app组件包不存在,退出安装" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
find_list=() |
||||
|
# shellcheck source=/dev/null |
||||
|
source ./loopDirToFindYamlOrTar.sh $appImages_tarDir "tar" |
||||
|
echo "find_list文件个数为: ${#find_list[*]}" |
||||
|
|
||||
|
#导入 base 镜像 |
||||
|
echo "------5--执行 app 镜像拉取 shell脚本 ---------" |
||||
|
echo "准备导入 appImages 组件 镜像" |
||||
|
for item in ${find_list[*]}; do |
||||
|
echo "------5--开始 导入 压缩包 ${item} ---------" |
||||
|
microk8s.ctr image import "$item" |
||||
|
sleep 2s |
||||
|
done |
||||
|
|
||||
|
|
||||
|
#判断tar 目录是否存在 |
||||
|
appImage_yamls="./appImage_yamls" |
||||
|
if [ ! -d "$appImage_yamls" ]; then |
||||
|
echo "---------$appImage_yamls app组件yaml包不存在,退出安装" |
||||
|
exit 0 |
||||
|
fi |
||||
|
|
||||
|
#启动 app pod |
||||
|
find_list=() |
||||
|
# shellcheck source=/dev/null |
||||
|
source ./loopDirToFindYamlOrTar.sh $appImage_yamls "yaml" |
||||
|
echo "f-yaml文件个数为: ${#find_list[*]}" |
||||
|
|
||||
|
for item in ${find_list[*]}; do |
||||
|
echo "------6--开始拉取base镜像pod ${item} ---------" |
||||
|
microk8s.kubectl apply -f ${item} |
||||
|
sleep 5s |
||||
|
done |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
echo "------7-- 本地化 进程 部署完成 开始使用 ---------" |
||||
|
|
||||
|
cat dashboard_token.txt |
||||
|
|
||||
|
#microk8s.kubectl edit svc -n kube-system kubernetes-dashboard |
@ -0,0 +1,5 @@ |
|||||
|
dashboardAndCalicoImages.tar |
||||
|
|
||||
|
fetch-images.sh 脚本执行 后存入当前文件夹 |
||||
|
|
||||
|
|
Loading…
Reference in new issue