Commit Graph
334 Commits
Author SHA1 Message Date
Sébastien Han fc27fbdff5 Merge pull request #3409 from noahdesu/pvc-binding-size-suffix
ceph: adjust M-to-Mi rounding in PV creation
2019-07-09 09:38:04 +02:00
Noah Watkins e7ae2b6abd ceph: adjust M-to-Mi rounding in PV creation
Example of failure scenarios:

   - requested PVC 500M = 500,000,000 bytes
   - PV is created as:
        (500M / 2**20)Mi = "476"Mi
        But 476Mi = 476 * 2**20 = 499122176 < 500M

From the k8s documentation:

   Claims will remain unbound indefinitely if a matching volume does not
   exist. Claims will be bound as matching volumes become available. For
   example, a cluster provisioned with many 50Gi PVs would not match a
   PVC requesting 100Gi. The PVC can be bound when a 100Gi PV is added
   to the cluster.

which is inline with the behavior observed in which a 500M PVC is never
bound. However, the documentation also states:

   If a PV was dynamically provisioned for a new PVC, the loop will
   always bind that PV to the PVC. Otherwise, the user will always get
   at least what they asked for

which suggests that an _explicit_ binding can be created, and perhaps
something has changed with respect to this binding that has caused the
failures in newer versions of k8s.

fixes: #3391
fixes: #2922

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-07-08 10:20:03 -07:00
Umanga Chapagain 732f3030d0 integrate prometheus based monitoring with rook-ceph
> add new field to cluster spec
> deploy servicemonitor
> deploy prometheusRule

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-08 11:40:17 +05:30
Sébastien Han 05c9b0253e Merge pull request #3388 from leseb/panic-cr-update
ceph: controller: fix panic on cr update
2019-07-05 16:28:55 +02:00
Umanga Chapagain 25e4275082 Rook: Added NodeAffinity to agent and discovery daemon
Previously, Rook Agent and Discovery DaemonSet deployment didn't allow
adding nodeAffinity. This commit adds nodeAffinity spec to daemonSet
deployment, which can be configured through environment variables in
operator deployment yaml.

+ Support multiple LabelKey, each with multiple LabelValue
+ Support multiple LabelKey with no value

Signed-off-by: Umanga Chapagain <chapagainumanga@gmail.com>
2019-07-05 13:48:09 +05:30
Sébastien Han f183ad2bb1 ceph: controller: fix panic on cr update
If we are running a Ceph cluster that has an unsupported version and if
we have set allowUnsupported: false, a newly bootstrap operator will
fail to start. To fix this, the user will update the CR and set
allowUnsupported: true, however at this point clusterInfo hasn't been
initialized so the operator will panic because we were referencing a nil
pointer.

To fix this, we re-populate clusterInfo if necessary and things go
smoothly.

Closes: https://github.com/rook/rook/issues/3137
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-04 16:21:17 +02:00
Sébastien Han 6d62005472 ceph: osd: fix cli arg
Somehow during startup the arg got misinterpreted by ceph-osd and was
failing with:

2019-06-19 15:23:09.098967 I | exec: Running command: ceph-osd --foreground --id 0 --osd-uuid feceb7d7-3148-4a0d-af7a-753ba2f21a92 --conf /var/lib/rook/osd0/rook-ceph.config --cluster ceph --default-log-to-file false --ms-learn-addr-from-peer false
2019-06-19 15:23:09.135921 I | unrecognized arg false
failed to start osd. Failed to complete '': exit status 1.

Now we concatenate the whole flag to avoid that.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-04 16:19:57 +02:00
travisn 9d7474467c set the fully qualified apiVersion for OwnerReferences
OwnerReferences are now created with the fully qualified apiVersion
such that the references will work properly on OpenShift.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-01 06:55:08 -06:00
travisn 8226d577f6 remove obsolete check for setting the resource ownerreferences
The check for whether to set the OwnerReferences is no longer
necessary. When passing the correct value to the apiVersion,
the OwnerReferences can be successfully set for OpenShift.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-01 06:55:07 -06:00
Travis Nielsen e663624827 Merge pull request #3324 from Madhu-1/csiv1.1.0
update rook to use ceph-csi canary image
2019-06-25 08:24:21 -06:00
Madhu Rajanna 71f369303e update rook to use ceph-csi canary version
ceph-csi canary version is close to ceph-csi v1.1.0
release

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-06-25 17:15:46 +05:30
Guy Margalit 2ce2382676 Refactor operator context init and allow to run local
Signed-off-by: Guy Margalit <guymguym@gmail.com>
Co-Authored-By: Sébastien Han <seb@redhat.com>
Co-Authored-By: Travis Nielsen <tnielsen@redhat.com>

This change is meant to allow running operators locally on a developer machine.
The idea is to allow faster development cycles by reducing the time and complexity of building -> deploying -> debugging on cluster.

For operators that rely only on kubernetes API this works easily - see cockroachdb and minio examples in development-flow doc.

The change includes:

- rook.NewContext() - Refactored to remove repeating initialization code that was copy-pasted in most of the operators in order to create the clusterd.Context and the Clientsets. Also it detects the mode of working in-cluster vs external and sets up the external mode with standard user config (~/.kube/config) and a job executor.
- rook.GetOperatorImage() - Refactor this repeating code in many operators to detect the operator pod image. Also added a global flag --operator-image that developers can use to override this when running locally.
- rook.TerminateOnError() - Added a convenient function.
2019-06-19 20:47:55 +03:00
Travis Nielsen 818ad9c7ca Merge pull request #2939 from travisn/delay-system-daemons
Delay starting the Rook system daemons until a CephCluster CR is created
2019-06-18 16:52:12 -06:00
Travis Nielsen 1d35f26302 Merge pull request #3313 from leseb/osd-sdn
ceph: osd: fix startup on sdn
2019-06-18 16:13:52 -06:00
Travis Nielsen 9df4b24197 Merge pull request #3117 from rohan47/osd_marked_out
Clean up the OSD after the OSD is marked "out"
2019-06-18 08:13:35 -06:00
Sébastien Han b2f2ff6b9d ceph: osd: fix startup on sdn
This commit adds a new flag to the osd startup so that on msgr2 (default
on Nautilus and above) the osd is able to find the IP address in the
container to bind to.

This requires this Ceph patch https://github.com/ceph/ceph/pull/28589
and is already present in Octopus.

Closes: https://github.com/rook/rook/issues/3140
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-18 10:19:19 +02:00
travisn c6c4a9b42a ceph: delay starting the system daemons until a cluster is created
When the operator first starts, the only operation needed
is to watch for new cephcluster crds to be created and
start the discovery to find available devices. The flexvolume
agent, the csi driver, and the volume provisioning can all be delayed
starting until the first cluster is created.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-06-17 15:44:33 -06:00
Travis Nielsen 8da2221296 Merge pull request #3283 from leseb/rgw-refactor
ceph: refactor rgw bootstrap
2019-06-14 15:17:58 -06:00
rohan47 a420db69fe osd: Clean the osds that are out and safe-to-destroy
- When an osd is marked out, and it is safe to be destroyed then delete the osds deployment.
- Removed osdGracePeriod
- Updated unit tests to test osd marked out action

Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-06-14 22:50:33 +05:30
Sébastien Han 93b2448619 ceph: refactor rgw bootstrap
This commit does multiple things:

* remove support for AllNodes where we would deploy one rgw per node on
all the nodes.
* a transition path is implemented in the code so that if someone has an
existing deployment, daemonsets will be removed and replaced by an
deployments.
* when using "instances", each rgw deployed has its own key which makes
Ceph reporting the exact number of rgw running, see:

```
[root@rook-ceph-operator-775cf575c5-bh4sr /]# ceph -s
  cluster:
    id:     611fcf39-0669-4864-9a12-debb35c0397a
    health: HEALTH_OK

  services:
    mon: 3 daemons, quorum a,b,c (age 12h)
    mgr: a(active, since 12h)
    osd: 3 osds: 3 up (since 12h), 3 in (since 12h)
    rgw: 3 daemons active (my.store.a, my.store.b, my.store.c)

  data:
    pools:   6 pools, 600 pgs
    objects: 235 objects, 3.8 KiB
    usage:   3.0 GiB used, 84 GiB / 87 GiB avail
    pgs:     600 active+clean
```

Closes: https://github.com/rook/rook/issues/2474, https://github.com/rook/rook/issues/2957 and https://github.com/rook/rook/issues/3245
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-14 17:55:15 +02:00
John Mulligan 431f504cd4 ceph: create and maintain a config map for ceph csi to consume
Create and maintain a config map that meets the requirements of
the ceph csi such that Rook can maintain the contents of config
map with up-to-date mon information to be used later by csi.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-06-14 10:45:41 -04:00
Sébastien Han f6f1aa772f rgw: remove legacy code
This code can be removed since 1.0 shipped.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-14 16:28:17 +02:00
Sébastien Han cba9a359a0 ceph: upgrade apply osd nautilus flag
When OSDs are running on Nautilus we always disable old osd features and
aplpy the onces for Nautilus as described in the upgrade doc.
During an upgrade or the next time an orchestration will be called the
command will be applied. The command is idempotent so we can run it each
time.
This can be backported for 1.0.3

Closes: https://github.com/rook/rook/issues/2960
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-13 22:15:15 +02:00
Sébastien Han 0317de9096 rgw: change default frontend on nautilus
As per: ceph/ceph#26599, Beast is now the
default fronted for rados gateway.
Newly created cluster as of Nautilus will use it by default.

Re-added version of 03587352d5
Resolves: #2707
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 23:10:11 +02:00
Travis Nielsen f2c49ea034 Merge pull request #3165 from d-luu/resource_comparer
ceph: added comparer for resource quantity when checking cluster changes
2019-06-07 11:15:33 -07:00
Sébastien Han 6438d9907e ceph: retry on detecting ceph version
Sometime the kube engine needs a bit of time to return the logs of a
given job and fails to read the stream.
Retrying up to detect the Ceph version seems reasonnable to
overcome this issue.

Fixes: https://github.com/rook/rook/issues/3227
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 18:13:38 +02:00
Sébastien Han d3c8d5612b ceph: add resource limit check for rbdmirror
The memory check was missing and will be trigger if resources limit are
configured for the rbdmirror pod.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 15:06:16 +02:00
Sébastien Han 24abbddf14 ceph: fix pod memory check
This commit fixes the second test case where limit and request are
either identical or different but still we use limit as a value.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-07 15:06:16 +02:00
DL186038 d22886da37 ceph: added resource quantity comparer when checking cluster changes
the resource struct has non-exportable fields which panics when
doing the diff comparison

Signed-off-by: d-luu <david@davidluu.info>
2019-06-06 15:39:50 -05:00
rohan47 a380ca7dc1 fixed ceph pg dump pgs_brief json deserialization
Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-06-06 21:54:37 +05:30
Travis Nielsen d5523086b6 Merge pull request #3265 from leseb/rgw-liveness
ceph: rgw add liveness probe check
2019-06-06 10:05:27 -06:00
Sébastien Han 241296be8a ceph: rgw add liveness probe check
We now check if the pod responds on http port 80.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-05 14:35:15 +02:00
Noah Watkins 71c88ae9e9 ceph: log osd recovery at info level
for the osd recovery case (DOWN->UP) log at a matching log level as the
message indicating the OSD went down.

fixes: #2904

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-06-04 13:57:49 -07:00
Travis Nielsen 1daa70f79c Merge pull request #3085 from christianhuening/feat-2271
added Liveness Probe to Ceph Mgr
2019-05-28 17:26:12 -06:00
Blaine Gardner e8a638dcba ceph nfs: fix the host path for pod volume
Path previously did not use dataDirHostPath. It should, so fix this.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-05-19 06:33:04 -06:00
Christian Hüning f0699c40bf Added Liveness Probe to Ceph Mgr
This will configure a liveness probe for every ceph mgr deployment

Signed-off-by: Christian Hüning <christian.huening@figo.io>
2019-05-17 07:24:28 +02:00
Santosh Pillai 7d5afa29b8 added device class pool property
- Updated code to use deviceClass property when a pool is created for both "replicated" and "erasure code".
- Updated "ceph crush rule create-..." command to use "create-replicated" instead of "create-simple"
- Updated unit tests
- Updated (ceph-pool-crd.md) documentation to reflect the changes.
- Updated pending release notes.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-05-15 16:45:39 +05:30
Jose A. Rivera f3a1512983 Read node labels for provider topology
Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2019-05-14 13:18:00 -05:00
travisn cb82f36eba ceph: no need for --public-bind-addr with host networking
The mons require the --public-bind-addr when host networking is not in use
since the pod ip will be different from the service ip that will be
advertised to clients. When host networking is enabled, there is no
need for this argument since the endpoints will be the same to bind
inside the pod as what is advertised to clients.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-05-10 15:07:46 -06:00
travisn dbe3da97a1 ceph: preserve the non-default port for hostnetworking
Clusters using host networking will not work if the non-default port is
being used by the mons. Previous to rook 1.0 the mons were all
using the non-default port 6790 and now they are using the default port
of 6789 from 1.0. Now host networking will preserve the non-default port
to allow upgrades to continue working.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-05-10 12:24:57 -06:00
Noah Watkins e33eb98047 ceph: run self-signed cert creation with timeout
fixes: #2784

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-05-06 10:10:05 -07:00
Noah Watkins c2dbb93096 ceph: simplify the ceph command execution interface
this adds a structure to hold various settings related to executing ceph
cli commands, and introduces a common interface for configuring and
running such commands.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-05-06 10:10:05 -07:00
Alexander Trost 7cf8e99a8c ceph-op: Remove taint check in "is node scheduable" func
This removes the unnecessary check for taints on nodes in the
`GetNodeSchedulable()` function. This fixes that even though the user
has specified `tolerations` for, e.g., `NoSchedule` taints, that would
be ignored and the node(s) directly be "marked" as unschedulable.

Signed-off-by: Alexander Trost <galexrt@googlemail.com>
2019-05-02 18:05:46 +02:00
Noah Watkins a661b2db02 ceph: rewind http bind fix on upgrade
when upgrading to a newer version of ceph that doesn't need the http
binding fix, this patch unwinds the configuration fix which may still be
present when upgrading from a cluster without the fix. if the
configuration fix remains then the dashboard and prometheus servers will
not be able to properly configure themselves.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-05-01 22:30:12 -07:00
Travis Nielsen 221560bf24 Merge pull request #3090 from kshlm/delete-active-job-if-requested
ceph: Delete and recreate rook-ceph-detect-version job
2019-05-01 10:16:18 -06:00
Travis Nielsen 726efd017a Merge pull request #3089 from travisn/osds-query-latest-nodes
Query the latest list of nodes for osd orchestration
2019-05-01 10:16:04 -06:00
travisn 77c7eb52f9 ceph: query the latest list of nodes for osd orchestration
The list of nodes to be queried for configuring OSDs
should include all of the K8s nodes before the placement
or other filters are applied. The operator was sometimes
missing configuring OSDs on nodes if the discover pod
hadn't finished running on a node. Now the osd prepare
job will be triggered on a node even if the discover pod
hasn't yet run there.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-30 17:07:12 -06:00
travisn 20f6af8a4d remove obsolete flex driver version checks
The flex driver no longer needs to check whether a kubelet
restart is needed or whether the namespace-specific driver
can be supported. The copy of k8s 1.13 types can also
be removed since we have updated to a newer k8s client.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-30 14:50:33 -06:00
Noah Watkins fc7baef6aa ceph: add tests for dashboard http bind fix
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-30 10:57:37 -07:00
Noah Watkins 1efb8af87b ceph: selectively apply http bind addr fix
fixes: #2492

the http bind address fix in rook address an upstream issue in ceph in
which cherrypy break when binding to `::` when the host doesn't have an
ipv6 address. it fixes the issue by always binding prometheus and the
dashboard webservers to the pod address. by doing this, it prevents
using the kubectl port-forward technique, which some users would like.

a patch to cherrypy is upstream in ceph. this PR checks the ceph version
and selectively disables the fix so that both port-forward and the
normal service method works. this is the verison matrix:

          FIX     VER
          ---     ---
luminous merged (>= 12.2.12)
mimic    merged (>= 13.2.6)
nautilus merged (>= 14.1.1)

when all the containers for these versions exists and sufficient time
passes the unreachable code guarded by the version checks in this patch
can be removed.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-04-30 10:06:39 -07:00