apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
  labels:
    machine.openshift.io/cluster-api-cluster: {{ .InfraId }}
  name: {{ .InfraId }}-submariner-gw-{{ .AZ }}
  namespace: openshift-machine-api
spec:
  replicas: 1
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: {{ .InfraId }}
      machine.openshift.io/cluster-api-machineset: {{ .InfraId }}-submariner-gw-{{ .AZ }}
  template:
    metadata:
      labels:
        machine.openshift.io/cluster-api-cluster: {{ .InfraId }}
        machine.openshift.io/cluster-api-machine-role: worker
        machine.openshift.io/cluster-api-machine-type: worker
        machine.openshift.io/cluster-api-machineset: {{ .InfraId }}-submariner-gw-{{ .AZ }}
    spec:
      metadata:
        labels:
          submariner.io/gateway: "true"
      taints:
        - effect: NoSchedule
          key: node-role.submariner.io/gateway
      providerSpec:
        value:
          ami:
            id: {{ .AMIId }}
          apiVersion: awsproviderconfig.openshift.io/v1beta1
          credentialsSecret:
            name: aws-cloud-credentials
          deviceIndex: 0
          iamInstanceProfile:
            id: {{ .InfraId }}-worker-profile
          instanceType: {{ .InstanceType }}
          kind: AWSMachineProviderConfig
          placement:
            availabilityZone: {{ .AZ }}
            region: {{ .Region }}
          securityGroups:
            - filters:
                - name: tag:Name
                  values:
                    - {{ .InfraId }}-worker-sg
                    - {{ .SecurityGroupName }}
          subnet:
            filters:
              - name: tag:Name
                values:
                  - {{ .SubnetName }}
          tags:
            - name: kubernetes.io/cluster/{{ .InfraId }}
              value: owned
            - name: submariner.io
              value: gateway
          userDataSecret:
            name: worker-user-data
          publicIp: true
