-
Notifications
You must be signed in to change notification settings - Fork 7
Adding odf module and example #3
base: main
Are you sure you want to change the base?
Conversation
…aned up the code and updated metadata.yaml
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.
check comments
|
||
After the service shows as active in the IBM Cloud resource view, verify the deployment: | ||
|
||
ibmcloud oc cluster addon ls -c <cluster_name> |
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 oc
from here as its not needed in ibmcloud
command
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.
We need oc to run the addon enable command in our shell script
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.
@kosilva93 This command can be converted to ibmcloud ks cluster addon ls -c <cluster_name>
. You need to add to the README that the ibmcloud container-service/kubernetes-service
plugin is required. This can be added with the command ibmcloud plugin install kubernetes-service
.
@@ -7,23 +7,23 @@ variable "install_storage" { | |||
description = "If set to false does not install storage and attach the volumes to the worker nodes. Enabled by default" | |||
} | |||
|
|||
variable unique_id { | |||
variable "unique_id" { |
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.
Do this file need to be removed as its for portworx?
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.
This one is correct as it is in the examples/portworx/variables.tf file. It should be removed from the examples/odf/variables.tf file
@@ -11,7 +11,7 @@ owner: "ibmtfprovider" | |||
published_at: "2021-12-02T10:34:28.911362Z" | |||
registry: "https://registry.terraform.io/modules/terraform-ibm-modules/cluster-storage/ibm/latest" | |||
alias: "portworx" | |||
tags: ["portworx","storage","cluster","cluster-storage"] | |||
tags: ["portworx","storage","cluster","cluster-storage","odf"] |
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.
portworx needs to removed here?
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 portworx
and odf
are combined in the same module directory, shouldn't they be combined in the same metadata.yaml
file?
is_nullable: false | ||
is_force_new: false | ||
is_provision_controller: false | ||
is_count_controller: false | ||
outputs: | ||
- name: "portworx_is_ready" |
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.
portworx needs to removed here?
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.
Portworx and odf are combined in this same directory.
examples/odf/README.md
Outdated
Create the file `test.auto.tfvars` with the following input variables, these values are fake examples: | ||
|
||
```hcl | ||
enable = 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.
@kosilva93 These options are not accurate. Need to update
examples/odf/main.tf
Outdated
|
||
module "odf" { | ||
source = "./../.." | ||
// TODO: With Terraform 0.13 replace the parameter 'enable' or the conditional expression using 'with_iaf' with 'count' |
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 this comment
description = "The cluster where we are going to enable ODF" | ||
} | ||
|
||
variable "region" { |
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.
This variable description needs to be updated to say
"The region of the cluster ODF will be installed on: us-south, us-east, eu-gb, eu-de, jp-tok, au-syd, etc."
examples/odf/README.md
Outdated
|
||
## 4. Cleanup | ||
|
||
WIP |
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.
add Running terraform destroy
will disable the ODF extension.
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.
done
new push made for review |
@@ -0,0 +1,74 @@ | |||
# Test ODF Terraform Module | |||
|
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.
ODF examples directory should have following files
- Versions.tf
- output.tf
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.
@kosilva93 output.tf still missing from examples/odf
description = "If set to true installs ODF on the given cluster" | ||
} | ||
|
||
variable "ibmcloud_api_key" { |
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.
Where are we passing/using this variable ?
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.
The scripts/install_odf.sh
requires it to run some ibmcloud
cli commands.
description = "Name of the namespace" | ||
type = string | ||
default = "kube-system" | ||
} | ||
|
||
variable pwx_plan { |
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.
Please don't make any changes to files not related to ODF. Revert back the changes.
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.
The only changes were to wrap the variable names with "". I think the vscode .tf extension probably did this as it is best practice
scripts/install_odf.sh
Outdated
|
||
|
||
# Retrieve the openshift cluster version | ||
ROKS_VERSION=`oc get clusterversion -o jsonpath='{.items[].status.history[].version}{"\n"}'` |
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.
Use kubectl
instead of oc
. We can not require a user to download the oc
command since they might not have an OpenShift account to download it from.
scripts/install_odf.sh
Outdated
|
||
if [ $ROKS_VERSION_COMP -ge 470 ]; then | ||
echo "Supported version"; | ||
ibmcloud oc cluster addon enable openshift-data-foundation -c ${CLUSTER} --version ${ROKS_VERSION} \ |
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.
I think this can be changed to ibmcloud ks cluster addon enable openshift-data-foundation
scripts/uninstall_odf.sh
Outdated
ibmcloud login -apikey ${IC_API_KEY} | ||
ibmcloud ks cluster config -c ${CLUSTER} --admin | ||
|
||
ibmcloud oc cluster addon disable openshift-data-foundation -c ${CLUSTER} -f |
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.
change to ibmcloud ks cluster addon...
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.
@kosilva93 these things still need to be fixed:
-
examples/odf
directory should have anoutput.tf
file that basically passes thru theodf_is_ready
variable. -
Fix
kube_config_path
variable inexamples/odf/variables.tf
andvariables.tf
to be:
variable "kube_config_path" {
description = "Directory to store the kubeconfig file. If running on Schematics, use `/tmp/.schematics/.kube/config`"
type = string
default = "./.kube/config"
}
-
Why is the
unique_id
Portworx variable needed inexamples/odf/variables.tf
andexamples/odf/main.tf
? ODF shouldn't really need to know about this. If you remove it fromvariables.tf
andmain.tf
it shouldn't create an error since theodf.tf
file doesn't require it as input. -
Fix description of region in examples/odf/variables.tf to:
The region of the cluster ODF will be installed on: us-south, us-east, eu-gb, eu-de, jp-tok, au-syd, etc.
- There are still a couple of uses of
oc
in thescripts/install_odf.sh
file. Replace withkubectl
No description provided.