Skip to content
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

feat(storage_profile): add support for CSI arguments #282

Merged
merged 2 commits into from
Dec 26, 2022
Merged

feat(storage_profile): add support for CSI arguments #282

merged 2 commits into from
Dec 26, 2022

Conversation

aescrob
Copy link
Contributor

@aescrob aescrob commented Dec 13, 2022

Describe your changes

Since settings are supported by terraform-azurerm-provider from v3.35.0 on, allowing to disable CSI driver one by one.

Issue number

#000

Checklist before requesting a review

  • The pr title can be used to describe what this pr did in CHANGELOG.md file
  • I have executed pre-commit on my machine
  • I have passed pr-check on my machine

Thanks for your cooperation!

Copy link
Member

@lonegunmanb lonegunmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aescrob for opening this pr! We have a CI pipeline in this repo, would you please follow the instruction in the readme, run pre-commit job on you machine and try again? Thanks.

variables.tf Outdated
@@ -237,7 +237,7 @@ variable "load_balancer_profile_managed_outbound_ip_count" {

variable "load_balancer_profile_managed_outbound_ipv6_count" {
type = number
description = "(Optional) The desired number of IPv6 outbound IPs created and managed by Azure for the cluster load balancer. Must be in the range of `1` to `100` (inclusive). The default value is `0` for single-stack and `1` for dual-stack. Note: managed_outbound_ipv6_count requires dual-stack networking. To enable dual-stack networking the Preview Feature Microsoft.ContainerService/AKS-EnableDualStack needs to be enabled and the Resource Provider re-registered, see the documentation for more information. https://learn.microsoft.com/en-us/azure/aks/configure-kubenet-dual-stack?tabs=azure-cli%2Ckubectl#register-the-aks-enabledualstack-preview-feature"
description = "(Optional) The desired number of IPv6 outbound IPs created and managed by Azure for the cluster load balancer. Must be in the range of `1` to `100` (inclusive). The default value is `0` for single-stack and `1` for dual-stack. Note: managed_outbound_ipv6_count requires dual-stack networking. To enable dual-stack networking the Preview Feature Microsoft.ContainerService/AKS-EnableDualStack needs to be enabled and the Resource Provider re-registered, see the documentation for more information. https://learn.microsoft.com/en-us/azure/aks/configure-kubenet-dual-stack?tabs=azure-cli%!C(MISSING)kubectl#register-the-aks-enabledualstack-preview-feature"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we've got a typo in this description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

main.tf Outdated
@@ -219,6 +219,13 @@ resource "azurerm_kubernetes_cluster" "main" {
client_secret = var.client_secret
}
}
storage_profile {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make this block a dynamic block and add a new toggle variable so we can turn it on and off like we've done for aci_connector_linux?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

variables.tf Outdated
variable "storage_profile_blob_driver_enabled" {
type = bool
description = "(Optional) Is the Blob CSI driver enabled? Defaults to false"
default = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the schema, the default should be false.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

variables.tf Outdated
variable "storage_profile_disk_driver_enabled" {
type = bool
description = "(Optional) Is the Disk CSI driver enabled? Defaults to true"
default = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the schema, the default should be true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

variables.tf Outdated
variable "storage_profile_disk_driver_version" {
type = string
description = "(Optional) Disk CSI Driver version to be used. Possible values are v1 and v2. Defaults to v1."
default = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the schema, the default should be "v1".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

variables.tf Outdated
variable "storage_profile_file_driver_enabled" {
type = bool
description = "(Optional) Is the File CSI driver enabled? Defaults to true"
default = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the schema, the default should be true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

variables.tf Outdated
variable "storage_profile_snapshot_controller_enabled" {
type = bool
description = "(Optional) Is the Snapshot Controller enabled? Defaults to true"
default = null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the schema, the default should be true.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@aescrob aescrob requested a review from lonegunmanb December 14, 2022 10:50
Copy link
Member

@lonegunmanb lonegunmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apology for another change request @aescrob, I wasn't able to figure them out at the first review.

Since we use terraform-docs to generate document from variable and output descriptions, would you please help us by back-quoting values inside the description? Thanks!

And one more thing, our pipeline was broken because of Checkov has added some new policies, so please wait until #281 was merged then rebase to the latest master branch, thanks for your understanding and cooperation!

variables.tf Outdated
@@ -530,6 +530,42 @@ variable "sku_tier" {
default = "Free"
}

variable "storage_profile_blob_driver_enabled" {
type = bool
description = "(Optional) Is the Blob CSI driver enabled? Defaults to false"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you please back quote the value inside these descriptions since we'll generate terraform document from them? Thanks!

description = "(Optional) Is the Blob CSI driver enabled? Defaults to `false`"

variables.tf Outdated

variable "storage_profile_disk_driver_enabled" {
type = bool
description = "(Optional) Is the Disk CSI driver enabled? Defaults to true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description = "(Optional) Is the Disk CSI driver enabled? Defaults to `true`"

variables.tf Outdated

variable "storage_profile_disk_driver_version" {
type = string
description = "(Optional) Disk CSI Driver version to be used. Possible values are v1 and v2. Defaults to v1."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description = "(Optional) Disk CSI Driver version to be used. Possible values are v1 and v2. Defaults to v1."

variables.tf Outdated

variable "storage_profile_file_driver_enabled" {
type = bool
description = "(Optional) Is the File CSI driver enabled? Defaults to true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description = "(Optional) Is the File CSI driver enabled? Defaults to `true`"

variables.tf Outdated

variable "storage_profile_snapshot_controller_enabled" {
type = bool
description = "(Optional) Is the Snapshot Controller enabled? Defaults to true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description = "(Optional) Is the Snapshot Controller enabled? Defaults to `true`"

variable "storage_profile_enabled" {
description = "Enable storage profile"
type = bool
default = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add nullable = false here?

@lonegunmanb
Copy link
Member

lonegunmanb commented Dec 15, 2022

Hi @aescrob, since the master branch now should have been fixed, would you please rebase to the latest master branch and try again? Thanks.

@aescrob
Copy link
Contributor Author

aescrob commented Dec 15, 2022

@aescrob please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.

Contributor License Agreement

@microsoft-github-policy-service agree [company="swisspost"]

@aescrob
Copy link
Contributor Author

aescrob commented Dec 15, 2022

@aescrob please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.

Contributor License Agreement

@microsoft-github-policy-service agree company="swisspost"

@aescrob aescrob requested a review from lonegunmanb December 15, 2022 07:49
@aescrob aescrob temporarily deployed to acctests December 15, 2022 12:46 — with GitHub Actions Inactive
Copy link
Member

@lonegunmanb lonegunmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @aescrob, this pr has passed the e2e test and almost LGTM, only one extra commit with declaring var.storage_profile_enabled's nullable = false would make this pr been merged, thanks for your understanding.

@lonegunmanb
Copy link
Member

Hello @aescrob, I'm sorry we've met an issue on our pipeline so we have to upgrade the Github action yaml files in this repo, would you please merge your branch with the latest master branch so we can run the e2e test? Apology for the inconvenience, we're still refactoring the pipeline.

@aescrob
Copy link
Contributor Author

aescrob commented Dec 23, 2022

Oh...i am so sad to not made it into v6.3.0.
Anyway, thank you @lonegunmanb for your feedbacks

@lonegunmanb
Copy link
Member

Oh...i am so sad to not made it into v6.3.0. Anyway, thank you @lonegunmanb for your feedbacks

No worries @aescrob , I'll release a new version for you once this pr has been merged.

@aescrob aescrob temporarily deployed to acctests December 25, 2022 12:26 — with GitHub Actions Inactive
Copy link
Member

@lonegunmanb lonegunmanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aescrob, LGTM! 🚀

@lonegunmanb lonegunmanb merged commit 16aac71 into Azure:master Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants