Commit Graph
2182 Commits
Author SHA1 Message Date
Travis Nielsen d7a83107b6 ceph: mon failover should scale down failed mon first
When a mon is failed over, the new mon is started before the old mon
is removed from quorum and purged from the cluster. If the mon has
anti-affinity, in small clusters or specific toplogies where sufficient
nodes are not available, the new mon may be prevented from starting simply
because the dead mon pod still exists. To ensure a clean failover, the
dead mon pod must first be stopped before the new mon is started.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-11 10:30:28 -06:00
Sébastien Han d91f55e8ed Merge pull request #5580 from silverhandy/master
ceph: add support for wal device for OSD on PVC
2020-08-11 13:57:56 +02:00
Sébastien Han f66473a8f8 ceph: fix healtcheck for external cluster
For external cluster, it is not an issue to have a mon count set to 0
since Rook is not deploying/managing the monitors.

Signed-off-by: Sébastien Han <seb@redhat.com>
2020-08-10 11:46:35 +02:00
Chen, Tingjie 0e87348093 ceph: add support for wal device for OSD on PVC
Based on the feature of metadata PVC for OSD: #4818, add the wal device.

For this, you need to create a new volumeClaimTemplates, its name must be "wal", if "wal" is
set, "metadata" device will refers specially for block.db device, and "wal" refers for block.wal
device in BlueStore.

A template will look like this:

```
volumeClaimTemplates:
- metadata:
    name: data
  spec:
    resources:
      requests:
        storage: 10Gi
    # IMPORTANT: Change the storage class depending on your environment (e.g. local-storage, gp2)
    storageClassName: gp2
    volumeMode: Block
    accessModes:
      - ReadWriteOnce
- metadata:
    name: metadata
  spec:
    resources:
      requests:
        storage: 6Gi
    # IMPORTANT: Change the storage class depending on your environment (e.g. local-storage, io1)
    storageClassName: io1
    volumeMode: Block
    accessModes:
      - ReadWriteOnce
- metadata:
    name: wal
  spec:
    resources:
      requests:
        storage: 6Gi
    # IMPORTANT: Change the storage class depending on your environment (e.g. local-storage, io1)
    storageClassName: io1
    volumeMode: Block
    accessModes:
      - ReadWriteOnce
```

We now map block, block.db and block.wal directly inside the container instead of
running ceph-volume activate.

Signed-off-by: Chen, Tingjie <tingjie.chen@intel.com>
2020-08-10 08:48:20 +08:00
Sébastien Han 2dcc6ee392 Merge pull request #5864 from rohan47/whereabouts_fix
ceph: fix networkAttachmentConfig to be compatible with whereabouts cni
2020-08-06 15:11:16 +02:00
Sébastien Han f9ae232bc8 Merge pull request #5984 from Madhu-1/fix-nil-pointer
ceph: add check for nil object status
2020-08-06 14:23:24 +02:00
Sébastien Han f936ad3cbf Merge pull request #5680 from umangachapagain/rbd-pool-stats
Add spec to enable/disable RBD pool stats collection
2020-08-06 10:53:49 +02:00
Sébastien Han f91616f1e6 Merge pull request #5982 from Madhu-1/remove-csi-1.13
ceph: remove csi support for kubernetes 1.13
2020-08-06 09:53:49 +02:00
Madhu Rajanna 99cd310cd2 ceph: add check for nil object status
in couple of unit testing the tests are
panicing with nil pointer exception,This
commit adds a check for status pointer before
operating on it.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-06 12:19:49 +05:30
Umanga Chapagain edcb80b237 ceph: unit test cases for enableRBDStats
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-08-06 12:07:21 +05:30
Umanga Chapagain 83d7cdb85c ceph: configure mgr to enable collection of RBD stats
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-08-06 12:07:21 +05:30
Umanga Chapagain 7563077308 ceph: add enableRBDStats spec to CephBlockPool
Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2020-08-06 12:07:21 +05:30
Travis Nielsen a3bf935957 ceph: update the cluster status with a clean object
The cluster CR status needs to be updated with the latest object
instead of a cached copy or else it could fail if there is some
other update. Using the Rook clientset ensures it is the latest
instead of using the cached controller runtime object.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-05 15:55:01 -06:00
Travis Nielsen 15fae3c4cd ceph: during upgrade service selector cannot be changed
The service selector labels cannot be updated during the upgrade or else the
mon commands will not respond until the mon deployment is also updated.
Since there is a mon command to check for the ceph versions before the
deployment is updated, the operator would remain stuck during the upgrade.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2020-08-05 11:32:42 -06:00
Madhu Rajanna 1989e0d8c5 ceph: remove csi support for kubernetes 1.13
as the kubernetes 1.13 is EOL and there is no major
functionalities available in 1.13 (resize,snapshot,clone
metrics etc) we are removing the support for kubernetes
for the same.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2020-08-05 21:19:59 +05:30
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