apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
  labels:
    cluster.x-k8s.io/cluster-name: test
    pool: md-0
  name: test-md-0
  namespace: eksa-system
spec:
  clusterName: test
  replicas: 1
  selector:
    matchLabels: {}
  template:
    metadata:
      labels:
        cluster.x-k8s.io/cluster-name: test
        pool: md-0
    spec:
      bootstrap:
        configRef:
          apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
          kind: KubeadmConfigTemplate
          name: test-md-0-template-1234567890000
      clusterName: test
      infrastructureRef:
        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
        kind: TinkerbellMachineTemplate
        name: test-md-0-1234567890000
      version: v1.21.2-eks-1-21-4
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: TinkerbellMachineTemplate
metadata:
  name: test-md-0-1234567890000
  namespace: eksa-system
spec:
  template:
    spec:
      hardwareAffinity:
        required:
        - labelSelector:
            matchLabels: 
              type: worker
      templateOverride: |
        global_timeout: 6000
        id: ""
        name: test
        tasks:
        - actions:
          - environment:
              COMPRESSED: "true"
              DEST_DISK: '{{ index .Hardware.Disks 0 }}'
              IMG_URL: https://bottlerocket.gz
            image: ""
            name: stream-image
            timeout: 600
          - environment:
              BOOTCONFIG_CONTENTS: kernel {}
              DEST_DISK: '{{ formatPartition ( index .Hardware.Disks 0 ) 12 }}'
              DEST_PATH: /bootconfig.data
              DIRMODE: "0700"
              FS_TYPE: ext4
              GID: "0"
              MODE: "0644"
              UID: "0"
            image: ""
            name: write-bootconfig
            pid: host
            timeout: 90
          - environment:
              DEST_DISK: '{{ formatPartition ( index .Hardware.Disks 0 ) 12 }}'
              DEST_PATH: /user-data.toml
              DIRMODE: "0700"
              FS_TYPE: ext4
              GID: "0"
              HEGEL_URLS: http://5.6.7.8:50061,http://5.6.7.8:50061
              MODE: "0644"
              UID: "0"
            image: ""
            name: write-user-data
            pid: host
            timeout: 90
          - environment:
              DEST_DISK: '{{ formatPartition ( index .Hardware.Disks 0 ) 12 }}'
              DEST_PATH: /net.toml
              DIRMODE: "0755"
              FS_TYPE: ext4
              GID: "0"
              IFNAME: eno1
              MODE: "0644"
              STATIC_BOTTLEROCKET: "true"
              UID: "0"
            image: ""
            name: write-netplan
            pid: host
            timeout: 90
          - image: ""
            name: reboot-image
            pid: host
            timeout: 90
            volumes:
            - /worker:/worker
          name: test
          volumes:
          - /dev:/dev
          - /dev/console:/dev/console
          - /lib/firmware:/lib/firmware:ro
          worker: '{{.device_1}}'
        version: "0.1"
        
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
  name: test-md-0-template-1234567890000
  namespace: eksa-system
spec:
  template:
    spec:
      joinConfiguration:
        pause:
          imageRepository: public.ecr.aws/eks-distro/kubernetes/pause
          imageTag: v1.21.2-eks-1-21-4
        bottlerocketBootstrap:
          imageRepository: public.ecr.aws/l0g8r8j6/bottlerocket-bootstrap
          imageTag: v1-21-4-eks-a-v0.0.0-dev-build.158
        bottlerocket:
          kernel:
            sysctlSettings:
              abc: def
              foo: bar
          kubernetes:
            allowedUnsafeSysctls:
            - net.core.somaxconn
            - net.ipv4.ip_local_port_range
            clusterDNSIPs:
            - 1.2.3.4
            - 4.3.2.1
            maxPods: 50
        nodeRegistration:
          kubeletExtraArgs:
            provider-id: PROVIDER_ID
            read-only-port: "0"
            anonymous-auth: "false"
            tls-cipher-suites: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
      users:
      - name: ec2-user
        sshAuthorizedKeys:
        - 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC1BK73XhIzjX+meUr7pIYh6RHbvI3tmHeQIXY5lv7aztN1UoX+bhPo3dwo2sfSQn5kuxgQdnxIZ/CTzy0p0GkEYVv3gwspCeurjmu0XmrdmaSGcGxCEWT/65NtvYrQtUE5ELxJ+N/aeZNlK2B7IWANnw/82913asXH4VksV1NYNduP0o1/G4XcwLLSyVFB078q/oEnmvdNIoS61j4/o36HVtENJgYr0idcBvwJdvcGxGnPaqOhx477t+kfJAa5n5dSA5wilIaoXH5i1Tf/HsTCM52L+iNCARvQzJYZhzbWI1MDQwzILtIBEQCJsl2XSqIupleY8CxqQ6jCXt2mhae+wPc3YmbO5rFvr2/EvC57kh3yDs1Nsuj8KOvD78KeeujbR8n8pScm3WDp62HFQ8lEKNdeRNj6kB8WnuaJvPnyZfvzOhwG65/9w13IBl7B1sWxbFnq2rMpm5uHVK7mAmjL0Tt8zoDhcE1YJEnp9xte3/pvmKPkST5Q/9ZtR9P5sI+02jY0fvPkPyC03j2gsPixG7rpOCwpOdbny4dcj0TDeeXJX8er+oVfJuLYz0pNWJcT2raDdFfcqvYA0B0IyNYlj5nWX4RuEcyT3qocLReWPnZojetvAG/H8XwOh7fEVGqHAKOVSnPXCSQJPl6s0H12jPJBDJMTydtYPEszl4/CeQ=='
        sudo: ALL=(ALL) NOPASSWD:ALL
      format: bottlerocket

---