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

Offer support for enabling NFS protocol for azure storage #884

Merged
merged 5 commits into from
Dec 9, 2021

Conversation

GeorgianaElena
Copy link
Member

No description provided.

Copy link
Member

@sgibson91 sgibson91 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you for pulling this together so quickly!

@yuvipanda
Copy link
Member

To use this, you've to enable the hub to use NFS as well - with config like

. Need to turn AzureFile mounting off here:

@GeorgianaElena
Copy link
Member Author

@yuvipanda, is it ok if we go with basehub template defaults?
i.e., AzureFile disabled and nfs with this config:

nfs:
enabled: true
shareCreator:
enabled: true
tolerations: []
pv:
mountOptions:
- soft
- noatime
- vers=4.2
serverIP: nfs-server-01
# MUST HAVE TRAILING SLASH
baseShareName: /export/home-01/homes/

Thank you!!

@yuvipanda
Copy link
Member

@GeorgianaElena you'll need to specify the URL still, otherwise the base setup might be ok.

@GeorgianaElena
Copy link
Member Author

@yuvipanda, I think I'm a bit confused and would really appreciate some guidance.

  1. "the URL" means serverIP, right? But how do I know the address of the nfs server if there isn't any right now?
  2. what happens with the home-azurefile volume when I deploy these changes? Do I need to manually clean it up?

@yuvipanda
Copy link
Member

@GeorgianaElena ah, so I think you've to terraform apply to get the server IP, and then add that into the config. Given there are no users on this, I think you should just apply it - the config looks ok to me.

For (2), helm should clean that up.

@GeorgianaElena
Copy link
Member Author

Perfect! Thanks a lot @yuvipanda!

@sgibson91
Copy link
Member

@GeorgianaElena GeorgianaElena changed the title Try nfs uoft Offer support for enabling NFS protocol for azure storage Dec 9, 2021
@sgibson91 sgibson91 self-requested a review December 9, 2021 12:01
@GeorgianaElena
Copy link
Member Author

Terraform plan output:


Acquiring state lock. This may take a few moments...
var.tenant_id
  Tenant ID inside which our subscription is housed
  
  `az account show -s SUBSCRIPTION_ID -o table` will show the ID of the tenant
  after you have logged in with `az login`.

  Enter a value: 78aac226-2f03-4b4d-9037-b46d56c55210

azurerm_resource_group.jupyterhub: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster]
azurerm_virtual_network.jupyterhub: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Network/virtualNetworks/k8s-network]
azurerm_container_registry.container_registry: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.ContainerRegistry/registries/2i2cutorontohubregistry]
azurerm_storage_account.homes: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Storage/storageAccounts/2i2cutorontohubstorage]
azurerm_subnet.node_subnet: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Network/virtualNetworks/k8s-network/subnets/k8s-nodes-subnet]
azurerm_kubernetes_cluster.jupyterhub: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourcegroups/2i2c-utoronto-cluster/providers/Microsoft.ContainerService/managedClusters/hub-cluster]
azurerm_kubernetes_cluster_node_pool.user_pool["default"]: Refreshing state... [id=/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourcegroups/2i2c-utoronto-cluster/providers/Microsoft.ContainerService/managedClusters/hub-cluster/agentPools/nbdefault]
kubernetes_namespace.homes: Refreshing state... [id=azure-file]
kubernetes_secret.homes: Refreshing state... [id=azure-file/access-credentials]
azurerm_storage_share.homes: Refreshing state... [id=https://2i2cutorontohubstorage.file.core.windows.net/homes]

Note: Objects have changed outside of Terraform

Terraform detected the following changes made outside of Terraform since the last "terraform apply":

  # azurerm_subnet.node_subnet has been changed
  ~ resource "azurerm_subnet" "node_subnet" {
        id                                             = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Network/virtualNetworks/k8s-network/subnets/k8s-nodes-subnet"
        name                                           = "k8s-nodes-subnet"
      + service_endpoint_policy_ids                    = []
      + service_endpoints                              = []
        # (6 unchanged attributes hidden)
    }
  # azurerm_resource_group.jupyterhub has been changed
  ~ resource "azurerm_resource_group" "jupyterhub" {
        id       = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster"
        name     = "2i2c-utoronto-cluster"
      + tags     = {}
        # (1 unchanged attribute hidden)
    }
  # azurerm_kubernetes_cluster_node_pool.user_pool["default"] has been changed
  ~ resource "azurerm_kubernetes_cluster_node_pool" "user_pool" {
      + availability_zones     = []
        id                     = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourcegroups/2i2c-utoronto-cluster/providers/Microsoft.ContainerService/managedClusters/hub-cluster/agentPools/nbdefault"
        name                   = "nbdefault"
      + tags                   = {}
        # (23 unchanged attributes hidden)
    }
  # azurerm_container_registry.container_registry has been changed
  ~ resource "azurerm_container_registry" "container_registry" {
        id                            = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.ContainerRegistry/registries/2i2cutorontohubregistry"
        name                          = "2i2cutorontohubregistry"
      + tags                          = {}
        # (19 unchanged attributes hidden)
    }
  # azurerm_virtual_network.jupyterhub has been changed
  ~ resource "azurerm_virtual_network" "jupyterhub" {
        id                      = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Network/virtualNetworks/k8s-network"
        name                    = "k8s-network"
      ~ subnet                  = [
          + {
              + address_prefix = "10.1.0.0/16"
              + id             = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Network/virtualNetworks/k8s-network/subnets/k8s-nodes-subnet"
              + name           = "k8s-nodes-subnet"
              + security_group = ""
            },
        ]
      + tags                    = {}
        # (7 unchanged attributes hidden)
    }
  # azurerm_storage_account.homes has been changed
  ~ resource "azurerm_storage_account" "homes" {
        id                             = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourceGroups/2i2c-utoronto-cluster/providers/Microsoft.Storage/storageAccounts/2i2cutorontohubstorage"
        name                           = "2i2cutorontohubstorage"
      + tags                           = {}
        # (32 unchanged attributes hidden)




        # (4 unchanged blocks hidden)
    }
  # kubernetes_namespace.homes has been changed
  ~ resource "kubernetes_namespace" "homes" {
        id = "azure-file"

      ~ metadata {
          + annotations      = {}
          + labels           = {}
            name             = "azure-file"
            # (3 unchanged attributes hidden)
        }
    }
  # kubernetes_secret.homes has been changed
  ~ resource "kubernetes_secret" "homes" {
        id        = "azure-file/access-credentials"
        # (3 unchanged attributes hidden)

      ~ metadata {
          + annotations      = {}
          + labels           = {}
            name             = "access-credentials"
            # (4 unchanged attributes hidden)
        }
    }
  # azurerm_kubernetes_cluster.jupyterhub has been changed
  ~ resource "azurerm_kubernetes_cluster" "jupyterhub" {
      + api_server_authorized_ip_ranges     = []
        id                                  = "/subscriptions/ead3521a-d994-4a44-a68d-b16e35642d5b/resourcegroups/2i2c-utoronto-cluster/providers/Microsoft.ContainerService/managedClusters/hub-cluster"
        name                                = "hub-cluster"
      + tags                                = {}
        # (16 unchanged attributes hidden)



      ~ default_node_pool {
          + availability_zones           = []
            name                         = "core"
          + node_taints                  = []
          + tags                         = {}
            # (19 unchanged attributes hidden)
        }





        # (7 unchanged blocks hidden)
    }

Unless you have made equivalent changes to your configuration, or ignored the relevant attributes using ignore_changes, the following plan may include actions to undo
or respond to these changes.

──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Changes to Outputs:
  + service_principal_config = (sensitive value)

You can apply this plan to save these new output values to the Terraform state, without changing any real infrastructure.

Copy link
Member

@sgibson91 sgibson91 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you bearing with me in Slack! 🌺 Feel free to run tf apply and then merge this

@GeorgianaElena
Copy link
Member Author

Applied 🚀

Thanks for bearing with me too 💖

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.

3 participants