apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: clusterapi-controllers
  namespace: openstack-provider-system
  labels:
    control-plane: controller-manager
    controller-tools.k8s.io: "1.0"
spec:
  replicas: 1
  selector:
    matchLabels:
      control-plane: controller-manager
      controller-tools.k8s.io: "1.0"
  template:
    metadata:
      labels:
        control-plane: controller-manager
        controller-tools.k8s.io: "1.0"
    spec:
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
      - key: CriticalAddonsOnly
        operator: Exists
      - effect: NoExecute
        key: node.kubernetes.io/not-ready
        operator: Exists
      - effect: NoExecute
        key: node.kubernetes.io/unreachable
        operator: Exists
      containers:
      - name: openstack-machine-controller
        image: k8scloudprovider/openstack-cluster-api-controller:latest
        volumeMounts:
        - name: config
          mountPath: /etc/kubernetes
        - name: cloud-config
          mountPath: /etc/openstack
        - name: kubeadm
          mountPath: /usr/bin/kubeadm
        resources:
          requests:
            cpu: 100m
            memory: 20Mi
          limits:
            cpu: 100m
            memory: 30Mi
        env:
          - name: USER
            value: root
          - name: OS_CLOUD
            valueFrom:
              secretKeyRef:
                name: cloud-selector
                key: OS_CLOUD
      volumes:
      - name: config
        hostPath:
          path: /etc/kubernetes
      - name: cloud-config
        secret:
          secretName: cloud-config
      - name: kubeadm
        hostPath:
          path: /usr/bin/kubeadm
