-
Notifications
You must be signed in to change notification settings - Fork 676
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
Support for ODF Worker Replace #4600
Conversation
00a53d1
to
62568a6
Compare
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/constants.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
func int32Ptr(i int32) *int32 { return &i } | ||
|
||
// To execute a given template using the openshift go client | ||
func ExecuteTemplate(osdID string) { |
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.
Lets discuss this function over webex once.
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.
yeah sure!
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
ibm/service/kubernetes/utils/softwaredefinedsolution/odfWorkerReplace.go
Outdated
Show resolved
Hide resolved
62568a6
to
ef430ad
Compare
9b8b7bf
to
863a5e1
Compare
@@ -635,3 +689,23 @@ func vpcClusterVpcWorkersVersionRefreshFunc(client v2.Workers, workerID, cluster | |||
return worker, versionUpdating, nil | |||
} | |||
} | |||
|
|||
func validateSoftwareDefinedStorage(sds string) error { | |||
var sdsList []string = []string{"ODF", "PTX"} |
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.
Remove PTX from here and create a global/constant variable to save these strings.
set[v] = true | ||
} | ||
if !set[strings.ToUpper(sds)] { | ||
return fmt.Errorf("[ERROR] Software Defined Storage not found!") |
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.
On error, also print the supported values for this parameter.
) | ||
|
||
// ODF Struct Defined | ||
type Odf struct{} |
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.
Delete this.
@hkantare Please take a look at this PR. I've completed odf related reviews. |
c5cffff
to
5a9596c
Compare
@@ -65,6 +71,45 @@ func ResourceIBMContainerVpcWorker() *schema.Resource { | |||
Description: "Cluster name", | |||
}, | |||
|
|||
"sds": { | |||
Type: schema.TypeString, |
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.
Introducing a required field wil be breaking change.
sds is a mandatory to provision a worker?
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.
@aayushsss1 sds parameter should be an optional field. The schema has to be similar to this "check_ptx_status" parameter
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.
Updated it
@@ -161,10 +215,15 @@ func resourceIBMContainerVpcWorkerCreate(d *schema.ResourceData, meta interface{ | |||
return fmt.Errorf("[ERROR] Invalid kubeconfig,, failed to create clientset: %s", err) | |||
} | |||
//3. List pods from kube-system namespace | |||
_, err = clientset.CoreV1().Pods("default").List(context.TODO(), metav1.ListOptions{}) | |||
_, err = clientset.CoreV1().Pods("").List(context.TODO(), metav1.ListOptions{}) |
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.
Pods("") this will pods from all namespaces?
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.
updated it to get pods from kube-system
a5d4c03
to
72b363a
Compare
@@ -65,6 +71,46 @@ func ResourceIBMContainerVpcWorker() *schema.Resource { | |||
Description: "Cluster name", | |||
}, | |||
|
|||
"sds": { | |||
Type: schema.TypeString, | |||
Required: true, |
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.
Its still showing required!!
Required: true, | ||
ForceNew: true, | ||
Optional: true, | ||
Description: "Name of Software Defined Storage", |
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.
Also include diff supress for this parameter.
@@ -65,6 +71,46 @@ func ResourceIBMContainerVpcWorker() *schema.Resource { | |||
Description: "Cluster name", | |||
}, | |||
|
|||
"sds": { |
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.
"sds" & "kube_config_path" parameter are dependent to each other. So update the schema with "RequiredWith" also.
72b363a
to
79e2978
Compare
secrets added secrets.baseline modified Example/Openshift-Data_Foundation Updated input.tfvars updated Dev note added docs reverted deployment fix docs updated mod and sum updated doc updated naming convention WaitFor functions added doc updated Review Comments added secrets and struct updated Further updates (#3) * Updates * file renamed * Return error validate function added review comments added comments removed optional field added for sds pods from kube-system secrets baseline updated sds schema updated schema updated
79e2978
to
b61ba2b
Compare
* ODF Worker Replace secrets added secrets.baseline modified Example/Openshift-Data_Foundation Updated input.tfvars updated Dev note added docs reverted deployment fix docs updated mod and sum updated doc updated naming convention WaitFor functions added doc updated Review Comments added secrets and struct updated Further updates (IBM-Cloud#3) * Updates * file renamed * Return error validate function added review comments added comments removed optional field added for sds pods from kube-system secrets baseline updated sds schema updated schema updated * schema updated
This allows user to easily replace worker nodes with openshift-data-foundation installed through terraform.
Community Note
Relates OR Closes #0000
Output from acceptance testing: