[ Agent ] [ CMII ] - 完成工具类的代码

This commit is contained in:
zeaslity
2024-01-09 16:42:27 +08:00
parent 36b8e36392
commit 22faf15665
18 changed files with 1307 additions and 13 deletions

302
agent-go/tmp/test.json Normal file
View File

@@ -0,0 +1,302 @@
{
"metadata": {
"name": "cmii-uav-gateway-64ddc6c4c7-77k2w",
"generateName": "cmii-uav-gateway-64ddc6c4c7-",
"namespace": "uavcloud-devflight",
"selfLink": "/api/v1/namespaces/uavcloud-devflight/pods/cmii-uav-gateway-64ddc6c4c7-77k2w",
"uid": "02e1277f-b632-4e7a-b204-dad30885de48",
"resourceVersion": "468813592",
"creationTimestamp": "2023-12-25T09:04:01Z",
"labels": {
"app.kubernetes.io/instance": "cmii-uav-gateway",
"app.kubernetes.io/managed-by": "Helm",
"cmii.app": "cmii-uav-gateway",
"cmii.modules": "cmlc",
"cmii.type": "backend",
"cmii/managed-by": "jenkins-pipeline-standalone-job",
"pod-template-hash": "64ddc6c4c7"
},
"ownerReferences": [
{
"apiVersion": "apps/v1",
"kind": "ReplicaSet",
"name": "cmii-uav-gateway-64ddc6c4c7",
"uid": "1d76ec6d-4c9c-435b-8aca-5bb0755f9ab1",
"controller": true,
"blockOwnerDeletion": true
}
]
},
"spec": {
"volumes": [
{
"name": "glusterfs-backend-log-volume",
"persistentVolumeClaim": {
"claimName": "glusterfs-backend-log-pvc"
}
},
{
"name": "elk-json-log",
"hostPath": {
"path": "/var/log/",
"type": ""
}
},
{
"name": "default-token-hzddz",
"secret": {
"secretName": "default-token-hzddz",
"defaultMode": 420
}
}
],
"containers": [
{
"name": "cmii-uav-gateway",
"image": "harbor.cdcyy.com.cn/cmii/cmii-uav-gateway:4.1.6-beta",
"ports": [
{
"name": "pod-port",
"containerPort": 8080,
"protocol": "TCP"
}
],
"env": [
{
"name": "GIT_BRANCH",
"value": "staging"
},
{
"name": "GIT_COMMIT",
"value": "bdcdf85720bd1da671bdb55e80f2192968d98633"
},
{
"name": "K8S_NAMESPACE",
"value": "uavcloud-devflight"
},
{
"name": "APPLICATION_NAME",
"value": "cmii-uav-gateway"
},
{
"name": "CUST_JAVA_OPTS",
"value": "-Xms1000m -Xmx2048m -Dreactor.netty.ioWorkerCount=256 -Dreactor.netty.ioSelectCount=1"
},
{
"name": "NACOS_REGISTRY",
"value": "helm-nacos:8848"
},
{
"name": "NACOS_USERNAME",
"value": "developer"
},
{
"name": "NACOS_PASSWORD",
"value": "Deve@9128"
},
{
"name": "NACOS_DISCOVERY_IP",
"valueFrom": {
"fieldRef": {
"apiVersion": "v1",
"fieldPath": "status.podIP"
}
}
},
{
"name": "NACOS_DISCOVERY_PORT",
"value": "8080"
},
{
"name": "IMAGE_VERSION",
"value": "4.1.6-beta"
},
{
"name": "BIZ_CONFIG_GROUP"
},
{
"name": "SYS_CONFIG_GROUP"
}
],
"resources": {
"limits": {
"cpu": "2",
"memory": "2Gi"
},
"requests": {
"cpu": "100m",
"memory": "200Mi"
}
},
"volumeMounts": [
{
"name": "glusterfs-backend-log-volume",
"mountPath": "/cmii/logs",
"subPath": "uavcloud-devflight/cmii-uav-gateway"
},
{
"name": "elk-json-log",
"mountPath": "/cmii/jsonlogs",
"subPath": "json_pv_logfile"
},
{
"name": "default-token-hzddz",
"readOnly": true,
"mountPath": "/var/run/secrets/kubernetes.io/serviceaccount"
}
],
"livenessProbe": {
"httpGet": {
"path": "/cmii/ping",
"port": "pod-port",
"scheme": "HTTP"
},
"initialDelaySeconds": 5,
"timeoutSeconds": 2,
"periodSeconds": 10,
"successThreshold": 1,
"failureThreshold": 3
},
"readinessProbe": {
"httpGet": {
"path": "/cmii/ping",
"port": "pod-port",
"scheme": "HTTP"
},
"initialDelaySeconds": 5,
"timeoutSeconds": 2,
"periodSeconds": 10,
"successThreshold": 1,
"failureThreshold": 3
},
"startupProbe": {
"httpGet": {
"path": "/cmii/ping",
"port": "pod-port",
"scheme": "HTTP"
},
"initialDelaySeconds": 120,
"timeoutSeconds": 2,
"periodSeconds": 10,
"successThreshold": 1,
"failureThreshold": 10
},
"terminationMessagePath": "/dev/termination-log",
"terminationMessagePolicy": "File",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"serviceAccountName": "default",
"serviceAccount": "default",
"nodeName": "dev-07.ecs.io",
"securityContext": {},
"imagePullSecrets": [
{
"name": "harborsecret"
}
],
"affinity": {
"nodeAffinity": {
"requiredDuringSchedulingIgnoredDuringExecution": {
"nodeSelectorTerms": [
{
"matchExpressions": [
{
"key": "uavcloud.affinity",
"operator": "In",
"values": [
"common"
]
}
]
}
]
}
}
},
"schedulerName": "default-scheduler",
"tolerations": [
{
"key": "node.kubernetes.io/not-ready",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 300
},
{
"key": "node.kubernetes.io/unreachable",
"operator": "Exists",
"effect": "NoExecute",
"tolerationSeconds": 300
}
],
"priority": 0,
"enableServiceLinks": true
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2023-12-25T09:04:01Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2023-12-26T07:22:36Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2023-12-26T07:22:36Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2023-12-25T09:04:01Z"
}
],
"hostIP": "192.168.11.161",
"podIP": "10.244.165.25",
"podIPs": [
{
"ip": "10.244.165.25"
}
],
"startTime": "2023-12-25T09:04:01Z",
"containerStatuses": [
{
"name": "cmii-uav-gateway",
"state": {
"running": {
"startedAt": "2023-12-26T07:20:22Z"
}
},
"lastState": {
"terminated": {
"exitCode": 1,
"reason": "Error",
"startedAt": "2023-12-26T07:14:52Z",
"finishedAt": "2023-12-26T07:15:18Z",
"containerID": "docker://da24e4587f76139c30f4730b18210c11c07f1d4f5afda93b3d70d2eef6aeeb53"
}
},
"ready": true,
"restartCount": 9,
"image": "harbor.cdcyy.com.cn/cmii/cmii-uav-gateway:4.1.6-beta",
"imageID": "docker-pullable://harbor.cdcyy.com.cn/cmii/cmii-uav-gateway@sha256:138ae1ed2596746b429f158795791eb677f26c2aa523784f42a13d7256652310",
"containerID": "docker://13a6bfe5218ba9b9edeaf5c1378d73ecb06fc90cb648e0c158baa9f528c1e391",
"started": true
}
],
"qosClass": "Burstable"
}
}