diff --git a/config.example/group_vars/k8s_cluster.yml b/config.example/group_vars/k8s_cluster.yml index 81b5913ab..237829576 100644 --- a/config.example/group_vars/k8s_cluster.yml +++ b/config.example/group_vars/k8s_cluster.yml @@ -46,8 +46,10 @@ dashboard_metrics_scraper_repo: "kubernetesui/metrics-scraper" # Ensure hosts file generation only runs across k8s cluster hosts_add_ansible_managed_hosts_groups: ["k8s_cluster"] -# NFS Client Provisioner +# NFS Client Provisioner # Playbook: nfs-client-provisioner.yml +# This convenience default creates a non-HA NFS export on the first control-plane +# node. For production clusters, point this at site-owned storage or disable it. k8s_nfs_client_provisioner: true k8s_deploy_nfs_server: true k8s_nfs_mkdir: true # Set to false if an export dir is already configured with proper permissions diff --git a/config.example/group_vars/netapp-trident.yml b/config.example/group_vars/netapp-trident.yml index 33b9aa9c4..d8a27ebf1 100644 --- a/config.example/group_vars/netapp-trident.yml +++ b/config.example/group_vars/netapp-trident.yml @@ -1,29 +1,36 @@ --- # vars file for netapp-trident playbook -# URL of the Trident installer package that you wish to download and use -trident_version: "22.01.0" +# Version of the Trident installer package to download when tridentctl is needed +trident_version: "26.02.1" trident_installer_url: "https://github.com/NetApp/trident/releases/download/v{{ trident_version }}/trident-installer-{{ trident_version }}.tar.gz" +# Official Trident Helm chart settings +trident_helm_repo_name: netapp-trident +trident_helm_repo_url: https://netapp.github.io/trident-helm-chart +trident_helm_release_name: trident-operator +trident_helm_chart_name: "{{ trident_helm_repo_name }}/trident-operator" +trident_helm_chart_version: "100.2602.1" + # Namespace to install Trident in trident_namespace: deepops-trident # Denotes whether or not to create new backends after deploying trident -# For more info, refer to: https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/operator-install.html#creating-a-trident-backend -create_backends: true +# For more info, refer to: https://docs.netapp.com/us-en/trident/trident-use/ontap-nas-examples.html +create_backends: false +trident_hide_backend_details: true # List of backends to create -# For more info on parameter values, refer to: https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/operations/tasks/backends/ontap.html -# Note: Parameters other than those listed below are not avaible when creating a backend via DeepOps +# For more info on parameter values, refer to: https://docs.netapp.com/us-en/trident/trident-use/ontap-nas-examples.html +# Note: Parameters other than those listed below are not available when creating a backend via DeepOps # If you wish to use other parameter values, you must create your backend manually. backends_to_create: - backendName: ontap-flexvol storageDriverName: ontap-nas # only 'ontap-nas' and 'ontap-nas-flexgroup' are supported when creating a backend via DeepOps - managementLIF: 10.61.188.40 - dataLIF: 192.168.200.41 - svm: ai221_data - username: admin - password: NetApp!23 + managementLIF: ontap-mgmt.example.com + dataLIF: ontap-nfs.example.com + svm: svm_nfs + username: vsadmin storagePrefix: trident limitAggregateUsage: "" limitVolumeSize: "" @@ -41,11 +48,10 @@ backends_to_create: tieringPolicy: none - backendName: ontap-flexgroup storageDriverName: ontap-nas-flexgroup # only 'ontap-nas' and 'ontap-nas-flexgroup' are supported when creating a backend via DeepOps - managementLIF: 10.61.188.40 - dataLIF: 192.168.200.41 - svm: ai221_data - username: admin - password: NetApp!23 + managementLIF: ontap-mgmt.example.com + dataLIF: ontap-nfs.example.com + svm: svm_nfs + username: vsadmin storagePrefix: trident limitAggregateUsage: "" limitVolumeSize: "" @@ -64,12 +70,12 @@ backends_to_create: # Add additional backends as needed # Denotes whether or not to create new StorageClasses for your NetApp storage -# For more info, refer to: https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/operator-install.html#creating-a-storage-class -create_StorageClasses: true +# For more info, refer to: https://docs.netapp.com/us-en/trident/trident-use/create-stor-class.html +create_StorageClasses: false # List of StorageClasses to create # Note: Each item in the list should be an actual K8s StorageClass definition in yaml format -# For more info on StorageClass definitions, refer to https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/concepts/objects.html#kubernetes-storageclass-objects. +# For more info on StorageClass definitions, refer to https://docs.netapp.com/us-en/trident/trident-use/create-stor-class.html storageClasses_to_create: - apiVersion: storage.k8s.io/v1 kind: StorageClass @@ -90,30 +96,30 @@ storageClasses_to_create: # Add additional StorageClasses as needed # Denotes whether or not to enable volume snapshots in your Kubernetes cluster -# For more info, refer to: https://netapp-trident.readthedocs.io/en/stable-v21.01/kubernetes/operations/tasks/volumes/snapshots.html -enable_volume_snapshots: true +# For more info, refer to: https://docs.netapp.com/us-en/trident/trident-use/vol-snapshots.html +enable_volume_snapshots: false # List of volume snapshot CRDs to create volume_snapshot_CRD_manifest_URLs: - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml # List of snapshot controller manifest URLs snapshot_controller_manifest_URLs: - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml # List of volume snapshot classes to create volume_snapshot_classes_to_create: - - apiVersion: snapshot.storage.k8s.io/v1beta1 + - apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: csi-snapclass driver: csi.trident.netapp.io deletionPolicy: Delete -# Denotes whether or not to copy tridenctl binary to localhost +# Denotes whether or not to copy tridentctl binary to localhost copy_tridentctl_to_localhost: true # Directory that tridentctl will be copied to on localhost tridentctl_copy_to_directory: ../../ # will be copied to 'deepops/' directory diff --git a/docs/deepops/proxy-k8s-cluster.md b/docs/deepops/proxy-k8s-cluster.md index 165a64e5c..4e478748f 100644 --- a/docs/deepops/proxy-k8s-cluster.md +++ b/docs/deepops/proxy-k8s-cluster.md @@ -37,4 +37,4 @@ Before executing the scripts to continue setting up and installing services you 1. Run the `scripts/deepops/proxy.sh` script to setup environment variables. Then continue running all the scripts necessary for your environment. 2. Rather than setup the variables for your current shell, you can run each script to use the proxy without impacting your current env. For example: - `. scripts/deepops/proxy.sh && scripts/k8s/deploy_rook.sh` + `. scripts/deepops/proxy.sh && DEEPOPS_ENABLE_DEPRECATED_ROOK=true scripts/k8s/deploy_rook.sh` diff --git a/docs/k8s-cluster/README.md b/docs/k8s-cluster/README.md index 3230f24a5..c9d978efc 100644 --- a/docs/k8s-cluster/README.md +++ b/docs/k8s-cluster/README.md @@ -11,7 +11,7 @@ Instructions for deploying a GPU cluster with Kubernetes - [Persistent Storage](#persistent-storage) - [NFS Client Provisioner](#nfs-client-provisioner) - [Ceph Cluster (deprecated)](#ceph-cluster-deprecated) - - [NetApp Astra Trident](#netapp-astra-trident) + - [NetApp Trident](#netapp-trident) - [Monitoring](#monitoring) - [Logging](#logging) - [Centralized syslog](#centralized-syslog) @@ -124,9 +124,9 @@ Run the following script to create an administrative user and print out the dash #### NFS Client Provisioner -The default behavior of DeepOps is to setup an NFS server on the first `kube_control_plane` node. This temporary NFS server is used by the `nfs-client-provisioner` which is installed as the default StorageClass of a standard DeepOps deployment. +The default DeepOps Kubernetes storage path is the `nfs-subdir-external-provisioner` chart, backed by an NFS export on the first `kube_control_plane` node. This is a convenience default for examples, smoke tests, and small internal clusters. It is not a highly available production storage design. -To use an existing nfs server server update the `k8s_nfs_server` and `k8s_nfs_export_path` variables in `config/group_vars/k8s-cluster.yml` and set the `k8s_deploy_nfs_server` to false in `config/group_vars/k8s-cluster.yml`. Additionally, the `k8s_nfs_mkdir` variable can be set to `false` if the export directory is already configured on the server. +To use an existing NFS server, update the `k8s_nfs_server` and `k8s_nfs_export_path` variables in `config/group_vars/k8s-cluster.yml` and set `k8s_deploy_nfs_server` to `false`. Additionally, set `k8s_nfs_mkdir` to `false` if the export directory is already configured on the server. To manually install or re-install the `nfs-client-provisioner` run: @@ -134,13 +134,16 @@ To manually install or re-install the `nfs-client-provisioner` run: ansible-playbook playbooks/k8s-cluster/nfs-client-provisioner.yml ``` -To skip this installation set `k8s_nfs_client_provisioner` to `false`. +To skip this installation, set `k8s_nfs_client_provisioner` to `false`. #### Ceph Cluster (deprecated) -For a non-nfs based alternative, deploy a Ceph cluster running on Kubernetes for services that require persistent storage (such as Kubeflow): +The Rook/Ceph helper is deprecated and community-supported. It predates the current Rook Helm chart layout and should not be used as a new production storage path without a site-owned Rook/Ceph design and validation plan. + +For legacy environments that still use this helper, deploy a Ceph cluster running on Kubernetes with: ```bash +export DEEPOPS_ENABLE_DEPRECATED_ROOK=true ./scripts/k8s/deploy_rook.sh ``` @@ -150,9 +153,9 @@ Poll the Ceph status by running (this script will return when Ceph initializatio ./scripts/k8s/deploy_rook.sh -w ``` -#### NetApp Astra Trident +#### NetApp Trident -Deploy NetApp Astra Trident for services that require persistent storage (such as Kubeflow). Note that you must have a supported NetApp storage system/instance/service in order to use Astra Trident to provision persistent storage. +The Trident role is optional and community-supported in DeepOps. Use it only when the site already has a supported NetApp storage system or service and a storage owner who can validate the backend, StorageClass, and snapshot policy against current NetApp documentation. 1. Set configuration parameters. @@ -160,7 +163,9 @@ Deploy NetApp Astra Trident for services that require persistent storage (such a vi config/group_vars/netapp-trident.yml ``` -2. Deploy Astra Trident using Ansible. + By default, the example configuration installs Trident but does not create a backend, StorageClass, or snapshot controller. Set `create_backends`, `create_StorageClasses`, or `enable_volume_snapshots` to `true` only after replacing the example backend values with site-specific storage details and auth values. + +2. Deploy Trident using Ansible. ```bash # NOTE: If SSH requires a password, add: `-k` @@ -169,7 +174,7 @@ Deploy NetApp Astra Trident for services that require persistent storage (such a ansible-playbook -l k8s_cluster playbooks/k8s-cluster/netapp-trident.yml ``` -3. Verify that Astra Trident is running. +3. Verify that Trident is running. ```bash ./tridentctl -n deepops-trident version @@ -181,11 +186,11 @@ Deploy NetApp Astra Trident for services that require persistent storage (such a +----------------+----------------+ | SERVER VERSION | CLIENT VERSION | +----------------+----------------+ - | 22.01.0 | 22.01.0 | + | 26.02.1 | 26.02.1 | +----------------+----------------+ ``` -For more information on Astra Trident, please refer to the [official documentation](https://docs.netapp.com/us-en/trident/index.html). +For more information on Trident, refer to the [official documentation](https://docs.netapp.com/us-en/trident/index.html). ### Monitoring diff --git a/docs/k8s-cluster/kubeflow.md b/docs/k8s-cluster/kubeflow.md index 59f4d6797..f5bfc1e80 100644 --- a/docs/k8s-cluster/kubeflow.md +++ b/docs/k8s-cluster/kubeflow.md @@ -29,7 +29,7 @@ As part of the Kubeflow installation, the MPI Operator will also be installed. T Deploy Kubernetes by following the [DeepOps Kubernetes Deployment Guide](README.md) -Kubeflow requires a DefaultStorageClass to be defined. By default DeepOps installs the `nfs-client-provisioner` using the [nfs-client-provisioner.yml playbook](../../playbooks/k8s-cluster/nfs-client-provisioner.yml). This playbook can re run manually. As an NFS alternative [Ceph](../../scripts/k8s/deploy_rook.sh), [Trident](../../playbooks/k8s-cluster/netapp-trident.yml) or an alternative StorageClass can be used. +Kubeflow requires a DefaultStorageClass to be defined. By default DeepOps installs the `nfs-client-provisioner` using the [nfs-client-provisioner.yml playbook](../../playbooks/k8s-cluster/nfs-client-provisioner.yml). This playbook can be rerun manually. For production or HA storage, use a site-owned StorageClass. The legacy [Ceph](../../scripts/k8s/deploy_rook.sh) helper is deprecated, and [Trident](../../playbooks/k8s-cluster/netapp-trident.yml) is optional and community-supported unless a site storage owner validates it. Deploy Kubeflow: @@ -125,6 +125,6 @@ To correct this issue: 1. Uninstall Rook/Ceph: `./scripts/k8s/deploy_rook.sh -d` 2. Uninstall Kubeflow: `./scripts/k8s/deploy_kubeflow.sh -d` -3. Re-install Rook/ceph: `./scripts/k8s/deploy_rook.sh` +3. Re-install Rook/Ceph: `DEEPOPS_ENABLE_DEPRECATED_ROOK=true ./scripts/k8s/deploy_rook.sh` 4. Poll for Ceph to initialize (wait for this script to exit): `./scripts/k8s/deploy_rook.sh -w` 5. Re-install Kubeflow: `./scripts/k8s/deploy_kubeflow.sh` diff --git a/playbooks/k8s-cluster/nfs-client-provisioner.yml b/playbooks/k8s-cluster/nfs-client-provisioner.yml index 200f27f99..d40741e58 100644 --- a/playbooks/k8s-cluster/nfs-client-provisioner.yml +++ b/playbooks/k8s-cluster/nfs-client-provisioner.yml @@ -1,14 +1,14 @@ --- # This playbook is used to setup the nfs-client-provisioner # If the cluster already has an nfs server setup run with --skip-tags="nfs_server,nfs_mkdir" -# Otherwhise an NFS server will be configured on kube_control_plane[0] -# After settting up an NFS server, nfs software is installed on all nodes -# Lastly, the nfs-client-provisioner is helm installed using the role +# Otherwise an NFS server will be configured on kube_control_plane[0] +# After setting up an NFS server, NFS software is installed on all nodes. +# Lastly, the nfs-client-provisioner chart is installed using the role. # -# The default NFS configuration of this playbook is not meant for production systems -# For production deployments please configur NFS with storage-partner guidance +# The default NFS configuration of this playbook is not meant for production systems. +# For production deployments, configure storage with storage-partner guidance. # -# Install the required NFS software on all nodes and then helm install the nfs-client +# Install the required NFS software on all nodes and then helm install the NFS client. - hosts: kube_control_plane[0] become: yes tasks: @@ -17,13 +17,17 @@ path: "{{ k8s_nfs_export_path }}" state: directory mode: "u=rwx,g=rwx,o=rwx" - when: k8s_nfs_mkdir and k8s_deploy_nfs_server + when: k8s_nfs_mkdir and k8s_deploy_nfs_server + tags: + - nfs_mkdir - name: Deploy NFS server master include_role: name: nfs vars: nfs_is_server: yes when: k8s_deploy_nfs_server + tags: + - nfs_server - hosts: "k8s_cluster" become: yes diff --git a/roles/netapp-trident/README.md b/roles/netapp-trident/README.md index 7911d097b..ad20f9b69 100644 --- a/roles/netapp-trident/README.md +++ b/roles/netapp-trident/README.md @@ -3,6 +3,8 @@ netapp-trident Ansible role that can be used to deploy NetApp Trident within a Kubernetes cluster. +This role is optional and community-supported in DeepOps. Use it only when a site storage owner can validate the NetApp backend, StorageClass, and snapshot policy against current NetApp documentation. + Requirements ------------ @@ -15,7 +17,7 @@ Requirements Role Variables -------------- -See defaults/main.yml, vars/main.yml +See defaults/main.yml and `config.example/group_vars/netapp-trident.yml`. Dependencies ------------ diff --git a/roles/netapp-trident/defaults/main.yml b/roles/netapp-trident/defaults/main.yml index 688c4d6cd..ec880b251 100644 --- a/roles/netapp-trident/defaults/main.yml +++ b/roles/netapp-trident/defaults/main.yml @@ -1,29 +1,36 @@ --- # defaults file for netapp-trident role -# URL of the Trident installer package that you wish to download and use -trident_version: "21.01.2" +# Version of the Trident installer package to download when tridentctl is needed +trident_version: "26.02.1" trident_installer_url: "https://github.com/NetApp/trident/releases/download/v{{ trident_version }}/trident-installer-{{ trident_version }}.tar.gz" +# Official Trident Helm chart settings +trident_helm_repo_name: netapp-trident +trident_helm_repo_url: https://netapp.github.io/trident-helm-chart +trident_helm_release_name: trident-operator +trident_helm_chart_name: "{{ trident_helm_repo_name }}/trident-operator" +trident_helm_chart_version: "100.2602.1" + # Namespace to install Trident in trident_namespace: trident # Denotes whether or not to create new backends after deploying trident -# For more info, refer to: https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/operator-install.html#creating-a-trident-backend +# For more info, refer to: https://docs.netapp.com/us-en/trident/trident-use/ontap-nas-examples.html create_backends: false +trident_hide_backend_details: true # List of backends to create -# For more info on parameter values, refer to: https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/operations/tasks/backends/ontap.html -# Note: Parameters other than those listed below are not avaible when creating a backend via DeepOps +# For more info on parameter values, refer to: https://docs.netapp.com/us-en/trident/trident-use/ontap-nas-examples.html +# Note: Parameters other than those listed below are not available when creating a backend via DeepOps # If you wish to use other parameter values, you must create your backend manually. backends_to_create: - backendName: ontap-flexvol storageDriverName: ontap-nas # only 'ontap-nas' and 'ontap-nas-flexgroup' are supported when creating a backend via DeepOps - managementLIF: 10.61.188.40 - dataLIF: 192.168.200.41 - svm: ai221_data - username: admin - password: NetApp!23 + managementLIF: ontap-mgmt.example.com + dataLIF: ontap-nfs.example.com + svm: svm_nfs + username: vsadmin storagePrefix: trident limitAggregateUsage: "" limitVolumeSize: "" @@ -41,11 +48,10 @@ backends_to_create: tieringPolicy: none - backendName: ontap-flexgroup storageDriverName: ontap-nas-flexgroup # only 'ontap-nas' and 'ontap-nas-flexgroup' are supported when creating a backend via DeepOps - managementLIF: 10.61.188.40 - dataLIF: 192.168.200.41 - svm: ai221_data - username: admin - password: NetApp!23 + managementLIF: ontap-mgmt.example.com + dataLIF: ontap-nfs.example.com + svm: svm_nfs + username: vsadmin storagePrefix: trident limitAggregateUsage: "" limitVolumeSize: "" @@ -64,12 +70,12 @@ backends_to_create: # Add additional backends as needed # Denotes whether or not to create new StorageClasses for your NetApp storage -# For more info, refer to: https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/operator-install.html#creating-a-storage-class +# For more info, refer to: https://docs.netapp.com/us-en/trident/trident-use/create-stor-class.html create_StorageClasses: false # List of StorageClasses to create # Note: Each item in the list should be an actual K8s StorageClass definition in yaml format -# For more info on StorageClass definitions, refer to https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/concepts/objects.html#kubernetes-storageclass-objects. +# For more info on StorageClass definitions, refer to https://docs.netapp.com/us-en/trident/trident-use/create-stor-class.html storageClasses_to_create: - apiVersion: storage.k8s.io/v1 kind: StorageClass @@ -90,30 +96,30 @@ storageClasses_to_create: # Add additional StorageClasses as needed # Denotes whether or not to enable volume snapshots in your Kubernetes cluster -# For more info, refer to: https://netapp-trident.readthedocs.io/en/stable-v21.01/kubernetes/operations/tasks/volumes/snapshots.html -enable_volume_snapshots: true +# For more info, refer to: https://docs.netapp.com/us-en/trident/trident-use/vol-snapshots.html +enable_volume_snapshots: false # List of volume snapshot CRDs to create volume_snapshot_CRD_manifest_URLs: - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml # List of snapshot controller manifest URLs snapshot_controller_manifest_URLs: - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml - - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-3.0/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml + - https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/release-8.3/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml # List of volume snapshot classes to create volume_snapshot_classes_to_create: - - apiVersion: snapshot.storage.k8s.io/v1beta1 + - apiVersion: snapshot.storage.k8s.io/v1 kind: VolumeSnapshotClass metadata: name: csi-snapclass driver: csi.trident.netapp.io deletionPolicy: Delete -# Denotes whether or not to copy tridenctl binary to localhost +# Denotes whether or not to copy tridentctl binary to localhost copy_tridentctl_to_localhost: true # Directory that tridentctl will be copied to on localhost tridentctl_copy_to_directory: ./ diff --git a/roles/netapp-trident/tasks/main.yml b/roles/netapp-trident/tasks/main.yml index 71788b7c4..d8840271f 100644 --- a/roles/netapp-trident/tasks/main.yml +++ b/roles/netapp-trident/tasks/main.yml @@ -1,32 +1,37 @@ --- # tasks file for netapp-trident role -- name: Download and extract Trident installer - unarchive: - src: '{{ trident_installer_url }}' - dest: '{{ deepops_dir }}' - remote_src: yes - -- name: Copy namespace config file to control node - template: - src: namespace.j2 - dest: '{{ deepops_dir }}/trident-installer/namespace.yaml' - mode: "0644" +- name: Add Trident Helm repo + command: '/usr/local/bin/helm repo add --force-update {{ trident_helm_repo_name }} {{ trident_helm_repo_url }}' run_once: true + changed_when: false -- name: Create Trident namespace - kube: - state: present - resource: Namespace - name: trident - filename: '{{ deepops_dir }}/trident-installer/namespace.yaml' +- name: Update Helm repos + command: /usr/local/bin/helm repo update run_once: true + changed_when: false - name: Install Trident using Helm - command: '/usr/local/bin/helm -n {{ trident_namespace }} install trident {{ deepops_dir }}/trident-installer/helm/trident-operator-{{ trident_version }}.tgz' + command: '/usr/local/bin/helm upgrade --install {{ trident_helm_release_name }} {{ trident_helm_chart_name }} --namespace {{ trident_namespace }} --create-namespace --version {{ trident_helm_chart_version }} --wait' run_once: true changed_when: false +- name: Create Trident working directory + file: + path: '{{ deepops_dir }}/trident-installer' + state: directory + mode: "0755" + when: create_backends or create_StorageClasses or enable_volume_snapshots or copy_tridentctl_to_localhost + run_once: true + +- name: Download and extract Trident installer + unarchive: + src: '{{ trident_installer_url }}' + dest: '{{ deepops_dir }}' + remote_src: yes + when: create_backends or copy_tridentctl_to_localhost + run_once: true + - name: Copy backend config file(s) to control node template: src: backend.j2 @@ -35,6 +40,7 @@ with_items: '{{ backends_to_create }}' when: create_backends run_once: true + no_log: "{{ trident_hide_backend_details | bool }}" - name: Create Trident backend(s) command: '{{ deepops_dir }}/trident-installer/tridentctl -n {{ trident_namespace }} create backend -f {{ deepops_dir }}/trident-installer/backend-{{ item.backendName }}.json' @@ -45,10 +51,11 @@ until: result.rc == 0 when: create_backends run_once: true + no_log: "{{ trident_hide_backend_details | bool }}" - name: Copy StorageClass config file(s) to control node copy: - content: '{{ item }}' + content: '{{ item | to_nice_yaml }}' dest: '{{ deepops_dir }}/trident-installer/sc-{{ item.metadata.name }}.yaml' mode: "0644" with_items: '{{ storageClasses_to_create }}' @@ -56,34 +63,29 @@ run_once: true - name: Create StorageClasses - kube: - state: present - resource: StorageClass - name: '{{ item.metadata.name }}' - filename: '{{ deepops_dir }}/trident-installer/sc-{{ item.metadata.name }}.yaml' + command: 'kubectl apply -f {{ deepops_dir }}/trident-installer/sc-{{ item.metadata.name }}.yaml' with_items: '{{ storageClasses_to_create }}' when: create_StorageClasses run_once: true + changed_when: false - name: Create volume snapshot CRDs - kube: - state: present - filename: '{{ item }}' + command: 'kubectl apply -f {{ item }}' with_items: '{{ volume_snapshot_CRD_manifest_URLs }}' when: enable_volume_snapshots run_once: true + changed_when: false - name: Create snapshot controller - kube: - state: present - filename: '{{ item }}' + command: 'kubectl apply -f {{ item }}' with_items: '{{ snapshot_controller_manifest_URLs }}' when: enable_volume_snapshots run_once: true + changed_when: false - name: Copy volume snapshot class config file(s) to control node copy: - content: '{{ item }}' + content: '{{ item | to_nice_yaml }}' dest: '{{ deepops_dir }}/trident-installer/snapclass-{{ item.metadata.name }}.yaml' mode: "0644" with_items: '{{ volume_snapshot_classes_to_create }}' @@ -91,14 +93,11 @@ run_once: true - name: Create volume snapshot classes - kube: - state: present - resource: VolumeSnapshotClass - name: '{{ item.metadata.name }}' - filename: '{{ deepops_dir }}/trident-installer/snapclass-{{ item.metadata.name }}.yaml' + command: 'kubectl apply -f {{ deepops_dir }}/trident-installer/snapclass-{{ item.metadata.name }}.yaml' with_items: '{{ volume_snapshot_classes_to_create }}' when: enable_volume_snapshots run_once: true + changed_when: false - name: Fetch tridentctl from control node fetch: diff --git a/roles/nfs-client-provisioner/defaults/main.yml b/roles/nfs-client-provisioner/defaults/main.yml index 78a467a77..16fdc6ecb 100644 --- a/roles/nfs-client-provisioner/defaults/main.yml +++ b/roles/nfs-client-provisioner/defaults/main.yml @@ -6,4 +6,4 @@ k8s_nfs_client_repo_name: "nfs-subdir-external-provisioner" k8s_nfs_client_helm_repo: "https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner" k8s_nfs_client_chart_name: "{{ k8s_nfs_client_repo_name }}/nfs-subdir-external-provisioner" k8s_nfs_client_release_name: "nfs-subdir-external-provisioner" -k8s_nfs_client_chart_version: "4.0.13" +k8s_nfs_client_chart_version: "4.0.18" diff --git a/scripts/k8s/deploy_kubeflow.sh b/scripts/k8s/deploy_kubeflow.sh index 69eea2187..16acd06bc 100755 --- a/scripts/k8s/deploy_kubeflow.sh +++ b/scripts/k8s/deploy_kubeflow.sh @@ -106,7 +106,7 @@ function install_dependencies() { if [ $? -ne 0 ] ; then echo "No storageclass found" echo "To setup the nfs-client-provisioner (preferred), run: ansible-playbook playbooks/k8s-cluster/nfs-client-provisioner.yml" - echo "To provision Ceph storage, run: ./scripts/k8s/deploy_rook.sh" + echo "The Rook/Ceph helper is deprecated; use a site-owned StorageClass or see docs/k8s-cluster/README.md before using it." exit 1 fi diff --git a/scripts/k8s/deploy_monitoring.sh b/scripts/k8s/deploy_monitoring.sh index 51bdd7569..abc67aa13 100755 --- a/scripts/k8s/deploy_monitoring.sh +++ b/scripts/k8s/deploy_monitoring.sh @@ -235,7 +235,7 @@ function install_dependencies() { # Install/initialize Helm if needed ./scripts/k8s/install_helm.sh - # StorageClasse (for volumes and MySQL DB) + # StorageClass (for volumes and MySQL DB) kubectl get storageclass 2>&1 | grep "(default)" >/dev/null 2>&1 if [ $? -ne 0 ] ; then echo "No storageclass found" @@ -247,7 +247,7 @@ function install_dependencies() { else echo "To continue without persistent storage, run '${0} -x'" echo "To setup the nfs-client-provisioner (preferred), run: ansible-playbook playbooks/k8s-cluster/nfs-client-provisioner.yml" - echo "To provision Ceph storage, run: ./scripts/k8s/deploy_rook.sh" + echo "The Rook/Ceph helper is deprecated; use a site-owned StorageClass or see docs/k8s-cluster/README.md before using it." exit 1 fi fi diff --git a/scripts/k8s/deploy_rook.sh b/scripts/k8s/deploy_rook.sh index a8fffd923..0a9ad1c6d 100755 --- a/scripts/k8s/deploy_rook.sh +++ b/scripts/k8s/deploy_rook.sh @@ -39,10 +39,12 @@ function help_me() { echo "Usage:" echo "-h This message." echo "-p Print out the connection info for Rook-Ceph." - echo "-d Delete Rook from your system (this delete any created volumes)." + echo "-d Delete Rook from your system (this deletes any created volumes)." echo "-w Poll for rook-ceph to reach a healthy and initialized state." echo "-u Create a new dashboard user (default username: 'admin' password: 'deepops', set with env variables DEEPOPS_ROOK_USER/DEEPOPS_ROOK_PASS)." echo "-x Install Rook-Ceph, but do not set it as the Default StorageClass." + echo + echo "This helper is deprecated. New installs require DEEPOPS_ENABLE_DEPRECATED_ROOK=true." } @@ -141,6 +143,12 @@ function get_opts() { function install_rook() { + if [ "${DEEPOPS_ENABLE_DEPRECATED_ROOK}" != "true" ]; then + echo "DEPRECATION NOTICE: deploy_rook.sh is deprecated and community-supported." + echo "Set DEEPOPS_ENABLE_DEPRECATED_ROOK=true only for legacy environments that still need this helper." + exit 1 + fi + # Install Helm if it is not already installed ${SCRIPT_DIR}/install_helm.sh