---
apiVersion: kubeadm.k8s.io/v1beta2
kind: JoinConfiguration
discovery:
  bootstrapToken:
    apiServerEndpoint: {{ if and .kubernetes.control_plane_endpoint (ne .kubernetes.control_plane_endpoint "") }}{{ .kubernetes.control_plane_endpoint }}{{ else }}{{ .init_kubernetes_node }}{{ end }}:{{ .kubernetes.apiserver.port }}
    token: "{{ .kubeadm_token }}"
    unsafeSkipCAVerification: true
{{- if .groups.kube_control_plane | default list | has .inventory_name }}
controlPlane:
  localAPIEndpoint:
    advertiseAddress: {{ .internal_ipv4 }}
    bindPort: {{ .kubernetes.apiserver.port }}
  certificateKey: {{ .kubeadm_cert }}
{{- end }}
nodeRegistration:
  criSocket: {{ .cri.cri_socket }}
  kubeletExtraArgs:
    cgroup-driver: {{ .cri.cgroup_driver }}
