Commit Graph
2167 Commits
Author SHA1 Message Date
rohan47 f5bbc8c5c5 ceph: fix networkAttachmentConfig to be compatible with whereabouts cni
In the whereabouts config, the network range is determined by range
option unlike other cni plugins that use Subnet option.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2020-08-05 21:17:13 +05:30
Sébastien Han 7d7523a8a2 ceph: fix unit test mock
Mock the user creation otherwise the health check fails and panics.

Closes: https://github.com/rook/rook/issues/5976
Signed-off-by: Sébastien Han <seb@redhat.com>
2020-08-05 16:09:24 +02:00
Sébastien Han 89b3225441 ceph: add encryption support for osd pvc
We can now encrypted OSD device that were provisioned via a storage
class using the PV interface.
The encryption works at the storageClassDeviceSets level, which means we
can have encrypted and non-encrypted sets.
Using the new key `encrypted` we can turn it on.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-08-05 10:06:11 +02:00
Sébastien Han af1e8c320a ceph: do not log an error if no clusters
If the list of cluster is empty there is no need to report an error in
the logs.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-08-05 10:05:51 +02:00
Sébastien Han ec8e749ef5 Merge pull request #5581 from cybozu-go/ceph-support-crypt-type-device-in-osd-on-pvc
ceph: support crypt type device in OSD on PVC
2020-08-05 09:42:30 +02:00
Travis Nielsen 06c21954e1 ceph: labels are immutable for match selectors
The labels cannot be updated on a deployment match selector.
In v1.4 a new label was added for ceph_daemon_type that is intended
to be on the pod labels, but cannot be applied to the match selectors.
Therefore, we suppress any new labels that are added to the daemons.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-04 16:47:00 -06:00
Madhu Rajanna 943f402216 ceph: create csidriver if kube version is >1.14
create csidriver object  if the kubernetes version
is greater than 1.14 modified the check to allow
Csidriver object creation if kubernetes major version
is greater than 1.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-04 20:46:28 +05:30
Travis Nielsen 34f7b2e4b7 Merge pull request #5950 from Madhu-1/cleanup
ceph: cleanup csi package
2020-08-03 16:16:44 -06:00
Satoru Takeuchi 88f4b9c148 ceph: support crypt type device in OSD on PVC
Ceph supported encrypted OSD in the following two ways.

- Encrypt OSD by Ceph itself
- Encrypt OSD by user

However, Rook supports only the first way. Let's support this way too.

With supporting this way, Rook can use variety of encryption methods.
For example, TPM can be used to manage encrypt key. In fact, I use TPM
as follows.

https://github.com/cybozu-go/sabakan/blob/57ff3ab560acb99d23aa8901c1018bf865f9ff4d/docs/disk_encryption.md#disk-encryption

Signed-off-by: UMEZAWA Takeshi <takeshi-umezawa@cybozu.co.jp>
Signed-off-by: morimoto-cybozu <kenji_morimoto@cybozu.co.jp>
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2020-08-03 21:17:06 +00:00
Madhu Rajanna dfce2b67d5 ceph: compare with major and minor kubernetes version
instead of skipping the checks based on the kubernetes
major version we need to check both major and minor
version of it.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 22:56:25 +05:30
Madhu Rajanna 4595f42bf5 ceph: remove unused file from csi
removed unused file from the csi folder

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 22:06:26 +05:30
Madhu Rajanna 29312743e1 ceph: remove unused variable
remove unused variable in spec.go

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 22:06:26 +05:30
Madhu Rajanna bf77614b66 ceph: log kubernetes version in spec
logging kubernetes version helps for
debugging the issue related to version miss
match.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 22:06:22 +05:30
Madhu Rajanna bb5bc927e0 ceph: correct the kubernetes version comparision
fixed the kubernetes version comparsion to
deploy provisioner as the statefulset.

if the kubernetes Major version is less than
1 or major  is 1 and minor is less than 14
deploy provisioner as statefulset

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 19:08:47 +05:30
Madhu Rajanna 1a5e9cb5dd ceph: rename resizer image variable
renamed resizer image variable as per
other variable names.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 19:07:45 +05:30
Madhu Rajanna 58b4c2d74d ceph: re-arrange import order in spec.go
re-arrange import order as per standard
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-03 19:04:46 +05:30
Jiffin Tony Thottan ec5f13318c ceph: enable/disable dashboard for rgw
Provide permission for dashboard to collect the object store metrics.

Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2020-08-03 10:26:54 +05:30
Jiffin Tony Thottan 73b8a598d2 ceph: add support to create system user for createuser api
Currently this is no way to create user with system permission in objectstore.
Add support for the same

Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
2020-08-03 10:24:42 +05:30
Jiffin Tony Thottan ab607075da ceph: handles an user creation error if the store is missing
Currently if object store is missing user creation fails without throwing
any error. Here the access and secret key values will be checked post the
creation command

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-08-03 10:24:34 +05:30
Blaine Gardner cb6881e401 Merge pull request #5909 from SUSE/ceph-add-daemon-type-label
ceph: add ceph_daemon_type label to Ceph daemon pods
2020-07-31 09:40:48 -06:00
Jiffin Tony Thottan 091679cbeb ceph: use deleteOBCResourceLogError instead of deleteOBCResource
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-31 15:41:35 +05:30
Jiffin Tony Thottan 59f1e8364e ceph: fix up deleteOBCResourceLogError
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-31 15:41:31 +05:30
Travis Nielsen e0ea87a353 Merge pull request #5674 from thotz/quotaobc
ceph: adding support for quota in object bucket claims
2020-07-30 22:51:58 -06:00
Blaine Gardner dcf8ae2526 ceph: rename pod labels function for more clarity
Rename PodLabels function to CephDaemonAppLabels for more clarity about
what the function's purpose is.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-30 11:16:30 -06:00
Blaine Gardner 6ceaef8610 ceph: add new "ceph_daemon_type" label to nfs pods
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-30 11:16:29 -06:00
Blaine Gardner 62cbaaec02 ceph: add new "ceph_daemon_type" label to osd pods
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-30 11:16:26 -06:00
Blaine Gardner 9b6114c192 ceph: add 'ceph_daemon_type' label to pod labels
This can help users identify the daemon type similarly to how
'ceph_daemon_id' helps identify the daemon ID. This also makes it so
scripts users create don't have to parse "app=rook-ceph-<daemonType>"
into "<daemonType>" if they desire that bit of info.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2020-07-30 11:16:22 -06:00
subhamkrai c938849cf8 ceph: closing file which are open for writing
using defer for closing file which are open
for writing is not safe. so closing file again
following  below steps:
1. open files
2. defer file.close()
3. write
4.file.close()

these will make sure files are closed.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-30 22:37:56 +05:30
subhamkrai 0279025e9e ceph: handling all the gosec errors
a few of the gosec errors were left. so
this commit will resolve all the errors.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-30 08:19:55 +05:30
Travis Nielsen 998b3f29ea ceph: reduce the file permissions to fix gosec errors
File permissions need to be reduced to the minimum to avoid config
files from being accessed. While a connection to the pod would be
required to access the files, min privileges are set just as
another layer of security. This fixes gosec error G306.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-28 15:46:24 -06:00
Nizamudeen 041618dacb ceph: change the file and directory permissions to most narrow possible
This commit fixes where there are areas in which files and directories are
written and created with statically defined permissions. Many of these
permissions are rather open, potentially allowing other system tenants to
view and interact with their contents, which may be sensitive.

Fixed G303: Poor file permissions used for directory by using the most narrow permission

Resoves: https://github.com/rook/rook/issues/4580

Signed-off-by: Nizamudeen <nia@redhat.com>
2020-07-28 15:46:12 -06:00
subhamkrai de8e93274d ceph: handling gosec errors code g104
this commit handles all the gosec g104
(i.e Audit errors not checked) error.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-28 23:52:23 +05:30
Travis Nielsen 704e80d1b5 Merge pull request #5912 from rohantmp/rohantmp-patch-1
Core: Add comment warning to keep k8sutil hashing consistent for name…
2020-07-28 10:41:47 -06:00
Travis Nielsen 1ee29b9c63 Merge pull request #5895 from subhamkrai/nosec-error
ceph: suppress gosec errors for g204,g304,g101
2020-07-28 08:25:58 -06:00
Travis Nielsen 9e6429b4c8 Merge pull request #5893 from subhamkrai/gosec-error-G601
ceph: handling gosec error code g601
2020-07-28 08:25:00 -06:00
Travis Nielsen f6b7aac3b6 Merge pull request #5908 from leseb/split-osd-files
ceph: split osd code in files
2020-07-28 07:37:46 -06:00
Rohan Joseph 82b062f91d core: add comment warning to keep k8sutil hashing consistent
The name generation utils need to provide consistent outputs across
versions so that names generated based on values are consistent and
older generated keys are not lost.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2020-07-28 12:51:54 +05:30
Jiffin Tony Thottan f4240cb31d ceph: add quota support for obc
Closes: #5274
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 12:00:11 +05:30
Jiffin Tony Thottan 96a53389b1 ceph: adding new quota apis
Adding new apis such as EnableUserQuota() for enabling quota,
SetQuotaUserObjectMax() and SetQuotaUserMaxSize() for setting user specific quotas
for objects and size respectively. Please note the size is quota is determined in GBs.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 12:00:04 +05:30
Jiffin Tony Thottan 5a6cafcdfc ceph: add missing explaination for apis in user.go
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 11:59:57 +05:30
Jiffin Tony Thottan cf61966205 ceph: remove rgwerrno from setuserquota
Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
2020-07-28 11:59:51 +05:30
subhamkrai 465a0f0aec ceph: handling gosec error code g601
this commit handles all the gosec g601
error code (i.e Implicit memory aliasing
of items from a range statement).

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-28 11:34:49 +05:30
subhamkrai bcd7faed4e ceph: suppress gosec errors for g204, g304, g101
this commit suppress the gosec errors for

g204: Audit use of command execution.
g304: File path provided as taint input.
g101: Look for hard coded credentials.

Signed-off-by: subhamkrai <subhamkumarrai03@gmail.com>
2020-07-28 11:10:48 +05:30
Sébastien Han 71dff530d3 ceph: split osd code in files
Makes the code more readable and decoupled into files.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-07-27 23:21:14 +02:00
Travis Nielsen 22ba4591f3 Merge pull request #5888 from Madhu-1/csi-v3.0.0
ceph: update ceph-csi to v3.0.0 release
2020-07-27 14:05:29 -06:00
Sébastien Han cc9c9814d2 Merge pull request #5892 from travisn/gosec-errors
Suppress gosec errors for closing files
2020-07-27 15:04:07 +02:00
Madhu Rajanna cc3b4e6906 ceph: remove check for kubernetes version
as we are going to deploy snapshotter by
default we are going to remove the kubernetes
version check.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-27 13:45:56 +05:30
Madhu Rajanna 026c5ac28a ceph: update version check for v3.0.0 release
added v3.0.0 as supported release of cephcsi.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-07-27 13:30:44 +05:30
Travis Nielsen cf53467380 core: suppress gosec errors for closing files
To ensure a file handle is closed, we defer the close command
so it is guaranteed to run when the method returns. The closing
of the file handle is not going to fail in our usage since we aren't
using the SetDeadline on the files that would cancel a request
and return an error.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-24 12:31:13 -06:00
Travis Nielsen 6f3582b651 ci: update codegen for recent changes
make codegen hadn't been run for some recent changes,
now the generated code is in sync.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-07-24 12:21:51 -06:00