Commit Graph
727 Commits
Author SHA1 Message Date
Noah Watkins df20c7da17 ceph: shush device discovery log messages
fixes: #3483

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-07-31 14:34:24 -07:00
AllenZMC 4616f17a26 fix word ressource to resource
Signed-off-by: czm <zhongming.chang@daocloud.io>
2019-07-31 20:53:33 +08:00
Blaine Gardner 1b6fe840f6 Merge pull request #3460 from umangachapagain/servicemonitor-fix
fix Prometheus permissions and servicemonitor configurations
2019-07-30 11:05:12 -06:00
Blaine Gardner 9f7dbb85d8 Merge pull request #3527 from SUSE/remove-osd-copybins
ceph: osd use copy-binaries top level cmd
2019-07-30 09:41:03 -06:00
Travis Nielsen e5779f79d5 Merge pull request #3533 from ethan-daocloud/patch-1
cleanup: fix log message mis-spelled words
2019-07-29 11:14:37 -06:00
Blaine Gardner 55a726fda9 ceph: osd use copy-binaries top level cmd
Replace usage of the custom osd copybins command with the new top-level
copy-binaries command introduced with cmd-reporter.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-29 09:23:45 -06:00
Travis Nielsen d50c9ef3bf Merge pull request #3530 from renekalff/fix-k8s-ownerreferences
Ceph (and EdgeFS?) cluster is being deleted after K8S cluster restart or api/etcd issues
2019-07-26 18:33:16 -06:00
René Kalff 25780878eb Make the ownerreference name match the cluster name referenced
In order to cleanup all cluster resources in case of cluster deletion
all resources have an ownerreference to the cluster crd instance.
Because the name of the reference was incorrectly set to the name of the
namespace the cluster resources can unintentionally be deleted by the
kubernetes garbage collector after a kubernetes cluster anomaly.

Signed-off-by: René Kalff <r.kalff@intermax.nl>
2019-07-26 18:33:38 +02:00
ethan 3a6bef33df cleanup: fix log message mis-spelled words
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-07-26 16:40:48 +08:00
Umanga Chapagain d30c06860d fixes permissions and servicemonitor configurations
this adds the access for rook to create monitoring resources
across namespaces and provides servicemonitor config to
monitor the current service being created

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-26 10:53:18 +05:30
Nick McKinney d9aec6bad6 Allow control over K8s service type via CRD
Signed-off-by: Nick McKinney <nmckinney@breakpoint-labs.com>
2019-07-25 15:49:18 -04:00
Blaine Gardner 6d2ef93669 Merge pull request #3443 from SUSE/nfs-refactor
Ceph NFS: use new config
2019-07-25 09:39:50 -06:00
travisn 3142c3e5cb simplify CR status updates for ceph and edgefs
The status messages on the CRs had much duplicated code
for logging an error if the status update failed.
Now any failures around the status update are logged
consistently within the updateClusterStatus method
so there is no need to return an error and duplicate
the error handling everywhere.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-24 12:52:30 -06:00
Sébastien Han e52efdb8d4 ceph: mgr fix startup
Because the manager is running under the 'ceph' user the cephfs
subvolume plugin can not create directories anymore. It fails with a
permission denied because of the usage of the 'ceph' user, root is need
here, hence the special startup line to go over this.

Closes: https://github.com/ceph/ceph-csi/issues/486
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-24 17:47:43 +02:00
Dmitry Yusupov e454b12af3 Merge pull request #3505 from sabbot/EdgeFS-3492
Add mgr pod liveness probe
2019-07-23 12:41:26 -07:00
Anton Skriptsov 3952874ae1 Add mgr pod liveness probe
Signed-off-by: Anton Skriptsov <sabbotagge@gmail.com>
2019-07-23 11:25:19 -07:00
Alexander Trost 93716bcde8 fix usage of Infof in CephClusterController (#3502)
fix usage of Infof in CephClusterController
2019-07-23 19:22:45 +02:00
Alexander Trost 07fbea0fd9 fix usage of Infof in CephClusterController
Currently the ClusterController logs out a message like:
```
Cluster %s is not ready. Skipping orchestration.rook-ceph
```
without the "placeholders" fullfilled. This is because the code uses the
logger.Info() instead of logger.Infof() function.
This change fixes that to use Infof and therefore corrects the log
message.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-07-23 16:08:16 +02:00
Sébastien Han fdaf3bfc9c ceph: run pod with privileged
Before each pod starts, the daemon changes the ownership of
/var/log/ceph which is bindmounted on a hostPath.

On OpenShift envionments, the container must be privileged in order to
successfully change the owernship.

Closes: https://github.com/rook/rook/issues/3485
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-23 07:43:10 +02:00
Dmitry Yusupov dc85c5083c Merge pull request #3482 from dyusupov/master
make getModifiedRookImagePath be generic and use it for isgw too
2019-07-22 11:51:44 -07:00
Dmitry Yusupov a3d02fb6ea make getModifiedRookImagePath be generic and use it for isgw too
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2019-07-22 10:07:22 -07:00
Blaine Gardner 50e824ebad Ceph: Add unit tests for nfs-ganesha spec
Ganesha isn't a true "Ceph" daemon, so some of the sharable pod spec
testing functionality is teased out of the operator/ceph/test library
and a simple operator/test library is created. The ceph/test library is
updated to use the operator/test library when possible/appropriate.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Blaine Gardner e75254f412 ceph: add missing DaemonDataPathMap unit test
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Blaine Gardner aa0d3346f2 ceph nfs: refactor to use new config pattern
Refactor the Ceph NFS (Ganesha) daemon to use the new config pattern.

Use of a custom Rook binary to run NFS has been removed in favor of
instead running the required DBUS process as a sidecar. The effect here
is that the NFS Ganesha container itself may fail and restart a few
times before the DBUS sidecar is running.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-22 11:06:04 -06:00
Blaine Gardner d774fec858 Merge pull request #3470 from rohantmp/fixTopologyAware
Fix: topologyAware does not pick up failure domains.
2019-07-22 10:19:28 -06:00
Travis Nielsen e176dd1001 Merge pull request #3487 from leseb/oc-privileged
ceph: mon: init chown for openshift
2019-07-22 08:14:19 -06:00
xieyanker 7672582e0a Correct typo about skipVolumeForDirectory's code comment
Signed-off-by: xieyanker <xjsisnice@gmail.com>
2019-07-22 19:05:14 +08:00
Sébastien Han c2b85ba33c ceph: mon: init chown for openshift
OpenShift environment requires privileged containers when interacting
with the host filesystem, typically via dataDirHostPath.
The init container that changes the ownership of dataDirHostPath was
missing the privileged flag and users were getting permission denied
errors on the chown command.

Fixes: https://github.com/rook/rook/issues/3485
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-22 11:07:29 +02:00
Rohan CJ 747619180c Fix: toplogyAware does not pick up failure domains.
Properly initialize c.validStorage, and ensure that it is used
for provision config from then on.

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-07-19 18:38:16 +05:30
Sébastien Han 9120791e24 ceph: chown ceph directories
At the beginning of every container startup we now change the ownership
of every known ceph directories to ceph:ceph.

This will allow daemons to start properly as well as allowing daemon to
writes their logs on files.

This is needed because ceph daemon now run as 'ceph' instead of 'root'

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-19 11:13:42 +02:00
Sébastien Han 900abbc967 ceph: run ceph processes with the 'ceph' user
Ceph daemons will run as the 'ceph' user instead of the 'root' user.
Existing data store (osd and mon) owned by root will continue to run as
'root'.
ALl CLI calls also inherate from this and will use them when fetching a key
for instance. If we run on a version of ceph that does not know these
  flags they will simply get ignored.

Consider the following:

[leseb@tarox~/go/src/github.com/rook/rook][use-ceph-user !] kubectl get pods -n rook-ceph
NAME                                     READY     STATUS      RESTARTS   AGE
rook-ceph-mds-myfs-a-67cff7df69-fq4l5    1/1       Running     0          3m
rook-ceph-mds-myfs-b-85bd5f59f5-d8hdn    1/1       Running     0          3m
rook-ceph-mgr-a-7d88b9457b-jzln6         1/1       Running     2          4m
rook-ceph-mon-a-64bf697496-r94tc         1/1       Running     0          4m
rook-ceph-osd-0-c5fdcd74c-9kvb4          1/1       Running     0          3m
rook-ceph-osd-prepare-minikube-shz9l     0/2       Completed   0          3m
rook-ceph-rbd-mirror-a-5cbff8469-xv64c   1/1       Running     0          3m
rook-ceph-rgw-my-store-f7645b44-vlbp4    1/1       Running     0          3m

MDS daemon:
ceph         1  0.2  0.1 449508 29200 ?        Ssl  15:10   0:00 ceph-mds --fsid=bf359e2c-a1df-4a80-9137-8134b41a5459 --keyring=/etc/ceph/keyring-store/keyring --log-to-stderr=true --err-to-stderr=true --mon-cluster-log-to-stderr=true --log-stderr-prefix=debug  --mon-host=10.110.204.228:6789 --mon-initial-members=a --name=mds.myfs-a --setuser=ceph --setgroup=ceph --foreground --mds-standby-for-fscid=1 --mds-standby-replay=true

MGR daemon:
ceph         1  0.8  0.6 867176 104732 ?       Ssl  15:10   0:02 ceph-mgr --fsid=bf359e2c-a1df-4a80-9137-8134b41a5459 --keyring=/etc/ceph/keyring-store/keyring --log-to-stderr=true --err-to-stderr=true --mon-cluster-log-to-stderr=true --log-stderr-prefix=debug  --mon-host=10.110.204.228:6789 --mon-initial-members=a --name=mgr.a --setuser=ceph --setgroup=ceph --foreground

MON daemon:
ceph         1     0  0 15:10 ?        00:00:02 ceph-mon --fsid=bf359e2c-a1df-4a80-9137-8134b41a5459 --keyring=/etc/ceph/keyring-store/keyring --log-to-stderr=true --err-to-stderr=true --mon-cluster-log-to-stderr=true --log-stderr-prefix=debug  --mon-host=10.110.204.228:6789 --mon-initial-members=a --name=mon.a --setuser=ceph --setgroup=ceph --foreground --public-addr=10.110.204.228 --public-bind-addr=172.17.0.6 --setuser-match-path=/var/lib/ceph/mon/ceph-a

OSD daemon:
ceph     30985  0.9  0.5 885736 81236 ?        Ssl  15:10   0:04      |   \_ ceph-osd --foreground --id 0 --conf /var/lib/rook/osd0/rook-ceph.config --osd-data /var/lib/rook/osd0 --setuser-match-path /var/lib/rook/osd0 --setuser ceph --setgro
up ceph --keyring /var/lib/rook/osd0/keyring --cluster rook-ceph --osd-uuid 98b4527d-f7a8-44f0-ac47-f8b55ff5ee05 --osd-journal=/var/lib/rook/osd0/journal

RBD mirror daemon:
ceph         1  0.0  0.1 914500 21848 ?        Ssl  15:10   0:00 rbd-mirror --setuser ceph --setgroup ceph --foreground -n client.rbd-mirror.a --conf /etc/ceph/ceph.conf --keyring /etc/ceph/keyring

RGW daemon:
ceph         1  0.2  0.3 5179452 52244 ?       Ssl  15:11   0:01 radosgw --setuser ceph --setgroup ceph --foreground --name=client.radosgw.gateway --rgw-mime-types-file=/var/lib/rook/rgw/mime.types

Even though Ceph processes are running as Ceph, the container itself runs as root.
We haven't reached the situation where we can runAsUser != "root" and enable SecurityContext to RunAsNonRoot, but that's our ultimate goal.

Resolves: https://github.com/rook/rook/issues/2664
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-19 11:13:42 +02:00
Mateusz Gozdek f936394764 ceph: allow to set multiple tolerations for agent and discover pods
Closes #2896

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
2019-07-17 23:11:18 +02:00
Dmitry Yusupov 01ba50ea3c Merge pull request #3463 from sabbot/node-add-remove
Add/remove nodes via EdgeFS cluster' CRD
2019-07-17 14:01:03 -07:00
Travis Nielsen 41005b53a6 Merge pull request #3456 from travisn/remove-legacy-conversion
Remove legacy Ceph CRD conversion from v1beta1 to v1
2019-07-17 11:52:41 -06:00
Anton Skriptsov aea098b8b5 Add/remove nodes via EdgeFS cluster' CRD
Signed-off-by: Anton Skriptsov <sabbotagge@gmail.com>
2019-07-17 09:09:52 -07:00
Sébastien Han 50ef726ad3 Merge pull request #2901 from leseb/improve-upgrade
ceph: improve upgrade procedure
2019-07-17 11:54:22 +02:00
Sébastien Han 05d8d23f18 ceph: upgrade: pass daemonType and Name directly
We do not determine the daemon type and name by string parsing anymore
but passing that info directly in the update call, it's more reliable.
Also removing a bunch of unused functions.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:58:31 +02:00
Sébastien Han a17c47d36a ceph: upgrade: preserve operator state
This commit makes OnAdd() and OnUpdate() consistent in behavior. They
will do their best detecting if we can upgrade, continue an upgrade or
refuse to do one. It also refuses to downgrade to any version.
It also load ClusterInfo earlier in the controller so that we can
compare the spec version versus the cluster running one.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:50:42 +02:00
Alexander Trost 38c3e6f5bb Fix mgr prometheus annotations (#3453)
Fix mgr prometheus annotations
2019-07-17 00:46:21 +02:00
Sébastien Han c24ae45eca ceph: upgrade, don't check osd if aio
If we detect all OSDs are running on the same host, we don't perform any
checks for upgrade.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:41:40 +02:00
Sébastien Han 25f4f889c5 ceph: upgrade: display success when upgrade is done
If we successfully changed all the Ceph version of all the daemon we
consider the upgrade complete and successfully, thus we display a
message.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:18 +02:00
Sébastien Han 7eb7e8a192 ceph: upgrade: always retrieve cluster version
Do not consider clusterInfo Ceph version since it's the one picked by
the spec image.
The CephVersion provided here needs to be the current running version
of Ceph for when it is later passed to OkToStop and checked with
IsAtLeast. If you are upgrading from a pre 14.2.1 version to a
version 14.2.1 or newer, IsAtLeast will incorrectly return true and
then fail trying to run mon ok-to-stop on a mon pod running a pre 14.2.1 version.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:18 +02:00
Sébastien Han bd7df53b18 ceph: refuse to upgrade an un-healthy cluster
If the cluster shows a state of HEALTH_ERR, Rook will refuse to upgrade
it if the image version changed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:39:15 +02:00
Sébastien Han f317cfdd1c ceph: osd: remove leftover info logs
These were used on a previous patch as a debug, let's remove them. They
are not intended to be displayed.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:37:43 +02:00
Sébastien Han 32a9435c29 ceph: rgw: rename startDeployment()
This method does not start anything but creates the deployment. So let's
rename it to createDeployment() instead.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:37:43 +02:00
Sébastien Han ae9d33061c rgw: implement UpdateDeploymentAndWait()
rgw wasn't using UpdateDeploymentAndWait() to update its deployment
configuration. We now use it so that it's consistent with the other
daemons configuration.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:37:43 +02:00
Sébastien Han 9824bd2ff9 ceph: improve upgrade procedure
When a cluster is updated with a different image version, this triggers
a serialized restart of all the pods. Prior to this commit, no safety
check were performed and rook was hoping for the best outcome.

Now before doing restarting a daemon we check it can be restarted. Once
it's restarted we also check we can pursue with the rest of the
platform. For instance, with monitors we check that they are in quorum,
for OSD we check that PGs are clean and for MDS we make sure they are
 all active.

Fixes: https://github.com/rook/rook/issues/2889
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-17 00:37:43 +02:00
Sébastien Han 487ded50f3 Merge pull request #3355 from noahdesu/mon-sched2
ceph: schedule mons across failure domains
2019-07-16 22:47:07 +02:00
Dinar Valeev 38c4e5ed7b Mgr: fix prometheus annotations
This fixes https://github.com/rook/rook/issues/3204

Move prometheus Annoation logic before Deployment is initialized,
otherwise, podSpec is not uptodate

Signed-off-by: Dinar Valeev <k0da@opensuse.org>
2019-07-16 17:01:27 +02:00
travisn 9e073857c5 ceph: remove legacy conversion from v1beta1 to v1
In the 0.9 release rook converted the v1beta1 CRD resources
to v1 resources. This conversion code is no longer necessary
as we will be using v1 resources going forward.
The code paths will not be triggered anymore, thus
removing the dead code.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-15 16:58:37 -06:00