vmware / terraform-provider-vcd

Terraform VMware Cloud Director provider
https://www.terraform.io/docs/providers/vcd/
Mozilla Public License 2.0
151 stars 112 forks source link

how to configure custom NTP servers for tanzu #1334

Closed andrzej-dobrzynski-pushgaming closed 1 month ago

andrzej-dobrzynski-pushgaming commented 2 months ago

Hello @adambarreiro et al

how to configure custom NTP servers for tanzu

Terraform Version

% tfenv version-name
1.5.7

Terraform Configuration Files

apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
spec:
  kubeadmConfigSpec:
    ntp:
      servers:
        - time.aws.com
      enabled: true
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
spec:
  template:
    spec:
      ntp:
        servers:
          - time.aws.com
        enabled: true

Expected Behavior

% cat /etc/chrony/chrony.conf
server time.aws.com iburst

Actual Behavior

% cat /etc/chrony/chrony.conf
server ntp.ubuntu.com iburst

Steps to Reproduce

as above

References

https://cluster-api.sigs.k8s.io/tasks/bootstrap/kubeadm-bootstrap/

ntp:
  servers:
    - IP_ADDRESS
  enabled: true
andrzej-dobrzynski-pushgaming commented 1 month ago

if above does not work then this does

apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
spec:
  kubeadmConfigSpec:
    postKubeadmCommands:
    - echo "pool time.aws.com iburst prefer" >> /etc/chrony/chrony.conf && systemctl restart chrony
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
spec:
  template:
    spec:
      postKubeadmCommands:
      - echo "pool time.aws.com iburst prefer" >> /etc/chrony/chrony.conf && systemctl restart chrony
adambarreiro commented 1 month ago

Is it solved @andrzej-dobrzynski-pushgaming? To be honest I'm not sure whether we can help much, this looks like a Kubernetes specific issue.

andrzej-dobrzynski-pushgaming commented 1 month ago

yes its solved

root@control-plane-node-pool:~# cat /etc/chrony/chrony.conf |grep prefer
pool time.aws.com iburst prefer
root@control-plane-node-pool:~# chronyc sources |grep "*"
^* ec2-35-176-149-124.eu-west-2.compute.amazonaws.com