Skip to content

Commit

Permalink
asset/manifests: update status of Infrastructure
Browse files Browse the repository at this point in the history
This updates the `Infrastructure.config.openshift.io` object to catch up with [1].

Machine Config Operator uses the `APIServerURL` to point the kubelet on machines to apiserver, and `EtcdDiscoveryDomain` to setup the etcd
members to bootstrap the etcd cluster using dns discovery [2].

This is required as Machine Config Operator currently uses the `cluster-config-v1` to creates these values and as `cluster-config-v1` is getting deprecated [3], Machine Config Operator will move to
using the status of `Infrastructure.config.openshift.io` for sourcing that information.

[1]: openshift/api#189
[2]: https://github.com/etcd-io/etcd/blob/583763261f1c843e07c1bf7fea5fb4cfb684fe87/Documentation/op-guide/clustering.md#dns-discovery
[3]: openshift#680
  • Loading branch information
abhinavdahiya committed Jan 30, 2019
1 parent 1a17f19 commit e86ff6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/asset/manifests/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func (i *Infrastructure) Generate(dependencies asset.Parents) error {
// not namespaced
},
Status: configv1.InfrastructureStatus{
Platform: platform,
Platform: platform,
APIServerURL: getAPIServerURL(installConfig.Config),
EtcdDiscoveryDomain: getEtcdDiscoveryDomain(installConfig.Config),
},
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/manifests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ func configMap(namespace, name string, data genericData) *configurationObject {
func getAPIServerURL(ic *types.InstallConfig) string {
return fmt.Sprintf("https://%s-api.%s:6443", ic.ObjectMeta.Name, ic.BaseDomain)
}

func getEtcdDiscoveryDomain(ic *types.InstallConfig) string {
return fmt.Sprintf("%s.%s", ic.ClusterName, ic.BaseDomain)
}

0 comments on commit e86ff6c

Please sign in to comment.