Commit Graph
1040 Commits
Author SHA1 Message Date
Sébastien Han 562633ce99 Merge pull request #3436 from krig/label-validation
k8sutil: Ensure rook version label has valid syntax
2019-07-12 11:35:52 +02:00
Kristoffer Grönlund 6ff69a4e72 k8sutil: Ensure rook version label has valid syntax
Replace any invalid characters and ensure length
and format for the rook version label, to avoid
problems with version strings that contain
illegal characters (common characters that aren't
valid in labels would be + and ~, for example).

Kubernetes label syntax:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set

Fixes: #3434
Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
2019-07-12 10:20:30 +02:00
Blaine Gardner cc359b6d6b Ceph: Fix crit bug in call to detect Ceph version
For all calls to detect the Ceph version, ensure they are consistent.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-11 16:37:45 -06:00
Blaine Gardner c2225ce453 Merge pull request #3420 from rohan47/safe_to_destroy
Updated condition check to avoid panic
2019-07-11 16:10:16 -06:00
Blaine Gardner 5fc99a6266 Merge pull request #3369 from SUSE/cmd-reporter
Add cmd-reporter daemon; use it to get ceph version
2019-07-11 16:05:14 -06:00
Sébastien Han 928c4a01da Merge pull request #3418 from InfuseAI/feature/add-linear-type-to-supported-disks
Add linear to support diskType
2019-07-11 17:35:46 +02:00
rohan47 d78631841e Updated condition check to avoid operator crash
Empty deployment list made the operator to crash as the condition check
was checking if the value at the 0th location is nill wich fails in case
of empty list. Updated it to check length of list not equals 0.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2019-07-11 14:56:10 +05:30
Travis Nielsen 38f3c73867 Merge pull request #3419 from InfuseAI/feature/remove-unused-methods
Remove unused clusterd.GetAvailableDevices
2019-07-10 21:45:58 -06:00
Ash Wu e6d43d9d0b Add linear to support diskType
Linear raid can be created using `mdadm --create --level=linear`,

By creating a linear raid disk on top of a logical volume,
we can pass the linear device to `ceph-volume lvm batch --prepare`
to provision a new OSD on top of the logical volume since
`ceph-volume` does not take lv as the data device.

Signed-off-by: Ash Wu <hSATAC@gmail.com>
2019-07-10 11:14:26 +08:00
Sébastien Han 1a7766b36e Merge pull request #3415 from leseb/beast-fronted-ssl
ceph: rgw: set proper port syntax on beast
2019-07-09 11:34:15 +02:00
Ash Wu b0eb246919 Remove unused clusterd.GetAvailableDevices
clusterd.GetAvailableDevices is not used anywhere.

Signed-off-by: Ash Wu <hSATAC@gmail.com>
2019-07-09 17:16:37 +08:00
Sébastien Han a4168fc8f8 Merge pull request #3414 from leseb/do-not-create-cm
ceph: stop creating initial crushmap
2019-07-09 09:39:15 +02:00
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
Sébastien Han 7d54cac453 ceph: rgw: set proper port syntax on beast
The beast fronted configuration for rgw is quite different than civetweb
so we adapted the construct of the arg line based on that configuration
requirement.

Closes: https://github.com/rook/rook/issues/3411
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-08 17:54:43 +02:00
Sébastien Han 5a2cd41d25 ceph: keyring: stop using auid 0
This setting is long gone in Ceph and not used anymore, so let's not
create it for new cluster.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-08 12:11:05 +02:00
Sébastien Han ccf2110007 ceph: stop creating initial crushmap
This commit does:

* remove dead code SetCrushTunables()
* stop creating initial crushmap

There is no need to create an initial crushmap, since Ceph natively does
that for us.
We don't delete the existing configmap containing the initial crush map
of already deployed cluster, perhaps people are using for whatever
reason. It does not harm to keep it around.

Closes: https://github.com/rook/rook/issues/3138
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-07-08 12:07:46 +02: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
Blaine Gardner 2ef83c4027 ceph: use cmd-reporter for ceph version job
Use cmd-reporter to detect Ceph version.

The job to detect Ceph version needs to run in a security account context
capable of getting/creating ConfigMaps, so a new security account, role,
and role binding are created for the cmd-runner jobs. In the future, the
Ceph mgr may create jobs in this service account for running
`ceph-volume` on nodes, and this also keeps Rook operators controlling
multiple Ceph clusters independent.

Fixes #2686 - ceph version job not working correctly with graylog

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 15:37:14 -06:00
Blaine Gardner 0a58d3dfdd k8sutil: add cmd-reporter wrapper
Add a wrapper for the cmd-reporter function of the 'rook' binary to
k8sutil so that it's easier for operators to use the functionality.

Operators still need to have some idea of how CmdReporter works. It runs
the requested command in a job, but if the calling operator needs the
job to have special configuration, the operator must request the pointer
to the job struct from CmdReporter to modify it before calling the
CmdReporter's Run method.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 15:37:13 -06:00
Blaine Gardner 867145f6d0 k8sutil: add additional godoc comments to jobs.go
Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 12:03:59 -06:00
Blaine Gardner 10508a886f k8sutil: add DeleteConfigMap with DeleteResource
Implement a DeleteConfigMap function with the new DeleteResource
functionality.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 12:03:59 -06:00
Blaine Gardner bc29aa33be k8sutil: add reusable delete function with opts
Add a `DeleteResource` function that accepts new `DeleteOptions` and
`WaitOptions` structs as inputs. This new funciton is reusable and
extensible for any Kubernetes resource.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 12:03:58 -06:00
Blaine Gardner 5411fe4cde daemon: create new cmd-reporter daemon
cmd-reporter runs a command and puts the results of the command into a
ConfigMap defined by its `--config-map-name` commandline flag.
cmd-reporter is intended to be run as a Kubernetes job where an
operator needs to run a single command and get return information back
from the command which is more than just success/failure.

The ConfigMap returned includes `stdout`, `stderr`, and `retcode` data
from the command. The ConfigMap may be preexisting, in which case
cmd-reporter will overwrite the return information in the ConfigMap.
cmd-reporter labels the ConfigMap with `app=cmd-reporter`, and if the
ConfigMap already has an app label which is different, cmd-reporter
fails without modifying the ConfigMap so as not to overwrite another
application's data in the event of a ConfigMap name+namespace collision.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-07-05 12:03:58 -06:00
Dmitry Yusupov 1f1f58ac1e Merge pull request #3375 from dyusupov/master
support for rook Device.FullPath
2019-07-05 07:40:47 -07:00
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
Dmitry Yusupov 5ffe2f037c support for rook Device.FullPath
Signed-off-by: Dmitry Yusupov <dmitry.yusupov@nexenta.com>
2019-07-03 23:06:58 -07:00
Kiefer Chang 7a4f5c9bda Ceph: fix error when creating monmap
Adjust keyring template because ceph-mon in Octopus fails to
parse keyring file which has leading indention.

Fixes: https://github.com/rook/rook/issues/3384
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
2019-07-03 16:14:34 +08:00
Travis Nielsen 72afc709aa Merge pull request #3353 from sabbot/handle-crd-update
EdgeFS Rolling Upgrade support
2019-07-02 10:43:24 -06:00
Anton Skriptsov 8d0866b20e upgrade service's crds
Signed-off-by: Anton Skriptsov <sabbotagge@gmail.com>
2019-07-01 13:19:03 -07: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
Blaine Gardner 004f795a79 Merge pull request #3326 from krig/rook-binary-location
ceph: Look for binaries on PATH if not found
2019-06-25 09:51:45 -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
Sébastien Han bc50971b75 Merge pull request #3268 from noobaa/guy-init-context
Refactor operator context init and allow to run local
2019-06-25 14:20:42 +02: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
Alexander Trost 9b7eff4ab2 Merge pull request #3321 from phantooom/rui.zou/fix-3141
Minio: throw validatefunc err msg
2019-06-24 18:39:27 +02:00
Sébastien Han d3845e7f75 ceph: stop enforcing crush tunable
This requirement is long gone and was reported in 2017. Clients should
have been updated by then, so there is no reason to set the CRUSH
tunable to such an old client. Actually, we should let Ceph run its own
tunable. They can always be changed later. Also, this was really
restrictive and applied on every orchestration and thus would override
any other config done by an administrator. Even worse, this will trigger
data movement back and forth...

Closes: https://github.com/rook/rook/issues/3138
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-06-24 09:47:32 +02:00
Kristoffer Grönlund b3ba6b40fd ceph: Look for binaries on PATH if not found
Similarly to #2675, try to find the rook binary
on PATH in case it isn't found in /usr/local/bin/rook.

Distributions generally disallow installing files
into /usr/local, as it is reserved for non-system
installations by the FHS.

Signed-off-by: Kristoffer Grönlund <kgronlund@suse.com>
2019-06-21 19:15:56 +02:00
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
xiaorui.zou 0ab2309911 Minio: throw validatefunc err msg
Signed-off-by: xiaorui.zou <xiaorui.zou@gmail.com>
2019-06-19 16:08:35 +08: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