-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config: InfrastructureSpec reference cloud provider configuration #245
config: InfrastructureSpec reference cloud provider configuration #245
Conversation
/hold so we can another api reviewer to ack. |
config/v1/types_infrastructure.go
Outdated
// when using the built-in cloud provider integration or the external cloud controller manager. | ||
// The namespace for this config map is openshift-config. | ||
// +optional | ||
CloudConfig ConfigMapNameReference `json:"cloudConfig"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is optional, would it make sense for it to be a pointer and omitempty
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/hold
config/v1/types_infrastructure.go
Outdated
@@ -22,8 +22,12 @@ type Infrastructure struct { | |||
|
|||
// InfrastructureSpec contains settings that apply to the cluster infrastructure. | |||
type InfrastructureSpec struct { | |||
// secret reference? | |||
// configmap reference to file? | |||
// CloudConfig is a reference to a ConfigMap containing the cloud provider configuration file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cloudConfig
fyi @rphillips |
is there anything else that needs to be done here? should we proceed merging so control plane components can start to watch this? |
The hold on this is by @soltysh #245 (comment) I think he is just asking for s/CloudConfig/cloudConfig/ |
@derekwaynecarr the PR needs to include |
That is correct, and I still don't see that solved. |
c24365d
to
07f28f5
Compare
this should be all set. |
/hold cancel |
in platforms like None. AWS this is going to be empty... |
Also in the past |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: derekwaynecarr, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I have same question as @abhinavdahiya , is |
@gnufied @abhinavdahiya good point. i think the username and password that interacts with the iaas provider must support changing, but for both vsphere and openstack these are managed via secrets. if we put this in status instead of spec, we will have to still support editability of the referenced secret. |
there are a few things i guess we should think about.
/cc @dgoodwin thoughts? |
Does Spec imply human user editable? Reading through https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status it doesn't seem to match, certainly anything human editable should be in Spec, but the key differentiator is desired state, whereas status is for observed state. Cloud provider config to me feels like desired state, not observed. There are ways we can make fields immutable once set. However we're already moving fast in this direction for this infrastructure object, but it still feels wrong to be tucking these things into status. I will raise this on the group g arch call this week to see what everyone thinks. CCO could definitely manage the secrets assuming we can get CCO running prior to when cloud config is needed. Does CCO need to know anything about cloud config? (because that feels off to me at least initially) We'll discuss on a call later this morning. |
The desired state by who? users drive the desired state and therefore there is the expectation of users that spec fields are configurable unless specifically denied. Since the cloud provider config location is setup by the installer at install time, keeping in status provides the current observed state.
It's easier to start with status because
I think Derek was talking about the secret with infracreds present inside the cloud config for openstack/vshpere |
Desired state for the cluster, be it by the user, a programmatic component, or a user via a programmatic component. Some of these fields definitely should be immutable, no question, but I'm concerned that "anything we don't want humans changing = status" is not consistent with the API guidelines. Anything human editable should be in spec, but I can't find anything that says the inverse is true. If that's accurate, we should not push things to status when what we're really wanting is immutable fields.
I'll agree it's easier right now, I'm questioning if it's correct/consistent API design and if it's easier in the long run. If we drop this information into status and people start coding to it, it becomes very difficult to pull it out later. We should get APIs right as early as possible. If this cloud config (a) was observed, (b) can be reconstructed if lost, (c) never needs to modified by a user then perhaps this makes sense in status. The other fields I'm thinking about: Platform: Did we observe that this is an AWS cluster, or did the user specify this when they installed? Can we know it's AWS if the status were cleared? IMO the user set this, it's desired state for the cluster and most users of the value will be treating it as such. InfrastructureName (from the other PR). We didn't observe this, the installer (most likely) set it, if lost we're in trouble, and most users of the value are looking for desired state, not observed. |
If you take installer as a one shot controller. Installer sets the observed state in status for this object. There was no desired state for this object. Installer one shot controller would be equivalent to controller with internal logic and decisions |
Not following the train of thought, it's not about desired state for the Infrastructure object, I'm viewing the Infrastructure object as desired state for the cluster. Will raise in group g arch call this week. |
From group G arch call: api conventions doesn't cover a lot of case law, if it's a fundamental fact of the cluster that cannot be changed it is observed state, spec can be things you were told, status can be reality. |
The cloud provider config is optionaly present on the bootstrap node based on the user choice or platform. When the `.spec.cloudConfig` [1] is set, that requires the cloud provider config file to be provided. In cluster operator uses the same field from `infrastructure.config.openshift.io/cluster` object to selectively fetch the cloud config configmap reference. [1]: openshift/api#245
Adds a
CloudConfig
config map reference toInfrastructureSpec
that contains the cloud provider configuration file used for in-tree cloud provider integration as well as the external cloud controller manager once enabled.see:
https://github.com/kubernetes/kubernetes/blob/master/cmd/cloud-controller-manager/app/apis/config/v1alpha1/types.go#L33
https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/apis/config/types.go#L180