forked from rackerlabs/genestack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: netapp-volume-worker support (rackerlabs#527)
This creates a new Kustomize deployment for cinder with a netapp volume backend. The worker uses an existing cinder deployment managed by helm kustomizes the configuration values and produces a netapp specific volume container which has the ability to run with multiple netapp backends. To use this container the following secret must be created ``` shell kubectl --namespace openstack \ create secret generic cinder-netapp \ --type Opaque \ --from-literal=BACKENDS="netapp-backend-1,root,10.0.0.1,80,vserver1,qos-something,True,True,True,True,enabled" ``` Each backend has 11 values which correspond to the needed configuration. Multiple backends are supported using a semicolon. Signed-off-by: Kevin Carter <[email protected]>
- Loading branch information
Showing
7 changed files
with
530 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Kustomize GitHub Actions for cinder-volume-netapp | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- base-kustomize/cinder/netapp/** | ||
- .github/workflows/kustomize-cinder-volume-netapp.yaml | ||
jobs: | ||
kustomize: | ||
name: Kustomize | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Kustomize Install | ||
working-directory: /usr/local/bin/ | ||
run: | | ||
if [ ! -f /usr/local/bin/kustomize ]; then | ||
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | sudo bash | ||
fi | ||
- name: Run Kustomize Build | ||
run: | | ||
kustomize build base-kustomize/cinder/netapp/ > /tmp/rendered.yaml | ||
- name: Return Kustomize Build | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: kustomize-cinder-volume-netapp-artifact | ||
path: /tmp/rendered.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: cinder-volume-netapp-config | ||
namespace: openstack | ||
data: | ||
cinder-volume.sh: | | ||
#!/bin/bash | ||
set -ex | ||
exec cinder-volume --config-file /etc/cinder/cinder.conf \ | ||
--config-file /tmp/pod-shared/backends.conf \ | ||
--config-file /tmp/pod-shared/internal_tenant.conf \ | ||
--config-file /tmp/pod-shared/cinder-netapp.conf | ||
generate-backends.py: | | ||
#!/usr/bin/env python3 | ||
import configparser | ||
import os | ||
netapp_backends = os.environ.get('NETAPP_BACKENDS') | ||
config = configparser.ConfigParser() | ||
for backend in netapp_backends.split(';'): | ||
backend = backend.split(',') | ||
assert len(backend) == 11 | ||
config.add_section(backend[0]) | ||
config.set(backend[0], 'netapp_login', backend[1]) | ||
config.set(backend[0], 'netapp_password', backend[2]) | ||
config.set(backend[0], 'netapp_server_hostname', backend[3]) | ||
config.set(backend[0], 'netapp_server_port', backend[4]) | ||
config.set(backend[0], 'netapp_storage_family', 'ontap_cluster') | ||
config.set(backend[0], 'netapp_storage_protocol', 'iscsi') | ||
config.set(backend[0], 'netapp_transport_type', 'http') | ||
config.set(backend[0], 'netapp_vserver', backend[5]) | ||
config.set(backend[0], 'netapp:qos_policy_group', backend[6]) | ||
config.set(backend[0], 'netapp_dedup', backend[7]) | ||
config.set(backend[0], 'netapp_compression', backend[8]) | ||
config.set(backend[0], 'netapp_thick_provisioned', backend[9]) | ||
config.set(backend[0], 'netapp_lun_space_reservation', backend[10]) | ||
config.set(backend[0], 'volume_driver', 'cinder.volume.drivers.netapp.common.NetAppDriver') | ||
config.set(backend[0], 'volume_backend_name', backend[0]) | ||
print(f'Added backend {backend[0]}') | ||
with open('/tmp/pod-shared/backends.conf', 'w') as configfile: | ||
config.write(configfile) | ||
print('Generated backends.conf') | ||
config = configparser.ConfigParser() | ||
backends = ','.join([i.split(',')[0] for i in netapp_backends.split(';')]) | ||
config.set('DEFAULT', 'enabled_backends', backends) | ||
config.set('DEFAULT', 'host', 'cinder-volume-netapp-worker') | ||
with open('/tmp/pod-shared/cinder-netapp.conf', 'w') as configfile: | ||
config.write(configfile) | ||
print('Updated cinder.conf') | ||
ssh_known_hosts: | | ||
# Empty SSH host file managed by cinder-volume-netapp |
Oops, something went wrong.