open-cluster-management-io / registration-operator

Minimum cluster registration and work
Apache License 2.0
58 stars 58 forks source link

Allow klusterlet to patch hostAliases when creating klusterlet-registration-agent deployment #318

Open abdennour opened 1 year ago

abdennour commented 1 year ago

Hi, IF we want to add hostAliases in all deployments under the namespace open-cluster-management-agent. So the Managed Cluster can resolve hostname of hub cluster API.

# patch
spec:
  template:
    spec:
     hostAliases:
       - ip: a.b.x.y
         hostnames:
           - api.company.lan

We patched klusterlet deployment, it's fine.. but when we patched klusterlet-registration-agent , it get overriden.

There is a permanent way to patch klusterlet-registration-agent by hostAliases and in general by any Pod Spec.

qiujian16 commented 1 year ago

you can set hubApiServerHostAlias in klusterlet resource, it will update the hostaliases field on registration/work agent.