0

When deploying a kubernetes cluster with kubespray with need to declare IPS.

enter image description here

But can we deploy a cluster with FQDN ? I tried first with declaring IP and modify the hosts.yaml with my fqdn of my host. but i have a issue when generating certificates.

1 Answers1

0

You can use your IPs while declaring, then create your inventory. But after inventory is created, you can replace node1, node2 etc with your inventory name

    all:
  hosts:
    master1.xyz.domain:
      ansible_host: 10.0.0.10
      ip: 10.0.0.10
      access_ip: 10.0.0.10
    master2.xyz.domain:
      ansible_host: 10.0.0.11
      ip: 10.0.0.11
      access_ip: 10.0.0.11
    master3.xyz.domain:
      ansible_host: 10.0.0.12
      ip: 10.0.0.12
      access_ip: 10.0.0.12
    worker1.xyz.domain:
      ansible_host: 10.0.0.13
      ip: 10.0.0.13
      access_ip: 10.0.0.13
    worker2.xyz.domain:
      ansible_host: 10.0.0.14
      ip: 10.0.0.14
      access_ip: 10.0.0.14
    worker3.xyz.domain:
      ansible_host: 10.0.0.15
      ip: 10.0.0.15
      access_ip: 10.0.0.15
    worker4.xyz.domain:
      ansible_host: 10.0.0.16
      ip: 10.0.0.16
      access_ip: 10.0.0.16
  children:
    kube_control_plane:
      hosts:
        master1.xyz.domain:
        master2.xyz.domain:
        master3.xyz.domain:
    kube_node:
      hosts:
        worker1.xyz.domain:
        worker2.xyz.domain:
        worker3.xyz.domain:
        worker4.xyz.domain:
    etcd:
      hosts:
        master1.xyz.domain:
        master2.xyz.domain:
        master3.xyz.domain:
    k8s_cluster:
      children:
        kube_control_plane:
        kube_node:
    calico_rr:
      hosts: {}