Commit Graph
3904 Commits
Author SHA1 Message Date
Blaine Gardner f4e2be50a6 ceph spec: add ceph-version label to controllers
Add a 'ceph-version' label to application controllers in the same manner
as the prior 'rook-version' label to help with upgrades.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-18 15:09:33 -06:00
Travis Nielsen 9f126e3902 Merge pull request #3009 from SUSE/mon-remove-legacy-replicaset-deletion
ceph mon: remove code to delete legacy replicasets
2019-04-18 10:35:23 -06:00
travisn bc87b440fb update to the k8s 1.14 client libraries
Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-18 07:51:41 -06:00
travisn 91e9a5cd04 reference K8s1.13 and client-go 1.10 and the external provisioner for flex
Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-18 07:51:41 -06:00
Blaine Gardner cdf398557e ceph mon: remove code to delete legacy replicasets
This code path is no longer necessary, and removing it allows removing
the `replicasets` RBAC permission for the operator.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-17 15:03:33 -06:00
Travis Nielsen b7a564e929 Merge pull request #2986 from rohantmp/mainMon
Ceph: Set noout on cluster when storage nodes are in maintenance
2019-04-17 09:56:50 -06:00
Travis Nielsen 6996571b5c Merge pull request #3005 from leseb/osd-mem-tune
ceph: osd, do not auto tune osd-memory-target
2019-04-17 09:56:03 -06:00
Rohan CJ 894f4bffbd - Set noout on cluster when storage nodes are in maintenance (unschedulable)
- Add noout functions to osd client
- export the functions DiscoverStorageNodes,GetAllStorageNodes
  from pkg/operator/ceph/cluster/osd
- Update PendingReleaseNotes.md

Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-04-17 19:31:55 +05:30
Alexander Trost ea03048ef1 Merge pull request #2831 from galexrt/feature_2308
crds: Set annotations pods, deployments and so on
2019-04-17 10:27:14 +02:00
Travis Nielsen 1562fdd7d9 Merge pull request #2946 from noahdesu/hotpluggin
ceph udev monitor / hotpluggin
2019-04-16 21:31:54 -06:00
Travis Nielsen 0c13084746 Merge pull request #2991 from SUSE/mds-fix-upgrade
ceph mds: update keyring before deployment update
2019-04-16 16:59:24 -06:00
Sébastien Han f0b0f340f8 ceph: osd, do not auto tune osd-memory-target
As per https://github.com/ceph/ceph/pull/26856 Ceph tunes the value of
osd-memory-target when running the OSD process so there is no need to
enforce it.

We also set a safety factor to that value which has been calculated by
the Ceph eng/perf team. Without this factor, the OSD will get OOM killed
since it is consuming memory for other purposes too.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-17 00:14:04 +02:00
Travis Nielsen 3869f4062d Merge pull request #2893 from noahdesu/ceph-lvs-speed
ceph/osd: mount /run/udev for lvs speedup
2019-04-16 15:41:50 -06:00
Alexander Trost 0c6eb7aa3d crds: Set annotations pods, deployments and so on
Allow the user to set annotations in the CRDs of the following operators which will then be set on
the resulting Pods (Deployments, StatefulSets and so on).
Operators:
* Cassandra
* Ceph
* CockroachDB
* EdgeFS
* Minio
* NFS

The Annotations related structures have been added to the
rook.io/v1alpha2 pkg.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-04-16 20:47:05 +02:00
Noah Watkins 0b0f38c0f5 ceph: run orch on device disocvery configmap update
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-16 11:28:41 -07:00
Noah Watkins c25e262c75 ceph/osd: mount /run/udev for lvs speedup
When Ceph OSD spins up using ceph-volume, `ceph-volume lvm activate
--no-systemd --bluestore...` runs `lvs` which can cause significant
delays when /run/udev is not mounted from the host.

Before:

[root@rook-ceph-osd-0-858f49b5-md4t9 /]# time lvs
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  WARNING: Device /dev/sda not initialized in udev database even after waiting 10000000 microseconds.
...
  LV                                            VG                                        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  osd-data-729c1fb6-440f-434c-be49-f199fa59f1c0 ceph-3bf7823b-6db3-42b6-bf8f-c36301e85238 -wi-ao---- <10.00g

real    1m30.545s

After:

[root@rook-ceph-osd-0-d8c4698b8-5vqnk /]# time lvs
  WARNING: Failed to connect to lvmetad. Falling back to device scanning.
  LV                                            VG                                        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  osd-data-6c7249cc-cbd1-4f3b-9027-03725886bb30 ceph-9808319f-8567-4930-803a-41f70e537c1f -wi-ao---- <10.00g

real    0m0.043s

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-16 11:09:13 -07:00
Noah Watkins 48e86d6bf7 ceph: skip orch on non-ready clusters
the k8s Node add/update events can fire before a cluster is fully
configured, which may leave some state undefined. skip orchestration
when the cluster is in this state.

fixes: #3001

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-16 10:39:55 -07:00
Blaine Gardner 966aef8681 ceph mds: update keyring before deployment update
Because the deployment update-and-wait function waits for the deployment
to be ready, and that cannot happen due to the keyring not
having been updated yet. The keyring has its
owner set to the deployment so that no special keyring handling must
be done, but it must be created after the deployment UID is known.
Change the order of operations so that the existing deployment's UID can
be retrieved if it exists and the keyring created/updated before the
update-and-wait function is called.

This order-of-operations issue currently only applies to the mds. Other
daemons whose keyrings are owned by the replication controller do not
use the update-and-wait function.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-15 12:26:46 -06:00
Sébastien Han 4438672e47 ceph: expose ceph version to osd pod
We must expose the ceph version to the osd pod so that we can generate
the proper ceph configuration file. If we don't do this all the version
check will assume they run the opposite of the desired version and the
formatting of the `ceph.conf` will be wrong.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-15 15:57:23 +02:00
Sébastien Han 6b84fee2ab ceph: add a CephVersionFormatted so we can consume it
Let's return the expected pattern so that can be consumed by
ExtractCephVersion later. We don't modify the built-in String() so we
can more easily remove that once we switch the osd to be configured from
the operator.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-15 10:52:06 +02:00
Sébastien Han b8874d7f3f ceph: allow logging control
We now run all the daemon with a new option from Nautilus 14.2.1 which
allows us to tell to a daemon to not log on file. However, we can decide
to activate logging by editing the configuration flag 'log_to_file' via
the centralized config store like this for a particular daemon:

ceph config set mon.a log_to_file true

This is useful when a daemon keeps crashing and we want to collect log
files on the system.

Fixes: https://github.com/rook/rook/issues/2881
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-15 10:52:03 +02:00
Sébastien Han d4c48bb293 ceph: expose /var/log/ceph to the host
It's quite convinient to expose /var/log/ceph so that we can decide to
activate logs locally on the machine and see what's going on.
This is only a placeholder when a daemon is stuck crashlooping and we
want to allow administrator to gather log files.
We still do not log on file but this can be activated via a config
option passed to the centralized config option store.

For some daemons, which typically do not store any data (rgw, rbd-mirror
and mds) we had to propagate dataDirHostPath from the cluster spec to
each creation call so that the bindmount can happen.

Fixes: https://github.com/rook/rook/issues/2881
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-15 10:47:09 +02:00
Sébastien Han 4627b66636 ceph: expose clusterInfo to the osd code
When instanciating an osd, we now pass clusterInfo which basically
represents a collection of information about a particular Ceph cluster. Rook uses information
// about the cluster to configure daemons to connect to the desired cluster.

From clusterInfo, we use the CephVersion which helps us putting
conditions for our code execution.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-04-15 10:47:09 +02:00
Alexander Trost 30589000e3 Merge pull request #2976 from galexrt/clustername_param
rookflex: Use `clusterName` if available for backwards compatibility
2019-04-13 17:56:05 +02:00
Travis Nielsen b1b77d84d6 Merge pull request #2971 from SUSE/ceph-pods-add-rook-version-label
ceph: add 'rook-version' label to controllers
2019-04-12 15:44:25 -06:00
Blaine Gardner 685a8df08d ceph: add 'rook-version' label to controllers
Add a `rook-version` label to all controller resources used by Ceph:
deployments, daemonsets, and jobs. Labels are added to controller
resources only and not to the pod templates within because changing pod
templates causes updates due to the label change. The controller
resources themselves are not updated with the label addition and
therefore don't cause an unnecessary upgrade.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-12 13:56:31 -06:00
Alexander Trost 85fa159038 rookflex: Use clusterName if available for backwards compatibility
This fixes issues for users trying to delete volumes and failing because
they only have `clusterNames` set on them in Rook earlier v0.8.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-04-12 21:26:16 +02:00
Ramana Raja 7800d33171 ceph filesytem: use fs fail to bring down filesystem
A ceph filesystem was brought down by marking the filesystem
as down and individually failing the MDSes. From nautilus onwards,
this could be more simply and efficiently done by using
`fs fail` command. See,
https://github.com/ceph/ceph/commit/4c49f165ec1

Resolves: #2841

Signed-off-by: Ramana Raja <rraja@redhat.com>
2019-04-12 20:42:48 +05:30
Ramana Raja bd77c609d7 ceph filesystem: correct log message
Downing filesystem is incorrectly logged as removing filesystem.

Signed-off-by: Ramana Raja <rraja@redhat.com>
2019-04-12 20:42:48 +05:30
Alexander Trost 8bc26d9096 k8sclient: Update all operators to use apps/v1
All usages of k8s go client are now also using the versioned `AppsV1() `
call for the client.

Updated MySQL and Wordpress, and Kube Registy examples to use apps/v1
Deployments.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-04-12 09:25:42 +02:00
Travis Nielsen 8f3d62e56b Merge pull request #2936 from SUSE/cautious-osd-node-removal
ceph: remove osd host nodes only when certain
2019-04-11 12:34:24 -06:00
Blaine Gardner a80082988d ceph: remove osds only when certain
Make the Ceph operator more cautious about when it decides to remove
nodes from the Rook-Ceph cluster which are acting as osd hosts.

When `useAllNodes` is set to `true` we assume that the user wants to
have the most hands-off experience. Node removals are allowed when a
node is delted from Kubernetes and when a node has its taints/affinities
modified by the user (but not by automatic k8s modification as much as
possible).

When `useAllnodes` is set to `false` the only time a node is removed is
if it is removed from the Ceph cluster definition.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-11 09:41:54 -06:00
Travis Nielsen d3e681bb63 Merge pull request #2864 from SUSE/SH_#2858
prevent multiple orchestrations at the same time
2019-04-11 09:24:54 -06:00
Stefan Haas badd3bc165 ceph: Prevent multiple orchestrations at the same time. Fixes #2858
Signed-off-by: Stefan Haas <shaas@suse.com>
2019-04-11 08:57:20 +02:00
Travis Nielsen 38be11936c Merge pull request #2859 from phlogistonjohn/jjm-csi-simplify-1
Simplify Ceph CSI setup
2019-04-10 17:23:41 -06:00
Travis Nielsen 1113688aa8 Merge pull request #2952 from dyusupov/master
support for configurable trlog settings
2019-04-10 17:18:47 -06:00
John Mulligan 7ee207b0fb ceph csi: tweak options handling around enabling csi
Simplify one function and improve option wording.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-04-10 17:53:28 -04:00
travisn 5ebb651e37 ceph: update the cephcluster custom resource with ceph health
The CephCluster resource will now expose the health of the ceph cluster
so admins can query the status with k8s api or kubectl instead of
needing to run the rook toolbox. The operator will query the
ceph status periodically and update the status in the custom resource.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-10 14:41:18 -06:00
Blaine Gardner 9c0369f264 k8sutil: extract granular node validity functions
Node validity is not always as simple as a true/false. Refactor each
validity test into its own function for operators that wish to check
validity more granularly. Ceph will use these changes.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-10 12:43:43 -06:00
Travis Nielsen e0d3ffdceb Merge pull request #2839 from Madhu-1/fix-drivername
Fix driver name in ceph csi driver
2019-04-10 08:51:06 -06:00
Madhu Rajanna d9dd81396c remove attacher statefulset for rbd csi driver
deploy attacher as a container inside  rbd provisioner
stateful set

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-04-10 18:27:08 +05:30
Travis Nielsen 2ca611a1bd Merge pull request #2940 from travisn/nautilus-support
Add nautilus to the list of supported Ceph versions
2019-04-09 21:53:14 -06:00
Dmitry Yusupov e1f61219b4 support for configurable trlog settings
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2019-04-09 15:20:18 -07:00
Blaine Gardner f126887b52 tests: add T/F/Unk. status to node ready condition
Rook previously relied on the presence of `Ready` to determine if a node
is ready, but `Ready` can have different statuses. Correct this.

https://kubernetes.io/docs/concepts/architecture/nodes/#condition

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-09 15:40:37 -06:00
Madhu Rajanna d99527382d replace fmt.Errorf with errors.New
if error formatting is not required
we can we errors.New()

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-04-09 15:48:16 +05:30
Travis Nielsen b15391819b Merge pull request #2910 from SUSE/mon-port-upgrade-fix-2854
ceph: fix for masked upgrade failures and getting integrations running again
2019-04-08 17:11:32 -06:00
Blaine Gardner 35e2fbe4e0 optest: wait longer for deployment image
The Ceph upgrade test is the only one which uses the
`WaitForDeploymentImage` method, and it has to be configured to wait
longer after upgrade at this point. Since the wait time is still
hard-coded, this method is moved to the operator's test dir to make
it clear that the method is suitable only for tests currently.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-04-08 10:30:32 -06:00
travisn 1f91eda58c ceph: add nautilus to the list of supported versions
Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-07 00:03:29 -06:00
Keith Schincke 878ef8ff00 Issue 2660: Deleting CephObjectStoreUser does not delete secret
When deleting a CephObjectStoreUser the deleteUser function
attempts to delete the stored secret using the wrong name. This
patch updates deleteUser to use the same fmt.Sprintf call used in
the createUser function.

Updated CI to delete the correct CRD and check the secret is deleted.

Signed-off-by: Keith Schincke <keith.schincke@gmail.com>
2019-04-05 10:52:15 -05:00
travisn eb74bf5547 Configure a cluster in the same namespace as the operator
To simplify the deployment of Rook, both the operator and cluster crd are now created in the
same namespace in the examples. By default the operator will only manage a cluster crd
in the same namespace instead of watching for clusters in all namespaces. To manage a cluster
in another namespace, the roles in latter half of operator-common.yaml need to point to the new
namespace and the operator env var ROOK_CURRENT_NAMESPACE_ONLY should be set to false.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-04 12:42:08 -06:00