Commit 8f2e89a4 authored by 黎博's avatar 黎博

fix bug

parent e1b78faf
......@@ -788,7 +788,7 @@ public class TkeService {
List<Service> serviceList = kubernetesClient.services().inNamespace(namespace).list().getItems();
for (Service service: serviceList) {
String serviceName = service.getMetadata().getName();
if (!checkDeploymentExistence(namespace, serviceName)) {
if (!serviceName.startsWith("kafka") && !checkDeploymentExistence(namespace, serviceName)) {
log.info("{}环境{}Deployment不存在,删除Service", namespace, serviceName);
deleteService(namespace, serviceName);
}
......
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
......
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
type: base
qcloud-app: redis5
name: redis5
namespace: {{namespace}}
spec:
replicas: 1
revisionHistoryLimit: 1
selector:
matchLabels:
qcloud-app: redis5
strategy:
type: Recreate
template:
metadata:
labels:
type: base
qcloud-app: redis5
spec:
containers:
- image: ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy: IfNotPresent
name: redis-6379
command: ["redis-server", "--port", "6379"]
resources:
requests:
cpu: 100m
memory: 400Mi
limits:
cpu: 1000m
memory: 4000Mi
livenessProbe:
exec:
command: ["redis-cli", "-p", "6379","info"]
initialDelaySeconds: 100
successThreshold: 1
readinessProbe:
exec:
command: ["redis-cli", "-p", "6379","info"]
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
- image: ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy: IfNotPresent
name: redis-6380
command: ["redis-server", "--port", "6380"]
resources:
requests:
cpu: 100m
memory: 200Mi
limits:
cpu: 512m
memory: 1024Mi
livenessProbe:
exec:
command: ["redis-cli", "-p", "6380","info"]
initialDelaySeconds: 100
successThreshold: 1
readinessProbe:
exec:
command: ["redis-cli", "-p", "6380","info"]
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
- image: ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy: IfNotPresent
name: redis-6381
command: ["redis-server", "--port", "6381"]
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 200m
memory: 200Mi
livenessProbe:
exec:
command: ["redis-cli", "-p", "6381","info"]
initialDelaySeconds: 100
successThreshold: 1
readinessProbe:
exec:
command: ["redis-cli", "-p", "6381","info"]
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
- image: ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy: IfNotPresent
name: redis-6382
command: ["redis-server", "--port", "6382"]
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 200m
memory: 200Mi
livenessProbe:
exec:
command: ["redis-cli", "-p", "6382","info"]
initialDelaySeconds: 100
successThreshold: 1
readinessProbe:
exec:
command: ["redis-cli", "-p", "6382","info"]
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
- image: ccr.ccs.tencentyun.com/{{image}}
imagePullPolicy: IfNotPresent
name: redis-6383
command: ["redis-server", "--port", "6383"]
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 200m
memory: 200Mi
livenessProbe:
exec:
command: ["redis-cli", "-p", "6383","info"]
initialDelaySeconds: 100
successThreshold: 1
readinessProbe:
exec:
command: ["redis-cli", "-p", "6383","info"]
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: qcloudregistrykey
- name: tencenthubkey
restartPolicy: Always
terminationGracePeriodSeconds: 30
status: {}
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
labels:
type: base
qcloud-app: redis5
name: redis5
namespace: {{namespace}}
spec:
type: NodePort
ports:
- name: '6379'
port: 6379
- name: '6380'
port: 6380
- name: '6381'
port: 6381
- name: '6382'
port: 6382
- name: '6383'
port: 6383
selector:
qcloud-app: redis5
\ No newline at end of file
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