From 85f0a97f2424547ba0aec70624f747839e12b4ec Mon Sep 17 00:00:00 2001 From: winloong <21272660+vinloong@users.noreply.github.com> Date: Sun, 24 Apr 2022 17:46:34 +0800 Subject: [PATCH] change deployment.yaml --- syncimages/deployment.yaml | 40 ++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/syncimages/deployment.yaml b/syncimages/deployment.yaml index 1a83d93..d0c79d8 100644 --- a/syncimages/deployment.yaml +++ b/syncimages/deployment.yaml @@ -1,4 +1,4 @@ -kind: Deployment +kind: DaemonSet apiVersion: apps/v1 metadata: name: syncimages @@ -7,7 +7,6 @@ metadata: app: tool component: syncimages spec: - replicas: 1 selector: matchLabels: app: tool @@ -20,10 +19,39 @@ spec: spec: containers: - name: syncimages - image: 'repository.anxinyun.cn/devops/syncimages:0.13' - command: - - ./run.sh + image: 'repository.anxinyun.cn/devops/syncimages:0.23' imagePullPolicy: IfNotPresent securityContext: privileged: true - + volumeMounts: + - name: docker-sock + mountPath: /var/run/docker.sock + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/worker + operator: In + values: + - '' + - worker + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - tool + - key: component + operator: In + values: + - syncimages + namespaces: + - ops + topologyKey: kubernetes.io/hostname + volumes: + - name: docker-sock + hostPath: + path: /var/run/docker.sock