Kubernetes

Patching commands

kubectl get deployment -n speed-ci-02-app | grep -v NAME | awk '{print $1}' | xargs -L1  kubectl patch deployment --patch '{\"spec\": {\"template\": {\"spec\": {\"imagePullSecrets\": [{\"name\": \"nexus3\"}]}}}}' -n speed-ci-02-app

Pod anti-affinity

Pod has to be deployed on all nodes

        podAntiAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: k8s-app
                operator: In
                values:
                - kube-dns
            namespaces:
            - kube-system

Pod on all servers

Configuration for ignoring master taint

apiVersion: extensions/v1beta1
kind: Deployment
...
  spec:
...
    spec:
...
      tolerations:
        - key: "node-role.kubernetes.io/master"
          effect: "NoSchedule"
          operator: "Exists"