-
Notifications
You must be signed in to change notification settings - Fork 11
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
feature/support-multi-node-pools #394
Conversation
@alidaw could you update the docs in path |
As the implementation of multi node pool support will require gsclient to support nested schema at the point where requested Kubernetes template parameters schema will be used for validation of what got assigned to corresponding schema properties of the k8s resource, the implementation must base on gsclient from version 3.15.0 on.
bb18ed0
to
281329b
Compare
Rebased to be ahead of |
281329b
to
e0eafd3
Compare
Done. Please have a look. |
e0eafd3
to
7d0c125
Compare
7d0c125
to
48300a1
Compare
Come with additional parameter called ... - hubble - kube_apiserver_log_enabled - audit_log_enabled - audit_log_level - log_delivery - log_delivery_bucket - log_delivery_access_key - log_delivery_secret_key - log_delivery_interval - log_delivery_endpoint
@alidaw regarding the last commit of the k8s_hubble and and log-related parameters, I think all of them should be optional and computed, you don't need to set the default (since the default is set automatically by the API server when they are not set in the request payload). The reason why we should set them computed is because in the past there was a case where the default was changed in parameter schema (in paas service template) but it was not in terraform provider. Hence conflicts. Using |
a4f823d
to
812629e
Compare
Ok. I see the issue. I've adjusted the schema definition of respective new parameters as you suggested via interactive rebase. I was just wondering why at commit you are applying validation on the new parameter called You define the allowed values hard coded as global via
to then apply validation via
But I suggest to fetch what is allowed via respective parameter's template definition as I did as shown below:
So we do better in referring to validation known by template instead working with hard coded values. |
812629e
to
4fe06a9
Compare
gridscale/resource_gridscale_k8s.go
Outdated
nodePool["rocket_storage"] = props.Parameters["k8s_worker_node_rocket_storage"] | ||
} | ||
if isNodePoolsSet { | ||
nodePoolsSet := nodePoolsSetInterface.([]map[string]interface{}) |
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.
@alidaw Here it should be nodePoolsSet := nodePoolsSetInterface.([]interface{})
, because it is a list. Then:
for _, nodePoolSetInterface := range nodePoolsSet {
nodePoolRead := make(map[string]interface{}, 0)
nodePoolSet := nodePoolSetInterface.(map[string]interface{})
...
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.
@nvthongswansea I've followed your suggestion via interactive rebase.
Sure, I already considered that node pools is a list, where each node pool is supposed to be a string to interface mapping such as map[string]interface{}
. This is why I initialized what we need to iterate over like nodePoolsSet := nodePoolsSetInterface.([]map[string]interface{})
, which at least is a list of string to interface mapping. But when this caused an issue and we need to iterate over nodePoolsSetInterface.([]interface{})
and break down every item to string to interface mapping via nodePoolSetInterface.(map[string]interface{})
instead directly iterating over nodePoolsSetInterface.([]map[string]interface{})
, then it's good to have it fixed now.
I think iterating over collection broken down via nodePoolsSetInterface.([]map[string]interface{})
may break the flow in case if there are no node pools set, right?
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.
@alidaw afair, go does not allow that. It complains that nodePoolsSetInterface is an interface{}
not a []map[string]interface{}
. So we have to do type assertions one by one.
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.
Yes. In this direction I was thinking. Thx.
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.
... Ah and I've recognized that at the functions called resourceGridscaleK8sCreate
, resourceGridscaleK8sUpdate
and validateK8sParameters
I already had considered to break down the node pools interface into a collection of interfaces via .([]interface{})
. So then I think at the function called resourceGridscaleK8sRead
either it was a leftover or happened accidentally that i broke the interface down into a list of string to interface mapping via .([]map[string]interface{})
.
4fe06a9
to
2475a34
Compare
@alidaw name of gsk cluster or node pool does not allow |
Ok. I've added a commit to stick to naming convention of node at k8s resource test. |
LGTM |
The implementations out for review are used to add multi node pool support at the k8s resource.