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