Commit Graph
3035 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
Sébastien Han fdaecc263b Merge pull request #3406 from travisn/template-skip-ci
Add documentation for skipping the CI
2019-07-12 08:47:02 +02:00
Blaine Gardner 582fe014e4 Merge pull request #3438 from SUSE/fix-merge-bug-in-master
Ceph: Fix crit bug in call to detect Ceph version
2019-07-11 17:02:17 -06:00
travisn 9af20e8dc0 Add documentation for skipping the CI
The CI only needs to be run for PRs that have code changes.
PRs that are only documentation, yaml, or other files
that are not built should skip the long and tedious
CI process. This makes the [skip ci] flag more discoverable.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-11 16:40:40 -06: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
Sébastien Han 6e91054422 Merge pull request #3179 from Miouge1/rgw-tutorial-with-region
Add a --region in the s3cmd tutorial
2019-07-11 16:17:50 +02:00
Maxime Guyot f344e2454d Add a --region in the s3cmd tutorial
Add `--region :default-placement` in RadosGW tutorial to avoid the InvalidLocationConstraint error

Signed-off-by: Maxime Guyot <maxime.guyot@elits.com>
2019-07-11 16:05:19 +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
Dmitry Yusupov c640ba3dc3 Merge pull request #3431 from ngoduykhanh/patch-1
Update edgefs-quickstart.md
2019-07-10 22:57:58 -07:00
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
Khanh Ngo b7cd33b981 Update edgefs-quickstart.md
Correct the namespace of rook cluster. It should be `rook-edgefs`

Signed-off-by: Khanh Ngo <k@ndk.name>
2019-07-11 10:31:58 +07: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
Travis Nielsen 9250c072cc Merge pull request #3322 from umangachapagain/rook-ceph-monitoring
Integrate ceph-mixins with rook-ceph
2019-07-08 18:27:03 -06: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
Alexander Trost f0b0f0e4f3 ceph: wrong pool name for CephFS StorageClass (#3400)
ceph: wrong pool name for CephFS StorageClass
2019-07-08 09:56:02 +02:00
Sébastien Han 2372c4f9c8 Merge pull request #3410 from travisn/test-cleanup-before-start
Tests: Ensure cluster does not exist before starting a test
2019-07-08 09:27:24 +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
travisn ef9dc0be74 tests: ensure cluster does not exist before starting a test
The CI instances are not always being properly cleaned up
between runs. This is an attempt to get the tests
to ensure a clean install before proceeding with the test.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-07-05 16:41:52 -06:00
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
Joel Huang c404a7e68b ceph: wrong pool name for CephFS StorageClass
* This error is found in creating CephFS StorageClass using document `Documentation/ceph-csi-drivers.md`: "expect a pool named `cephfs_data` in your Ceph cluster"
* **`kubectl apply -f pool.yaml` using metadata.name "cephfs_data" produce error:** The CephBlockPool "cephfs_data" is invalid: metadata.name: Invalid value: "cephfs_data": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
* accoding to `Documentation/ceph-filesystem-crd.md` linked from `Documentation/ceph-csi-drivers.md` file and field test, it should be `myfs-data0`

Signed-off-by: Joel Huang <joelhy@gmail.com>
2019-07-06 00:21:34 +08:00
Travis Nielsen 0f699aa33c Merge pull request #3377 from poornimag/fork-ceph-image-latest
Change the ceph image to point to latest-nautilus-devel
2019-07-05 08:42:05 -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
Alexander Trost 1992de4236 ceph: fix typo error storegeclass (#3396)
ceph: fix typo error storegeclass
2019-07-05 15:37:01 +02:00
Joel Huang d4945d6533 ceph: fix typo error storegeclass
The word "storegeclass" should be "storageclass"

Signed-off-by: Joel Huang <joelhy@gmail.com>
2019-07-05 21:28:36 +08:00
Sébastien Han c9896071ce Merge pull request #2886 from umangachapagain/issue-2005
Added NodeAffinity to Agent and Discover Daemon
2019-07-05 10:37:24 +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
Poornima G 4ddef3e823 Change the ceph image to latest-nautlius-devel
Currently in cluster deploy, ceph image points to ceph/ceph:v14.2.1-20190430.
Changing this to use ceph/daemon-base:latest-nautilus-devel as its the latest nautilus.

Ceph nautilus has some changes in cephsfs mgr module, which is required by ceph-csi
canary image, without which the create/purge of RWX PVCs will fail. These changes
are not yet part of any released ceph version, i.e v14.2.1-20190430. Even in the
short future, we expect some changes to land in Nautilus after 14.2.2, hence
waiting for 14.2.2 release and updating to it, will not solve the issue.
Therefore using latest-nautilus-devel, which will always have the changes
required by ceph-csi. This is only a temperory change in the master, until
14.2.3 is released.

Signed-off-by: Poornima G <pgurusid@redhat.com>
2019-07-05 06:50:30 +00:00
Sébastien Han 71e3eef266 Merge pull request #3389 from leseb/osd-sdn-arg
ceph: osd: fix cli arg
2019-07-04 16:21:44 +02:00
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
Sébastien Han 1d19a14075 Merge pull request #3328 from travisn/test-k8s-1.15
Add k8s 1.15 and remove 1.10 from integration tests
2019-07-04 11:14:07 +02:00
Sébastien Han 83e50dbdf7 Merge pull request #3385 from bk201/wip-3384
Ceph: fix error when creating monmap in Octopus
2019-07-04 11:12:52 +02:00
Sébastien Han a66caf2da3 Merge pull request #3358 from Madhu-1/fix-3357
Update rbd and cephfs secret
2019-07-04 08:56:03 +02:00