Browse Source

Introduce application to deploy rook ceph, support for Helm v3

rook enable with such procedure
1, deploy system without add ceph storage backend
2, update osd info with helm override
    $ system helm-override-update rook-ceph-apps rook-ceph --values value.yaml
3, apply rook-ceph application
    $ system application-apply rook-ceph-storage

sample value.yaml to deploy provision sdb on host 'controller-0'
cluster:
  storage:
    nodes:
    - devices:
      - config:
          journalSizeMB: 1024
          storeType: bluestore
        name: sdb
      name: controller-0

Story: 2005527
Task: 39214

Depends-On: https://review.opendev.org/#/c/713084/

Change-Id: Ie8f43082a5022b4e3507f0ac8fe0a2654e2a3302
Signed-off-by: Martin, Chen <haochuan.z.chen@intel.com>
changes/92/716792/89
Martin, Chen 11 months ago
committed by Chen, Haochuan Z
parent
commit
5bbddf837a
85 changed files with 5552 additions and 0 deletions
  1. +185
    -0
      .zuul.yaml
  2. +16
    -0
      CONTRIBUTING.rst
  3. +17
    -0
      HACKING.rst
  4. +1
    -0
      centos_build_layer.cfg
  5. +1
    -0
      centos_iso_image.inc
  6. +2
    -0
      centos_pkg_dirs
  7. +3
    -0
      python-k8sapp-rook/centos/build_srpm.data
  8. +56
    -0
      python-k8sapp-rook/centos/python-k8sapp-rook.spec
  9. +35
    -0
      python-k8sapp-rook/k8sapp_rook/.gitignore
  10. +4
    -0
      python-k8sapp-rook/k8sapp_rook/.stestr.conf
  11. +202
    -0
      python-k8sapp-rook/k8sapp_rook/LICENSE
  12. +7
    -0
      python-k8sapp-rook/k8sapp_rook/README.rst
  13. +0
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/__init__.py
  14. +19
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/armada/__init__.py
  15. +36
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/armada/manifest_rook_ceph.py
  16. +0
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/common/__init__.py
  17. +11
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/common/constants.py
  18. +19
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/__init__.py
  19. +115
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/rook_ceph.py
  20. +161
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/rook_ceph_provisioner.py
  21. +65
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/rook_operator.py
  22. +0
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/tests/__init__.py
  23. +34
    -0
      python-k8sapp-rook/k8sapp_rook/k8sapp_rook/tests/test_plugins.py
  24. +240
    -0
      python-k8sapp-rook/k8sapp_rook/pylint.rc
  25. +2
    -0
      python-k8sapp-rook/k8sapp_rook/requirements.txt
  26. +46
    -0
      python-k8sapp-rook/k8sapp_rook/setup.cfg
  27. +12
    -0
      python-k8sapp-rook/k8sapp_rook/setup.py
  28. +27
    -0
      python-k8sapp-rook/k8sapp_rook/test-requirements.txt
  29. +125
    -0
      python-k8sapp-rook/k8sapp_rook/tox.ini
  30. +1
    -0
      python-k8sapp-rook/k8sapp_rook/upper-constraints.txt
  31. +1
    -0
      requirements.txt
  32. +6
    -0
      stx-rook-ceph/centos/build_srpm.data
  33. +92
    -0
      stx-rook-ceph/centos/stx-rook-ceph.spec
  34. +79
    -0
      stx-rook-ceph/files/rook-mon-exit.sh
  35. +6
    -0
      stx-rook-ceph/stx-rook-ceph/README
  36. +4
    -0
      stx-rook-ceph/stx-rook-ceph/files/metadata.yaml
  37. +43
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/Makefile
  38. +22
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/.helmignore
  39. +11
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/Chart.yaml
  40. +5
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/requirements.yaml
  41. +2
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/NOTES.txt
  42. +52
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/clusterrole.yaml
  43. +22
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/clusterrolebinding.yaml
  44. +22
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/configmap.yaml
  45. +111
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/job-ceph-mon-audit.yaml
  46. +123
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/job-stx-ceph-mgr-provision.yaml
  47. +66
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/post-install-host-provision.yaml
  48. +190
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/post-install-rook-provision.yaml
  49. +69
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/pre-delete-rook-provisioner-cleanup.yaml
  50. +25
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/role.yaml
  51. +23
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/rolebinding.yaml
  52. +17
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/serviceaccount.yaml
  53. +55
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/storageclass.yaml
  54. +85
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/values.yaml
  55. +7
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/Chart.yaml
  56. +1
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/README.md
  57. +106
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/cluster.yaml
  58. +24
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/clusterrole.yaml
  59. +22
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/clusterrolebinding.yaml
  60. +76
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/post-delete-host-cleanup.yaml
  61. +72
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/pre-delete-rook-ceph-cleanup.yaml
  62. +82
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/pre-install-duplex-preparation.yaml
  63. +25
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/role.yaml
  64. +23
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/rolebinding.yaml
  65. +17
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/serviceaccount.yaml
  66. +49
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/templates/toolbox.yaml
  67. +52
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph/values.yaml
  68. +7
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/Chart.yaml
  69. +1
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/README.md
  70. +20
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/NOTES.txt
  71. +26
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/_helpers.tpl
  72. +525
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/clusterrole.yaml
  73. +260
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/clusterrolebinding.yaml
  74. +282
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/deployment.yaml
  75. +66
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/pre-delete-ceph-cluster.yaml
  76. +80
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/psp.yaml
  77. +499
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/resources.yaml
  78. +133
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/role.yaml
  79. +121
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/rolebinding.yaml
  80. +32
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/rook-config-override.yaml
  81. +70
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/templates/serviceaccount.yaml
  82. +150
    -0
      stx-rook-ceph/stx-rook-ceph/helm-charts/rook-operator/values.yaml
  83. +99
    -0
      stx-rook-ceph/stx-rook-ceph/manifests/manifest.yaml
  84. +2
    -0
      test-requirements.txt
  85. +50
    -0
      tox.ini

+ 185
- 0
.zuul.yaml View File

@ -0,0 +1,185 @@
---
- project:
check:
jobs:
- openstack-tox-linters
- k8sapp-rook-ceph-tox-py27
- k8sapp-rook-ceph-tox-py36
- k8sapp-rook-ceph-tox-flake8
- k8sapp-rook-ceph-tox-pylint
- k8sapp-rook-ceph-tox-bandit
gate:
jobs:
- openstack-tox-linters
- k8sapp-rook-ceph-tox-py27
- k8sapp-rook-ceph-tox-py36
- k8sapp-rook-ceph-tox-flake8
- k8sapp-rook-ceph-tox-pylint
- k8sapp-rook-ceph-tox-bandit
post:
jobs:
- stx-rook-ceph-apps-upload-git-mirror
- job:
name: k8sapp-rook-ceph-tox-py27
parent: tox
description: |
Run py27 test for k8sapp_rook_ceph
nodeset: ubuntu-xenial
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-rook/*
vars:
tox_envlist: py27
tox_extra_args: -c python-k8sapp-rook/k8sapp_rook/tox.ini
- job:
name: k8sapp-rook-ceph-tox-py36
parent: tox
description: |
Run py36 test for k8sapp_rook_ceph
nodeset: ubuntu-bionic
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-rook/*
vars:
tox_envlist: py36
tox_extra_args: -c python-k8sapp-rook/k8sapp_rook/tox.ini
- job:
name: k8sapp-rook-ceph-tox-flake8
parent: tox
description: |
Run flake8 test for k8sapp_rook_ceph
files:
- python-k8sapp-rook/*
vars:
tox_envlist: flake8
tox_extra_args: -c python-k8sapp-rook/k8sapp_rook/tox.ini
- job:
name: k8sapp-rook-ceph-tox-pylint
parent: tox
description: |
Run pylint test for k8sapp_rook_ceph
required-projects:
- starlingx/config
- starlingx/fault
- starlingx/update
- starlingx/utilities
files:
- python-k8sapp-rook/*
vars:
tox_envlist: pylint
tox_extra_args: -c python-k8sapp-rook/k8sapp_rook/tox.ini
- job:
name: k8sapp-rook-ceph-tox-bandit
parent: tox
description: |
Run bandit test for k8sapp_rook_ceph
files:
- python-k8sapp-rook/*
vars:
tox_envlist: bandit
tox_extra_args: -c python-k8sapp-rook/k8sapp_rook/tox.ini
- job:
name: stx-rook-ceph-apps-upload-git-mirror
parent: upload-git-mirror
description: >
Mirrors opendev.org/starlingx/rook-ceph to
github.com/starlingx/rook-ceph
vars:
git_mirror_repository: starlingx/rook-ceph
secrets:
- name: git_mirror_credentials
secret: stx-rook-ceph-apps-github-secret
pass-to-parent: true
- secret:
name: stx-rook-ceph-apps-github-secret
data:
user: git
host: github.com
# yamllint disable-line rule:line-length
host_key: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqn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ObXftd60GOGf8+kYAyDiNv1i3q1NLzPAC9kztD/cVW+Rf99nTd6/UBogL/LD+9FI0
SYfGwREdk8fk+sakYp5UxrvScEiFXusyyyU9ArTrH5sfXcBLB3ClsV4uNsY+fmcuimTMW
Sq9AZ1DOTIkD4IrdxUZbbQGRUXckXueul9k7UZisSFk2bJnJRgYZdpgQWvFOsYGgCg7gt
9BaINkxGsXqM7mXumSOYc5lBJu9CghxjUe73Pv72N88r6uXV425r40MtqDQH2q6Dz9woW
+olEwWL4mO9dQJt9r8aUVDnrcNli4A8eR8muUSOX5kX3SaSGbUfqfeMf2J2zWtbaIUY+n
E1JZL4b1wjAwBkH7MRSIe/W7wAZiwuDmLVbnXLBd1LiCjQ8iuQHVBURD76TXqDg48LirA
7iZPgDlkzC1PfllTkkF12tZ/Jg+5mXXd2ceeumc3giQaWenmqUay8rhQaIcAUSBA023c2
5IOYGSpfWjacJYl3S70/+8htKI189Sn4MZbBYFHJ6U87jDxluihsreSM5mllbdqpp5kaG
QZduODZO9ALffN9cUTmmLHLoueRyVIXizoQY0c7XIDxEMwkMGxtNS9Bt3R2zSs=

+ 16
- 0
CONTRIBUTING.rst View File

@ -0,0 +1,16 @@
If you would like to contribute to the development of OpenStack,
you must follow the steps in this page:
https://docs.openstack.org/infra/manual/developers.html
Once those steps have been completed, changes to OpenStack
should be submitted for review via the Gerrit tool, following
the workflow documented at:
https://docs.openstack.org/infra/manual/developers.html#development-workflow
Pull requests submitted through GitHub will be ignored.
Bugs should be filed in Launchpad:
https://bugs.launchpad.net/starlingx

+ 17
- 0
HACKING.rst View File

@ -0,0 +1,17 @@
StarlingX Rook-Ceph-Armada-App Style Commandments
================================================
- Step 1: Read the OpenStack style commandments
https://docs.openstack.org/hacking/latest/
- Step 2: Read on
Rook-Ceph-Armada-App Specific Commandments
-----------------------------------------
None so far
Running tests
-------------
The approach to running tests is to simply run the command ``tox``. This will
create virtual environments, populate them with dependencies and run all of
the tests that OpenStack CI systems run.

+ 1
- 0
centos_build_layer.cfg View File

@ -0,0 +1 @@
flock

+ 1
- 0
centos_iso_image.inc View File

@ -0,0 +1 @@
stx-rook-ceph

+ 2
- 0
centos_pkg_dirs View File

@ -0,0 +1,2 @@
stx-rook-ceph
python-k8sapp-rook

+ 3
- 0
python-k8sapp-rook/centos/build_srpm.data View File

@ -0,0 +1,3 @@
SRC_DIR="k8sapp_rook"
TIS_BASE_SRCREV=10c623509a68acad945d4e0c06a86b3e8486ad5b
TIS_PATCH_VER=PKG_GITREVCOUNT

+ 56
- 0
python-k8sapp-rook/centos/python-k8sapp-rook.spec View File

@ -0,0 +1,56 @@
%global pypi_name k8sapp-rook
%global sname k8sapp_rook
Name: python-%{pypi_name}
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
Summary: StarlingX sysinv extensions: Rook Ceph K8S app
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python-pbr
BuildRequires: python2-pip
BuildRequires: python2-wheel
%description
StarlingX sysinv extensions: Rook Ceph K8S app
%prep
%setup
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
export PBR_VERSION=%{version}
%{__python2} setup.py build
%py2_build_wheel
%install
export PBR_VERSION=%{version}.%{tis_patch_ver}
export SKIP_PIP_INSTALL=1
%{__python2} setup.py install --skip-build --root %{buildroot}
mkdir -p ${RPM_BUILD_ROOT}/plugins
install -m 644 dist/*.whl ${RPM_BUILD_ROOT}/plugins/
%files
%{python2_sitelib}/%{sname}
%{python2_sitelib}/%{sname}-*.egg-info
%package wheels
Summary: %{name} wheels
%description wheels
Contains python wheels for %{name}
%files wheels
/plugins/*
%changelog
* Tue Jun 2 2020 Martin Chen <haochuan.z.chen@intel.com>
- Initial version

+ 35
- 0
python-k8sapp-rook/k8sapp_rook/.gitignore View File

@ -0,0 +1,35 @@
# Compiled files
*.py[co]
*.a
*.o
*.so
# Sphinx
_build
doc/source/api/
# Packages/installer info
*.egg
*.egg-info
dist
build
eggs
parts
var
sdist
develop-eggs
.installed.cfg
# Other
*.DS_Store
.stestr
.testrepository
.tox
.venv
.*.swp
.coverage
bandit.xml
cover
AUTHORS
ChangeLog
*.sqlite

+ 4
- 0
python-k8sapp-rook/k8sapp_rook/.stestr.conf View File

@ -0,0 +1,4 @@
[DEFAULT]
test_path=./k8sapp_rook/tests
top_dir=./k8sapp_rook
#parallel_class=True

+ 202
- 0
python-k8sapp-rook/k8sapp_rook/LICENSE View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020 Intel Corporation, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

+ 7
- 0
python-k8sapp-rook/k8sapp_rook/README.rst View File

@ -0,0 +1,7 @@
k8sapp-rook-ceph
================
This project contains StarlingX Kubernetes application specific python plugins
for the rook ceph application. These plugins are required to
integrate the application into the StarlingX application framework and to
support the various StarlingX deployments.

+ 0
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/__init__.py View File


+ 19
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/armada/__init__.py View File

@ -0,0 +1,19 @@
#
# Copyright (c) 2020 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import yaml
class quoted_str(str):
pass
# force strings to be single-quoted to avoid interpretation as numeric values
def quoted_presenter(dumper, data):
return dumper.represent_scalar(u'tag:yaml.org,2002:str', data, style="'")
yaml.add_representer(quoted_str, quoted_presenter)

+ 36
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/armada/manifest_rook_ceph.py View File

@ -0,0 +1,36 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (c) 2020 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# All Rights Reserved.
#
""" System inventory Armada manifest operator."""
from k8sapp_rook.helm.rook_ceph import RookCephHelm
from k8sapp_rook.helm.rook_ceph_provisioner import RookCephProvisionerHelm
from k8sapp_rook.helm.rook_operator import RookOperatorHelm
from sysinv.common import constants
from sysinv.helm import manifest_generic as generic
class RookCephArmadaManifestOperator(generic.GenericArmadaManifestOperator):
APP = constants.HELM_APP_ROOK_CEPH
ARMADA_MANIFEST = 'rook-ceph-manifest'
CHART_GROUP_ROOK = 'starlingx-rook-charts'
CHART_GROUPS_LUT = {
RookOperatorHelm.CHART: CHART_GROUP_ROOK,
RookCephHelm.CHART: CHART_GROUP_ROOK,
RookCephProvisionerHelm: CHART_GROUP_ROOK,
}
CHARTS_LUT = {
RookOperatorHelm.CHART: 'kube-system-rook-operator',
RookCephHelm.CHART: 'kube-system-rook-ceph',
RookCephProvisionerHelm.CHART: 'kube-system-rook-ceph-provisioner',
}

+ 0
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/common/__init__.py View File


+ 11
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/common/constants.py View File

@ -0,0 +1,11 @@
#
# Copyright (c) 2020 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# Helm: Supported charts:
# These values match the names in the chart package's Chart.yaml
HELM_CHART_ROOK_OPERATOR = 'rook-operator'
HELM_CHART_ROOK_CEPH = 'rook-ceph'
HELM_CHART_ROOK_CEPH_PROVISIONER = 'rook-ceph-provisioner'

+ 19
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/__init__.py View File

@ -0,0 +1,19 @@
#
# Copyright (c) 2020 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import yaml
class quoted_str(str):
pass
# force strings to be single-quoted to avoid interpretation as numeric values
def quoted_presenter(dumper, data):
return dumper.represent_scalar(u'tag:yaml.org,2002:str', data, style="'")
yaml.add_representer(quoted_str, quoted_presenter)

+ 115
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/rook_ceph.py View File

@ -0,0 +1,115 @@
#
# Copyright (c) 2018 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_rook.common import constants as app_constants
import socket
from sysinv.common import constants
from sysinv.common import exception
from sysinv.common import utils as cutils
from sysinv.helm import base
from sysinv.helm import common
class RookCephHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the rook-ceph chart"""
CHART = app_constants.HELM_CHART_ROOK_CEPH
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[common.HELM_NS_STORAGE_PROVISIONER]
SUPPORTED_APP_NAMESPACES = {
constants.HELM_APP_ROOK_CEPH:
base.BaseHelm.SUPPORTED_NAMESPACES + [common.HELM_NS_STORAGE_PROVISIONER],
}
def execute_manifest_updates(self, operator):
# On application load this chart is enabled. Only disable if specified
# by the user
if not self._is_enabled(operator.APP, self.CHART,
common.HELM_NS_STORAGE_PROVISIONER):
operator.chart_group_chart_delete(
operator.CHART_GROUPS_LUT[self.CHART],
operator.CHARTS_LUT[self.CHART])
def get_namespaces(self):
return self.SUPPORTED_NAMESPACES
def get_overrides(self, namespace=None):
overrides = {
common.HELM_NS_STORAGE_PROVISIONER: {
'cluster': self._get_cluster_override(),
'hook': self._get_hook_override(),
}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
else:
return overrides
def _get_cluster_override(self):
cluster = {
'mon': {
'count': self._get_mon_count(),
},
}
return cluster
def _get_mon_count(self):
# change it with deployment configs:
# AIO simplex/duplex have 1 mon, multi-node has 3 mons,
# 2 controllers + first mon (and cannot reconfig)
if cutils.is_aio_system(self.dbapi):
return 1
else:
return 3
def _get_hook_override(self):
hook = {
'cleanup': {
'mon_hosts': self._get_mon_hosts(),
},
'duplexPreparation': self._get_duplex_preparation(),
}
return hook
def _get_mon_hosts(self):
ceph_mon_label = "ceph-mon-placement=enabled"
mon_hosts = []
hosts = self.dbapi.ihost_get_list()
for h in hosts:
labels = self.dbapi.label_get_by_host(h.uuid)
for label in labels:
if (ceph_mon_label == str(label.label_key) + '=' + str(label.label_value)):
mon_hosts.append(h.hostname.encode('utf8', 'strict'))
return mon_hosts
def _get_duplex_preparation(self):
duplex = {
'enable': cutils.is_aio_duplex_system(self.dbapi)
}
if cutils.is_aio_duplex_system(self.dbapi):
hosts = self.dbapi.ihost_get_by_personality(
constants.CONTROLLER)
for host in hosts:
if host['hostname'] == socket.gethostname():
duplex.update({'activeController': host['hostname'].encode('utf8', 'strict')})
pools = self.dbapi.address_pools_get_all()
for pool in pools:
if pool.name == 'management':
duplex.update({'floatIP': pool.floating_address})
return duplex

+ 161
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/rook_ceph_provisioner.py View File

@ -0,0 +1,161 @@
#
# Copyright (c) 2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_rook.common import constants as app_constants
from kubernetes.client.rest import ApiException
from oslo_log import log as logging
from sysinv.common import constants
from sysinv.common import exception
from sysinv.common import kubernetes
from sysinv.common import utils
from sysinv.helm import base
from sysinv.helm import common
LOG = logging.getLogger(__name__)
class RookCephProvisionerHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the rook-ceph-provisioner chart"""
CHART = app_constants.HELM_CHART_ROOK_CEPH_PROVISIONER
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[common.HELM_NS_STORAGE_PROVISIONER]
SUPPORTED_APP_NAMESPACES = {
constants.HELM_APP_ROOK_CEPH:
base.BaseHelm.SUPPORTED_NAMESPACES + [common.HELM_NS_STORAGE_PROVISIONER],
}
SERVICE_NAME = app_constants.HELM_CHART_ROOK_CEPH_PROVISIONER
def execute_manifest_updates(self, operator):
# On application load this chart is enabled. Only disable if specified
# by the user
if not self._is_enabled(operator.APP, self.CHART,
common.HELM_NS_STORAGE_PROVISIONER):
operator.chart_group_chart_delete(
operator.CHART_GROUPS_LUT[self.CHART],
operator.CHARTS_LUT[self.CHART])
def get_namespaces(self):
return self.SUPPORTED_NAMESPACES
def get_overrides(self, namespace=None):
base_name = 'ceph-pool'
secret_name = base_name + '-' + constants.CEPH_POOL_KUBE_NAME
if utils.is_aio_simplex_system(self.dbapi):
replica = 1
else:
replica = 2
audit = utils.is_aio_duplex_system(self.dbapi)
overrides = {
common.HELM_NS_STORAGE_PROVISIONER: {
"global": {
"job_ceph_mon_audit": audit,
},
"provisionStorage": {
"defaultStorageClass": constants.K8S_RBD_PROV_STOR_CLASS_NAME,
"classdefaults": {
"monitors": self._get_monitors(),
"adminId": constants.K8S_RBD_PROV_USER_NAME,
"adminSecretName": constants.K8S_RBD_PROV_ADMIN_SECRET_NAME,
},
"classes": {
"name": constants.K8S_RBD_PROV_STOR_CLASS_NAME,
"pool": {
"pool_name": constants.CEPH_POOL_KUBE_NAME,
"replication": replica,
"crush_rule_name": "storage_tier_ruleset",
"chunk_size": 64,
},
"secret": {
"userId": constants.CEPH_POOL_KUBE_NAME,
"userSecretName": secret_name,
}
},
},
"host_provision": {
"controller_hosts": self._get_controller_hosts(),
},
"ceph_mon_audit_jobs": self._get_ceph_mon_audit(),
}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
else:
return overrides
def _get_rook_mon_ip(self):
try:
kube = kubernetes.KubeOperator()
mon_ip_name = 'rook-ceph-mon-endpoints'
configmap = kube.kube_read_config_map(mon_ip_name,
common.HELM_NS_STORAGE_PROVISIONER)
if configmap is not None:
data = configmap.data['data']
LOG.info('rook configmap data is %s' % data)
mons = data.split(',')
lists = []
for mon in mons:
mon = mon.split('=')
lists.append(mon[1])
ip_str = ','.join(lists)
LOG.info('rook mon ip is %s' % ip_str)
return ip_str
except Exception as e:
LOG.error("Kubernetes exception in rook mon ip: %s" % e)
raise
return ''
def _is_rook_ceph(self):
try:
# check function getLabels in rook/pkg/operator/ceph/cluster/mon/spec.go
# rook will assign label "mon_cluster=kube-system" to monitor pods
label = "mon_cluster=" + common.HELM_NS_STORAGE_PROVISIONER
kube = kubernetes.KubeOperator()
pods = kube.kube_get_pods_by_selector(common.HELM_NS_STORAGE_PROVISIONER, label, "")
if len(pods) > 0:
return True
except ApiException as ae:
LOG.error("get monitor pod exception: %s" % ae)
except exception.SysinvException as se:
LOG.error("get sysinv exception: %s" % se)
return False
def _get_monitors(self):
if self._is_rook_ceph():
return self._get_rook_mon_ip()
else:
return ''
def _get_controller_hosts(self):
controller_hosts = []
hosts = self.dbapi.ihost_get_by_personality(constants.CONTROLLER)
for h in hosts:
controller_hosts.append(h.hostname.encode('utf8', 'strict'))
return controller_hosts
def _get_ceph_mon_audit(self):
audit = {}
if utils.is_aio_duplex_system(self.dbapi):
pools = self.dbapi.address_pools_get_all()
for pool in pools:
if pool.name == 'management':
audit.update({'floatIP': pool.floating_address})
return audit

+ 65
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/helm/rook_operator.py View File

@ -0,0 +1,65 @@
#
# Copyright (c) 2021 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
from k8sapp_rook.common import constants as app_constants
from sysinv.common import constants
from sysinv.common import exception
from sysinv.helm import base
from sysinv.helm import common
class RookOperatorHelm(base.BaseHelm):
"""Class to encapsulate helm operations for the rook-operator chart"""
CHART = app_constants.HELM_CHART_ROOK_OPERATOR
SUPPORTED_NAMESPACES = base.BaseHelm.SUPPORTED_NAMESPACES + \
[common.HELM_NS_STORAGE_PROVISIONER]
SUPPORTED_APP_NAMESPACES = {
constants.HELM_APP_ROOK_CEPH:
base.BaseHelm.SUPPORTED_NAMESPACES + [common.HELM_NS_STORAGE_PROVISIONER],
}
def execute_manifest_updates(self, operator):
# On application load this chart is enabled. Only disable if specified
# by the user
if not self._is_enabled(operator.APP, self.CHART,
common.HELM_NS_STORAGE_PROVISIONER):
operator.chart_group_chart_delete(
operator.CHART_GROUPS_LUT[self.CHART],
operator.CHARTS_LUT[self.CHART])
def get_namespaces(self):
return self.SUPPORTED_NAMESPACES
def get_overrides(self, namespace=None):
secrets = [{"name": "default-registry-key"}]
overrides = {
common.HELM_NS_STORAGE_PROVISIONER: {
'operator': self._get_operator_override(),
'imagePullSecrets': secrets,
}
}
if namespace in self.SUPPORTED_NAMESPACES:
return overrides[namespace]
elif namespace:
raise exception.InvalidHelmNamespace(chart=self.CHART,
namespace=namespace)
else:
return overrides
def _get_operator_override(self):
operator = {
'csi': {
'enableRbdDriver': True
},
'enableFlexDriver': False,
'logLevel': 'DEBUG',
}
return operator

+ 0
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/tests/__init__.py View File


+ 34
- 0
python-k8sapp-rook/k8sapp_rook/k8sapp_rook/tests/test_plugins.py View File

@ -0,0 +1,34 @@
#
# SPDX-License-Identifier: Apache-2.0
#
from sysinv.common import constants
from sysinv.tests.db import base as dbbase
from sysinv.tests.helm.test_helm import HelmOperatorTestSuiteMixin
class K8SAppRookAppMixin(object):
app_name = constants.HELM_APP_ROOK_CEPH
path_name = app_name + '.tgz'
def setUp(self):
super(K8SAppRookAppMixin, self).setUp()
# Test Configuration:
# - Controller
# - IPv6
class K8SAppRookControllerTestCase(K8SAppRookAppMixin,
dbbase.BaseIPv6Mixin,
HelmOperatorTestSuiteMixin,
dbbase.ControllerHostTestCase):
pass
# Test Configuration:
# - AIO
# - IPv4
class K8SAppRookAIOTestCase(K8SAppRookAppMixin,
HelmOperatorTestSuiteMixin,
dbbase.AIOSimplexHostTestCase):
pass

+ 240
- 0
python-k8sapp-rook/k8sapp_rook/pylint.rc View File

@ -0,0 +1,240 @@
[MASTER]
# Specify a configuration file.
rcfile=pylint.rc
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Add files or directories to the blacklist. Should be base names, not paths.
ignore=tests
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
# Use multiple processes to speed up Pylint.
jobs=4
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=lxml.etree,greenlet
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once).
# See "Messages Control" section of
# https://pylint.readthedocs.io/en/latest/user_guide
# We are disabling (C)onvention
# We are disabling (R)efactor
# We are selectively disabling (W)arning
# We are not disabling (F)atal, (E)rror
disable=C, R
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html
output-format=text
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=80
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually 4 spaces or "\t" (1 tab).
indent-string=' '
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis
ignored-modules=distutils,eventlet.green.subprocess,six,six.moves
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
# pylint is confused by sqlalchemy Table, as well as sqlalchemy Enum types
# ie: (unprovisioned, identity)
# LookupDict in requests library confuses pylint
ignored-classes=SQLObject, optparse.Values, thread._local, _thread._local,
Table, unprovisioned, identity, LookupDict
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
[BASIC]
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match functions or classes name which do
# not require a docstring
no-docstring-rgx=__.*__
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branchs=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception

+ 2
- 0
python-k8sapp-rook/k8sapp_rook/requirements.txt View File

@ -0,0 +1,2 @@
pbr>=0.5
PyYAML>=3.10

+ 46
- 0
python-k8sapp-rook/k8sapp_rook/setup.cfg View File

@ -0,0 +1,46 @@
[metadata]
name = k8sapp-rook
summary = StarlingX sysinv extensions for rook-ceph-apps
long_description = file: README.rst
long_description_content_type = text/x-rst
license = Apache 2.0
author = StarlingX
author-email = starlingx-discuss@lists.starlingx.io
home-page = https://www.starlingx.io/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
[files]
packages =
k8sapp_rook
[global]
setup-hooks =
pbr.hooks.setup_hook
[entry_points]
systemconfig.helm_applications =
rook-ceph-apps = systemconfig.helm_plugins.rook_ceph_apps
systemconfig.helm_plugins.rook_ceph_apps =
001_rook-operator = k8sapp_rook.helm.rook_operator:RookOperatorHelm
002_rook-ceph = k8sapp_rook.helm.rook_ceph:RookCephHelm
003_rook-ceph-provisioner = k8sapp_rook.helm.rook_ceph_provisioner:RookCephProvisionerHelm
systemconfig.armada.manifest_ops =
rook-ceph-apps = k8sapp_rook.armada.manifest_rook_ceph:RookCephArmadaManifestOperator
[wheel]
universal = 1

+ 12
- 0
python-k8sapp-rook/k8sapp_rook/setup.py View File

@ -0,0 +1,12 @@
#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
import setuptools
setuptools.setup(
setup_requires=['pbr>=2.0.0'],
pbr=True)

+ 27
- 0
python-k8sapp-rook/k8sapp_rook/test-requirements.txt View File

@ -0,0 +1,27 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=1.1.0,<=2.0.0 # Apache-2.0
bandit;python_version>="3.0"
coverage>=3.6
fixtures>=3.0.0 # Apache-2.0/BSD
mock>=2.0.0 # BSD
passlib>=1.7.0
psycopg2-binary
python-barbicanclient
python-subunit>=0.0.18
requests-mock>=0.6.0 # Apache-2.0
sphinx
oslosphinx
oslotest>=3.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testrepository>=0.0.18
testtools!=1.2.0,>=0.9.36
isort<5;python_version>="3.0"
pylint<2.1.0;python_version<"3.0" # GPLv2
pylint<2.4.0;python_version>="3.0" # GPLv2
pytest
pyudev
migrate
python-ldap>=3.1.0
markupsafe

+ 125
- 0
python-k8sapp-rook/k8sapp_rook/tox.ini View File

@ -0,0 +1,125 @@
[tox]
envlist = flake8,py27,py36,pylint,bandit
minversion = 1.6
# skipsdist = True
#,pip-missing-reqs
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_k8srooktox
stxdir = {toxinidir}/../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
# usedevelop = True
# enabling usedevelop results in py27 develop-inst:
# Exception: Versioning for this project requires either an sdist tarball,
# or access to an upstream git repository.
# Note. site-packages is true and rpm-python must be yum installed on your dev machine.
sitepackages = True
# tox is silly... these need to be separated by a newline....
whitelist_externals = bash
find
install_command = pip install \
-v -v -v \
-c{toxinidir}/upper-constraints.txt \
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
{opts} {packages}
# Note the hash seed is set to 0 until can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
PYTHONDONTWRITEBYTECODE=1
OS_TEST_PATH=./k8sapp_rook/tests
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
SYSINV_TEST_ENV=True
TOX_WORK_DIR={toxworkdir}
PYLINTHOME={toxworkdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]stxdir}/config/sysinv/sysinv/sysinv
-e{[tox]stxdir}/config/tsconfig/tsconfig
-e{[tox]stxdir}/fault/fm-api
-e{[tox]stxdir}/fault/python-fmclient/fmclient
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
-e{[tox]stxdir}/update/cgcs-patch/cgcs-patch
commands =
find . -type f -name "*.pyc" -delete
[flake8]
exclude = build,dist,tools,.eggs
max-line-length=120
[testenv:flake8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands =
flake8 {posargs} .
[testenv:py27]
basepython = python2.7
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py36]
basepython = python3.6
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:pep8]
# testenv:flake8 clone
basepython = {[testenv:flake8]basepython}
deps = {[testenv:flake8]deps}
commands = {[testenv:flake8]commands}
[testenv:venv]
commands = {posargs}
[bandit]
exclude = tests
[testenv:bandit]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = bandit --ini tox.ini -n 5 -r k8sapp_rook
[testenv:pylint]
basepython = python2.7
sitepackages = False
deps = {[testenv]deps}
commands =
pylint {posargs} k8sapp_rook --rcfile=./pylint.rc
[testenv:cover]
basepython = python2.7
deps = {[testenv]deps}
setenv = {[testenv]setenv}
PYTHON=coverage run --parallel-mode
commands =
{[testenv]commands}
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:pip-missing-reqs]
# do not install test-requirements as that will pollute the virtualenv for
# determining missing packages
# this also means that pip-missing-reqs must be installed separately, outside
# of the requirements.txt files
deps = pip_missing_reqs
-rrequirements.txt
commands=pip-missing-reqs -d --ignore-file=/k8sapp_rook/tests k8sapp_rook

+ 1
- 0
python-k8sapp-rook/k8sapp_rook/upper-constraints.txt View File

@ -0,0 +1 @@
# Override upstream constraints based on StarlingX load

+ 1
- 0
requirements.txt View File

@ -0,0 +1 @@
# Nothing

+ 6
- 0
stx-rook-ceph/centos/build_srpm.data View File

@ -0,0 +1,6 @@
SRC_DIR="stx-rook-ceph"
COPY_LIST="files/*"
EXCLUDE_LIST_FROM_TAR=".stestr"
TIS_PATCH_VER=PKG_GITREVCOUNT

+ 92
- 0
stx-rook-ceph/centos/stx-rook-ceph.spec View File

@ -0,0 +1,92 @@
# Application tunables (maps to metadata)
%global app_name rook-ceph-apps
%global helm_repo stx-platform
# Install location
%global app_folder /usr/local/share/applications/helm
# Build variables
%global helm_folder /usr/lib/helm
#%global toolkit_version 0.1.0
%global rook_version 1.2.7
Summary: StarlingX K8S application: Rook Ceph
Name: stx-rook-ceph
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: Intel
URL: unknown
Source0: %{name}-%{version}.tar.gz
Source1: rook-mon-exit.sh
BuildArch: noarch
BuildRequires: helm
BuildRequires: openstack-helm-infra
BuildRequires: chartmuseum
BuildRequires: python-k8sapp-rook
BuildRequires: python-k8sapp-rook-wheels
%description
The StarlingX K8S application for Rook Ceph
%prep
%setup
%build
# Host a server for the charts
chartmuseum --debug --port=8879 --context-path='/charts' --storage="local" --storage-local-rootdir="./helm-charts" &
sleep 2
helm repo add local http://localhost:8879/charts
# Make the charts. These produce a tgz file
cd helm-charts
make rook-operator
make rook-ceph
make rook-ceph-provisioner
cd -
# Terminate helm server (the last backgrounded task)
kill %1
# Create a chart tarball compliant with sysinv kube-app.py
%define app_staging %{_builddir}/staging
%define app_tarball %{app_name}-%{version}-%{tis_patch_ver}.tgz
# Setup staging
mkdir -p %{app_staging}
cp files/metadata.yaml %{app_staging}
cp manifests/manifest.yaml %{app_staging}
mkdir -p %{app_staging}/charts
cp helm-charts/*.tgz %{app_staging}/charts
cd %{app_staging}
# Populate metadata
sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml
sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml
sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
# Copy the plugins: installed in the buildroot
mkdir -p %{app_staging}/plugins
cp /plugins/*.whl %{app_staging}/plugins
# package it up
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ .
# Cleanup staging
rm -fr %{app_staging}
%install
install -d -m 755 %{buildroot}/%{app_folder}
install -d -m 755 %{buildroot}%{_initrddir}
install -p -D -m 755 %{_builddir}/%{app_tarball} %{buildroot}/%{app_folder}
install -m 750 %{SOURCE1} %{buildroot}%{_initrddir}/rook-mon-exit
%files
%defattr(-,root,root,-)
%{app_folder}/*
%{_initrddir}/rook-mon-exit

+ 79
- 0
stx-rook-ceph/files/rook-mon-exit.sh View File

@ -0,0 +1,79 @@
#!/bin/bash
#
# Copyright (c) 2020 Intel Corporation, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
RETVAL=0
################################################################################
# Start Action
################################################################################
function start {
return
}
################################################################################
# Stop Action
################################################################################
function stop {
pgrep ceph-mon
if [ x"$?" = x"0" ]; then
kubectl --kubeconfig=/etc/kubernetes/admin.conf delete \
deployments.apps -n kube-system rook-ceph-mon-a
kubectl --kubeconfig=/etc/kubernetes/admin.conf delete po \
-n kube-system --selector="app=rook-ceph-mon,mon=a"
fi
pgrep ceph-osd
if [ x"$?" = x"0" ]; then
kubectl --kubeconfig=/etc/kubernetes/admin.conf delete \
deployments.apps -n kube-system \
--selector="app=rook-ceph-osd,failure-domain=$(hostname)"
kubectl --kubeconfig=/etc/kubernetes/admin.conf delete po \
--selector="app=rook-ceph-osd,failure-domain=$(hostname)" \
-n kube-system
fi
}
################################################################################
# Status Action
################################################################################
function status {
pgrep sysinv-api
RETVAL=$?
return
}
################################################################################
# Main Entry
################################################################################
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "usage: $0 { start | stop | status | restart }"
exit 1
;;
esac
exit $RETVAL

+ 6
- 0
stx-rook-ceph/stx-rook-ceph/README View File

@ -0,0 +1,6 @@
This directory contains all StarlingX charts that need to be built to support
platform integration immediately after installation. Some charts are common
across applications. These common charts reside in the
stx-config/kubernetes/helm-charts directory. To include these in this
application update the build_srpm.data file and use the COPY_LIST_TO_TAR
mechanism to populate these commom charts.

+ 4
- 0
stx-rook-ceph/stx-rook-ceph/files/metadata.yaml View File

@ -0,0 +1,4 @@
app_name: @APP_NAME@
app_version: @APP_VERSION@
helm_repo: @HELM_REPO@
helm_toolkit_required: false

+ 43
- 0
stx-rook-ceph/stx-rook-ceph/helm-charts/Makefile View File

@ -0,0 +1,43 @@
#
# Copyright 2017 The Openstack-Helm Authors.
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# It's necessary to set this because some environments don't link sh -> bash.
SHELL := /bin/bash
TASK := build
EXCLUDES := helm-toolkit doc tests tools logs tmp
CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.)))
.PHONY: $(EXCLUDES) $(CHARTS)
all: $(CHARTS)
$(CHARTS):
@if [ -d $@ ]; then \
echo; \
echo "===== Processing [$@] chart ====="; \
make $(TASK)-$@; \
fi
init-%:
if [ -f $*/Makefile ]; then make -C $*; fi
if [ -f $*/requirements.yaml ]; then helm dep up $*; fi
lint-%: init-%
if [ -d $* ]; then helm lint $*; fi
build-%: lint-%
if [ -d $* ]; then helm package $*; fi
clean:
@echo "Clean all build artifacts"
rm -f */templates/_partials.tpl */templates/_globals.tpl
rm -f *tgz */charts/*tgz */requirements.lock
rm -rf */charts */tmpcharts
%:
@:

+ 22
- 0
stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/.helmignore View File

@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

+ 11
- 0
stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/Chart.yaml View File

@ -0,0 +1,11 @@
#
# Copyright (c) 2018 Wind River Systems, Inc.
# Copyright (c) 2020 Intel, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: rook-ceph-provisioner
version: 0.1.0

+ 5
- 0
stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/requirements.yaml View File

@ -0,0 +1,5 @@
dependencies:
# - name: rook-ceph
#repository: http://localhost:8879
#version: 0.1.0
#alias: rook-operator

+ 2
- 0
stx-rook-ceph/stx-rook-ceph/helm-charts/rook-ceph-provisioner/templates/NOTES.txt View File

@ -0,0 +1,2 @@
The rook-ceph-provisioner has been installed.