Commit 7cc4f7a4 authored by 智勇's avatar 智勇

wechat

parent 76f6b83e
...@@ -51,6 +51,9 @@ const serviceCreate = async (data) => { ...@@ -51,6 +51,9 @@ const serviceCreate = async (data) => {
switch (jsonObj.kind) { switch (jsonObj.kind) {
case 'Service': case 'Service':
if (data.wechat === '"1"') {
jsonObj.spec.type = 'NodePort'
}
logger.info('创建svc', JSON.stringify(jsonObj)) logger.info('创建svc', JSON.stringify(jsonObj))
await client.api.v1.namespaces(namespace).services.post({ body: jsonObj }) await client.api.v1.namespaces(namespace).services.post({ body: jsonObj })
break; break;
...@@ -122,14 +125,16 @@ const getPodStatus = (podInfo) => { ...@@ -122,14 +125,16 @@ const getPodStatus = (podInfo) => {
if (podInfo.status.phase === 'Pending') { if (podInfo.status.phase === 'Pending') {
return 'Pending' return 'Pending'
} }
if (podInfo.status.conditions[2].status === 'False') { if (podInfo.status.conditions) {
return 'PodScheduling' if (podInfo.status.conditions[2].status === 'False') {
} return 'PodScheduling'
if (podInfo.status.conditions[0].status === 'False') { }
return 'Initializing' if (podInfo.status.conditions[0].status === 'False') {
} return 'Initializing'
if (podInfo.status.conditions[1].status === 'False') { }
return 'Waiting' if (podInfo.status.conditions[1].status === 'False') {
return 'Waiting'
}
} }
if (podInfo.metadata.deletionTimestamp) { if (podInfo.metadata.deletionTimestamp) {
return 'Terminating' return 'Terminating'
......
...@@ -62,5 +62,7 @@ spec: ...@@ -62,5 +62,7 @@ spec:
port: 6382 port: 6382
- name: '6383' - name: '6383'
port: 6383 port: 6383
- name: '26379'
port: 26379
selector: selector:
qcloud-app: {{serviceName}} qcloud-app: {{serviceName}}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment