Commit Graph
289 Commits
Author SHA1 Message Date
travisn f4d8ad74af version: print the golang version with the rook version
The version of golang used to build rook is helpful
troubleshooting information. The rook version command will
now print the version of golang.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-10-14 09:29:44 -06:00
Sébastien Han a5ab7ae960 ceph: osd add crush_location on startup flag
Since we remove the ceph.conf files from the OSD we lost the ability to
set the crush location of the OSD. So adding this capability back to the
CLI startup line.

Signed-off-by: Sébastien Han <seb@redhat.com>
2019-09-26 15:59:51 +02:00
Travis Nielsen 5f37de8abc Merge pull request #3927 from Madhu-1/fix-3921
Make kubelet path configurable in operator for csi
2019-09-20 10:45:27 -06:00
Madhu Rajanna 345f099bbc Make kubelet path configurable in operator
currently CSI templates have hardcoded kubelet
path which will  be used for  mounting PVC,this
will not work if kubelet is configured to use
different path, with this PR  kubelet path
can be configured for CSI.

Fixes: #3921

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-09-20 18:51:44 +05:30
Santosh Pillai 9db863377a release the device held onto by lvm
When running osds on pvc, the lvm is still holding the device when the cluster is deleted. As a result the PVs go into `failed` state
when the cluster is deleted. On deactivating the device, the 'failed' pvs get deleted as well. Solution involves:
- Running `lvchange -an <vg group name>` to deactivate the device.
- This command runs after 'osd prepare' completes.
- This command also runs after the 'osd daemon pod' is deleted or if the ceph-osd process terminates for some reasons.

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-09-20 18:08:13 +05:30
travisnandAshish Ranjan 638b591535 ceph: Adds support for MDB controller and machineLabel controller
Add support for MachineDisruptionBudget controller and MachineLabel controller required for fencing
in OpenShift. This will ensure that machines are only fenced and OSDs are only stopped
when Ceph is in a healthy state.

Co-authored-by: Ashish Ranjan <aranjan@redhat.com>
Signed-off-by: travisn <tnielsen@redhat.com>
2019-09-06 16:32:06 -06:00
Rohan CJ f8b7537830 Fix topologyAware on PVC-based OSDs
Signed-off-by: Rohan CJ <rohantmp@gmail.com>
2019-09-06 23:17:01 +05:30
Travis Nielsen cb5143555d Merge pull request #3779 from sp98/fix-osd-failure-on-pvc
fix random OSD daemon pod failures when running OSD on PVC
2019-09-06 06:59:57 -06:00
Santosh Pillai ead0653068 fix random OSD daemon pod failures when running OSD on PVC
OSD pods when running on PVC fail randomly due to some race condition:
 - OSD daemon pod was activating the volume group using vgchange -an without any volume group name.
 - This caused the pods to fail randomly when number of OSDs is more, say greater than 10.
 - This fix adds Volume group name while activating/deactivating volume groups to fix this

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-09-05 20:34:03 +05:30
Maksim Nabokikh 179e1a310d ceph: Add dynamic flexvolume expansion
Allow to dynamic resize of rook volumes

Signed-off-by: Maksim Nabokikh <maksim.nabokikh@flant.com>
2019-09-05 02:40:22 +04:00
Sébastien Han 8abcf37269 Merge pull request #3716 from Madhu-1/metrics
Implement grpc metrics for cephcsi
2019-08-30 14:29:17 +02:00
Madhu Rajanna a8589af337 Implement grpc metrics for cephcsi
grpc metrics is made option in rook
this can be disabled/enabled with ROOK_CSI_ENABLE_GRPC_METRCS
variable in operator.yaml
this will help admin who want to check the grpc metrics
of the ceph-csi plugins

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-30 15:01:45 +05:30
Michael Vollman ed9519953a ceph: add per OSD custom deviceClass support
Add deviceClass as a per OSD config option under
storage/nodes/devices/config for setting a custom crush device class
per OSD.

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-29 20:39:41 -04:00
Michael Vollman 496c638306 ceph: add db-devices flag and fix DatabaseSizeMB
Adding support for the db-devices flag for ceph versions 14.2.1 and
newer.  This flag will allow for explictly setting the db device for
bluestore configurations to the device specified as metadataDevice.

Fixing the databaseSizeMB config parameter to ensure it is used to set
the size of the db-device partition when specified at either the global
or individual device level. (#3652)

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-29 20:39:41 -04:00
travisn b8e5e56dc1 ceph: remove default database size for OSDs
Since Rook is no longer creating partitions and leaving all that
work to ceph-volume, we should let ceph-volume choose the defaults
for the database size and use the max available. The default of 20GB
in fact doesn't even make sense since Ceph will only use the first 3GB
of that size and the other 17GB was wasted.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-28 18:06:39 -06:00
Sameer Kulkarni 7febf030cb yugabytedb: operator/controller implementation
Signed-off-by: Sameer Kulkarni <samkulkarni20@gmail.com>
2019-08-27 22:45:14 +05:30
Madhu Rajanna 78fb35a93d Use Deployment with leader election instead of StatefulSet
Deployment behaves better when a node gets disconnected
from the rest of the cluster - new provisioner leader
is elected in ~15 seconds, while it may take up to
5 minutes for StatefulSet to start a new replica.

if kube version is 1.13.x deploy provisioner as statefulset.
if kube version is higher than 1.14+ deploy provisioner
as deployment.

Refer: kubernetes-csi/external-provisioner@52d1fbc
Refer: ceph/ceph-csi#497

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2019-08-26 19:29:37 +05:30
John Mulligan 9f6c0ba2c5 csi: prevent trivial conflicts between ceph csi instances with a prefix
Add a prefix to the csi drivername when ceph csi is deployed by rook.
This aims to prevent trivial conflict between csi instances when two
rook operators are deployed into the same cluster. By default the
prefix is the "<rook-namespace>." but can by customized on the cli
and via environment vars.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
2019-08-12 16:41:26 -04:00
rohan47andAshish Ranjan d2f52aebe5 Adds support for storageClassDeviceSet in rook-ceph operator
- Added code to support StorageClassDeviceSet spec provided in the cluster-on-pvc.yaml
- The code reads the StorageClassDeviceSet spec and creates pvc based on the ‘count’ field for each device set.
- OSD prepare job is started for each PVC which activates the ceph-volume on each PVC
- Finally OSD is started on each of the PVC device.

Co-authored-by: rohan47 <rohgupta@redhat.com>
Co-authored-by: Ashish Ranjan <aranjan@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2019-08-12 09:24:13 -06:00
travisn 7b0a7fbfeb allow the discovery daemon to be optional
The discovery daemon is only necessary to be run when
OSDs are being created on raw devices and detect when
new devices are added to the cluster. If OSDs do not need
to be configured on devices, the discovery daemonset
has no need to be started.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:01:29 -06:00
travisn af72af0633 add option to disable flex driver
The flex driver does not need to be started if
only the CSI drivers are going to be used. Therefore,
we allow the admin to stop launching the rook flex
agent with the setting ROOK_ENABLE_FLEX_DRIVER in
operator.yaml

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:01:26 -06:00
travisn 0a3fbf62f3 enable the ceph-csi driver by default
CSI is now the preferred storage driver for Rook.
By default both the CSI and flex drivers will be started
by the operator. In a future release the flex driver
will be deprecated, but for now is still supported.

The drivers can be disabled with an environment
variable in the operator deployment in operator.yaml.
If users are only using one driver or the other there is
no need to enable both drivers.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-08-07 10:00:41 -06:00
Michael Vollman f3ef680298 ceph: Add support for per OSD metdataDevices
Add ceph-volume support for per OSD metdataDevices

Signed-off-by: Michael Vollman <michael.b.vollman@gmail.com>
2019-08-02 07:41:45 -04: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
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 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
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
travisn fd341ae928 ceph: set the fsgroup only on the top level of the mount
If setting the fsgroup recursively on a shared filesystem mount is
not desirable, the fsgroup capability on the flex driver
should first be disabled in the operator env vars. Now the driver
will apply the fsgroup only at the top level instead of
recursively for the entire shared filesystem.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-06-06 17:17:29 -07:00
travisn 7cdfcc395a write flex settings to config file instead of env vars
The flex settings cannot be passed to the driver with environment variables.
There is no context available for returning the flex settings except
that the flex driver will look in a config file in the same directory.
These settings must be valid or else the driver will return the default
settings.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-04-30 14:50:43 -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
Ashish Ranjan dac028ab24 enhance(nfs): remove one to one mapping for nfs provisioner
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit removes one to one mapping of NFS provisioner and adds a dedicated provisioner for nfs.
2019-04-26 20:52:30 +05:30
Ashish Ranjan 858c8eede7 refactor(operator): removed wild card from the operator
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>
2019-04-26 04:25:49 +05:30
Ashish Ranjan 23efbf658b enhance(NFS): adds dynamic provisoning for nfs
Signed-off-by: Ashish Ranjan <ashishranjan738@gmail.com>

This commit adds dynamic provisioning for nfs
2019-04-26 04:25:49 +05:30
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
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
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
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
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
Noah Watkins 379cb98689 ceph: replace release name with fine-grained version
The basic idea here is to replace the release name in the ClusterInfo
object with the fine grained version information queried at runtime.
This patch also removes the Name field from the cluster spec, which was
also runtime determined and was redundant with ClusterInfo relase name.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2019-03-18 12:57:29 -07:00
Blaine Gardner 086fa8231c rgw: configure entirely in operator
Configure the Ceph rgw daemon completely from the operator a la the
recent changes to the Ceph mon, mgr, and mds operators.

Create the rgw deployment or daemonset first, and then create the
keyring secret for the object store with its owner reference as the
corresponding deployment or daemonset. When the replication controller
is deleted, the secret is also deleted.

The RGW's mime.types file is now stored in a configmap with a different
file created for each object store. This is primarily just a means to
get the mime.types file into the rgw pod, but the added benefit is that
the administrator can modify the configmap, which could reduce
susceptibility to file type execution vulnerabilities (worst case).

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-03-07 08:02:42 -07:00
Travis Nielsen a145f4dcb7 Merge pull request #2703 from travisn/osds-per-device-with-filter
Clean up provisioning of OSDs on devices
2019-03-04 07:58:56 -07:00
Blaine Gardner 4eb4fb7aa6 ceph mds: configure completely from operator
Configure the Ceph mds daemon completely from the operator a la the
recent changes to the Ceph mon and mgr operators.

Create the mds deployments first and then
create the keyring secrets for them with their owner reference as the
corresponding deployment. This will mean that the secrets do not need to
be micromanaged. When the deployment is deleted, the secret is also
deleted. This has not been necessary for the mons or the manager since
the mons share a keyring with a lifespan of the cluster, as does the
mgr, which currently has single-mgr support only.

Signed-off-by: Blaine Gardner <blaine.gardner@suse.com>
2019-02-28 12:31:43 -07:00
travisn bdc3cf8146 osd: fix the device filter and improve device provisioning reliability
All devices detected by the discovery pod were being passed to the OSD provisioning pod
thus not always honoring the desired device list that should be provisioned.
Now the provisioning pod will be given the desired state from the crd,
then apply that state depending on the actual devices detected.
Also added a helper to ensure OSDsPerDevice is always valid.

Signed-off-by: travisn <tnielsen@redhat.com>
2019-02-26 16:11:25 -07:00
Travis Nielsen eea375ece7 Merge pull request #2698 from darshanime/unhide_cobra
unhide cobra commands
2019-02-22 14:11:12 -07:00
darshanime f24230481f unhide cobra commands
Signed-off-by: darshanime <deathbullet@gmail.com>
2019-02-22 14:04:21 +05:30
Sébastien Han eb3c424d57 Ceph messengers 2 support
This commit introduces the necessary changes to support the new
messenger feature coming with Ceph Nautilus (currently in development).

What changes? Now the monitor listens on two port:

* old 6789 for messenger v1, which will help us support older client
(e,g: krbd)
* new 3300 for messengers v2, which brings new improvement in the
messaging layer. This new transport layer brings numerous advantages
such as encryption improvement, speed improvement, pluggable nature to
support different network stack than TCP and many more.

We still have one Service IP, however it has 2 ports, see:

```
NAME                      TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
rook-ceph-mon-a           ClusterIP   10.106.217.160   <none>        3300/TCP,6789/TCP   4h
rook-ceph-mon-b           ClusterIP   10.99.36.175     <none>        3300/TCP,6789/TCP   4h
rook-ceph-mon-c           ClusterIP   10.108.220.74    <none>        3300/TCP,6789/TCP   4h
````

The `ceph.conf` has changed and we don't force the port when using an IP
address (public addr etc). Ceph, depending on its version will naturally
start the monitors on their right port, 6789.

A new --ceph-version-name CLI argument has been added to the Rook binary
so that when the pod starts it passes the ceph version name and the
configuration of the ceph.conf, as well as daemon startup flags, happen
properly.

Given that the Rook Operator remembers the port of all the monitors it
deployed (through Pod definition), this change is not an issue and will
maintain backward compatibility.

Note that to test this you must build rook with dev container image,
which contains the dev Nautilus version. So you should do something
like:

`make -j4 BASEIMAGE='ceph/daemon-base:latest-master' IMAGES='ceph' build`

Resolves: #2525
Signed-off-by: Sébastien Han <seb@redhat.com>
2019-02-22 00:09:37 +01:00
Travis Nielsen 649f5977fc Merge pull request #2511 from humblec/final
This PR contains linter corrections on various sources.
2019-02-20 11:01:03 -07:00