Commit Graph
7961 Commits
Author SHA1 Message Date
Nitin Goyal e3fffdc711 core: add eventutils in the k8sutil package
eventutils will allow operator to limit events count of same event
and prevents from spaming apiserver

Signed-off-by: Nitin Goyal <nigoyal@redhat.com>
2021-05-18 17:01:37 +05:30
Sébastien Han bcdc7f8616 docs: fix patch command
The JSON was invalid.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-18 10:26:55 +02:00
Sébastien Han f15bb5d480 Merge pull request #7919 from cybozu-go/remove-missing-field-in-crd
ceph: remove an missing field in crd
2021-05-18 10:10:17 +02:00
subhamkrai 9d8853d49a ci: add missing tag in master push images
tags are missing in master pushed images
to shallow problem. this commit add command
to unshallow.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-18 12:14:17 +05:30
Sébastien Han e368c3e389 Merge pull request #7546 from rohan47/multus_cluster_nw
ceph: support specifying only public network or only cluster network or both
2021-05-17 15:03:33 +02:00
rohan47 f3d2ae5405 ceph: support specifying only public network or only cluster network
With this change, the Rook ceph cluster can have only a public network or
only a cluster network or both can be specified. Prior to this commit if
only a public network was specified, it was copied to the cluster network.

Signed-off-by: rohan47 <rohgupta@redhat.com>
2021-05-17 17:54:08 +05:30
Satoru Takeuchi c2adbdd8a8 ceph: remove an missing field in crd
`CephObjectStore->gateway->type` is not used. Rook has only supported s3-like
interface and hasn't had no code which handles `type` field.

In addition, this field was removed from CRD in the following commit.

ceph: auto-gen crds
31db03fece

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-05-17 07:51:13 +00:00
Travis Nielsen 166ee6c1df Merge pull request #7911 from travisn/obsolete-rbac-setting
ceph: Remove obsolete operator setting for enabling rbac
2021-05-14 17:39:37 -06:00
Travis Nielsen 386801586d ceph: remove obsolete operator setting for enabling rbac
Enabling rbac is a legacy setting from way back when the operator
was creating the rbac internally, instead of declaring it explicitly
in the common.yaml. There is no need for this setting now.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-14 15:51:51 -06:00
Travis Nielsen 6a405b8070 Merge pull request #7898 from RyuunoAelia/fix_okd_operator_metadata
build: rook-ceph Operator deployment for OKD should be the same as OCP for it to work
2021-05-13 08:52:27 -06:00
Travis Nielsen 6ba6b1c3b1 Merge pull request #7886 from cybozu-go/ceph-fix-hostpath-of-osd-to-avoid-data-corruption
ceph: fix hostpath of osd to avoid data corruption
2021-05-13 08:49:24 -06:00
Diego Abelenda a58bc4982e build: okd operator metadata should be the same as OCP
Signed-off-by: Diego Abelenda <diego.abelenda@gmail.com>
2021-05-13 09:27:45 +02:00
Travis Nielsen 081e2fd9c8 Merge pull request #7884 from travisn/mon-failover-window
ceph: Persist expected mon endpoints immediately during mon failover
2021-05-12 10:42:28 -06:00
Travis Nielsen bb4191a8a7 ceph: persist expected mon endpoints immediately during mon failover
After mon failover is initiated, there was a time window where if the operator
was restarted, the new mon is started and has joined quorum, but the operator
does not believe the mon should be in quorum after the operator restart.
The operator was mistakenly removing the extra mon prematurely, sometimes
causing quorum to be lost if another mon was also down at the same time.
If the mon does not come back online, steps to recover quroum would need
to be followed from the disaster guide. Now the expected list of mons
will be updated immediately during mon failover if the operator successfully
created the new mon deployment, thus removing the window where restarting
the operator can cause quorum loss.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-12 09:44:04 -06:00
Sébastien Han ffd263c539 Merge pull request #7891 from leseb/wait-for-prom
ceph: wait for the prometheus module to be ready
2021-05-12 17:22:45 +02:00
Sébastien Han 866fc0a590 Merge pull request #7889 from leseb/fix-7842
ceph: do not overwrite the probe handler
2021-05-12 16:58:55 +02:00
Travis Nielsen 11adc1b2bf Merge pull request #7887 from subhamkrai/restrict-fork-build
ci: restrict push image build action to run on fork
2021-05-12 08:37:25 -06:00
Sébastien Han cc763df671 ceph: wait for the prometheus module to be ready
Before running the external script test let's make sure the prometheus
exporter is loaded. We often see in the CI errors like:

```
  kubectl -n rook-ceph exec $(kubectl get pod -l app=rook-ceph-tools -n rook-ceph -o jsonpath='{.items[0].metadata.name}') -- python3 /etc/ceph/create-external-cluster-resources.py --rbd-data-pool-name replicapool
  shell: /bin/bash -e {0}
  env:
    GOROOT: /opt/hostedtoolcache/go/1.16.4/x64
    MINIKUBE_HOME: /home/runner/work/_temp
Execution Failed: unable to connect to endpoint: 172.17.0.10:9283
Traceback (most recent call last):
  File "/etc/ceph/create-external-cluster-resources.py", line 801, in <module>
    raise err
  File "/etc/ceph/create-external-cluster-resources.py", line 798, in <module>
    rjObj.main()
  File "/etc/ceph/create-external-cluster-resources.py", line 779, in main
    generated_output = self.gen_json_out()
  File "/etc/ceph/create-external-cluster-resources.py", line 613, in gen_json_out
    self._gen_output_map()
  File "/etc/ceph/create-external-cluster-resources.py", line 598, in _gen_output_map
    self.out_map['MONITORING_ENDPOINT_PORT'] = self.get_active_and_standby_mgrs()
  File "/etc/ceph/create-external-cluster-resources.py", line 389, in get_active_and_standby_mgrs
    self.endpoint_dial(monitoring_endpoint)
  File "/etc/ceph/create-external-cluster-resources.py", line 245, in endpoint_dial
    "unable to connect to endpoint: {}".format(endpoint_str))
__main__.ExecutionFailureException: unable to connect to endpoint: 172.17.0.10:9283
command terminated with exit code 1
```

but then when we log into the runner, we can see the command works.
So let's wait a little bit for the module to be up.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-12 14:59:57 +02:00
Sébastien Han 266a359a0e ceph: do not overwrite the probe handler
Changing the livenessprobe handler is not possible anymore for the
simple reason that it does not make sense. Practicly speaking we just
cannot change its value since it is propapaged to all the daemons. The
exec handler contains the socket name of the daemon, because daemons
have different names we cannot possibly make it generic since it will
apply to all.

Closes: https://github.com/rook/rook/issues/7842
Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-12 14:06:24 +02:00
Sébastien Han e06c36dbc9 Merge pull request #7875 from leseb/external-active-mgr-change
ceph: actively update the service endpoint for external mgr
2021-05-12 09:15:34 +02:00
subhamkrai e0206c56d5 ci: restrict push image build action to run on fork
this commit restrict push image build action to run on
fork repo.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-12 12:23:11 +05:30
Satoru Takeuchi 6af014b798 ceph: fix hostpath of osd to avoid data corruption
A directory is created under dataDirHostPath for each OSD. In host-based cluster,
its name is constructed from kernel device name like _dev_sdb though user specifies
udev persistent device name. We should use unique name among all OSDs.

Closes: https://github.com/rook/rook/issues/7878

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
2021-05-12 01:31:46 +00:00
Sébastien Han 4f63e88ad5 Merge pull request #7877 from Rakshith-R/cleanup/csi-sts-dep
ceph: remove redundant csi statefulset template path vars
2021-05-11 18:00:57 +02:00
Sébastien Han 0bdbb944bf ceph: simplify external mode setup
The preparation script does not require any manual inputs anymore. The
cluster/examples/kubernetes/ceph/create-external-cluster-resources.sh
will create and set the env variable needed for the import script.
Hopefully this will reduce the friction in some installation, especially
for the mon ports.

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-11 16:08:46 +02:00
Sébastien Han 5e1e9f4c92 ceph: actively update the service endpoint for external mgr
If the cluster is external we want to periodically rehydrate the mgr
endpoint. This handles the scenarion where the active manager changes,
 so we need to update the endpoint with the new IP address.
The create-external-cluster-resources.py script now requires an extra
permission to query the manager service so Rook can discover the active
one and its IP.

Testing:

```
[leseb@tarox~/go/src/github.com/rook/rook][external-active-mgr-change] minikube kubectl -- exec -n rook-ceph deploy/rook-ceph-tools -ti -- ceph mgr stat
{
    "epoch": 37,
    "available": true,
    "active_name": "b",
    "num_standby": 1
}

[leseb@tarox~/go/src/github.com/rook/rook][external-active-mgr-change] kubectl -n rook-ceph-external get ep
NAME                     ENDPOINTS          AGE
rook-ceph-mgr-external   172.17.0.12:9283   3m10s

[leseb@tarox~/go/src/github.com/rook/rook][external-active-mgr-change] k scale --replicas=0 deployment rook-ceph-mgr-b
deployment.apps/rook-ceph-mgr-b scaled

[leseb@tarox~/go/src/github.com/rook/rook][external-active-mgr-change] minikube kubectl -- exec -n rook-ceph deploy/rook-ceph-tools -ti -- ceph mgr stat
{
    "epoch": 40,
    "available": true,
    "active_name": "a",
    "num_standby": 0
}

[leseb@tarox~/go/src/github.com/rook/rook][external-active-mgr-change] kubectl -n rook-ceph-external get ep
NAME                     ENDPOINTS          AGE
rook-ceph-mgr-external   172.17.0.13:9283   3m55s
```

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-11 16:08:40 +02:00
Travis Nielsen 169b225be5 Merge pull request #7867 from subhamkrai/crash-collector
ceph: create crash collector pods after secret created
2021-05-11 07:18:42 -06:00
Sébastien Han 87154dfe9c Merge pull request #7726 from sp98/pdb-controller-changes
ceph: update podDisruptionBudget controller for OSD
2021-05-11 15:02:22 +02:00
subhamkrai b4efd9f8f4 ceph: create crash collector pods after secret created
there was confusion regarding crash collector pods
in pending state which was basically due to secret
`rook-ceph-crash-collector-keyring` was not created
till mons are in quorum. this commit creates crash
collector pods after secret `rook-ceph-crash-collector-keyring`
is created.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-11 17:52:38 +05:30
Rakshith R e9f0136b13 ceph: remove redundant csi statefulset template path vars
This commit removes redundant `RBDProvisionerSTSTemplatePath` and
`CephFSProvisionerSTSTemplatePath` variables which were forgetten to
be removed in https://github.com/rook/rook/pull/5982 when csi support
for k8s 1.13 was removed.

Signed-off-by: Rakshith R <rar@redhat.com>
2021-05-11 14:36:15 +05:30
Sébastien Han 04a226ce52 Merge pull request #7847 from leseb/rm-log-file
ceph: allow heap dump generation when logCollector is not running
2021-05-10 17:42:55 +02:00
Sébastien Han 19de2b28e9 ceph: allow heap dump generation when logCollector is not running
We don't need to set log_file to empty string since "log_to_file" is set
to False. This is probably an old leftover/hack we were doing in the
past when "log_to_file" and other related options were not there.

Because of this line
https://github.com/ceph/ceph/blob/master/src/perfglue/heap_profiler.cc#L99,
Ceph looks for the log_file conf option. In our case it was empty, so
the logging would default to the current directory which points to the
container runtime root when not set and we don't have permission to
write there.

We now force it to Ceph's default so that existing cluster will get the
fix after upgrading.

Just removing the option allows us to get dump in /var/log/ceph.
Phew, what a bug!

Signed-off-by: Sébastien Han <seb@redhat.com>
2021-05-10 17:21:04 +02:00
Sébastien Han 18f5f77a27 Merge pull request #7863 from Rakshith-R/cleanup-snap
ceph: remove redundant comment in cephfs snapshotclass.yaml
2021-05-10 09:46:15 +02:00
Sébastien Han 88e7266bde Merge pull request #7857 from travisn/gateway-schema
ceph: Add nullable to object gateway settings
2021-05-10 09:44:16 +02:00
Santosh Pillai aee8f56853 ceph: update podDisruptionBudget controller for OSD
This PR has following changes around OSD pdbs
- Detect node drains more reliably. When OSD is down and OSD pod is not scheduled to any node or if the scheduled node is not ready, then assume that node is draining.
- Don't set no-out flag on the failure domain if the OSD is down due to reasons other than node drain (say disk failure)
- update unit tests
- update design doc to reflect above changes

Signed-off-by: Santosh Pillai <sapillai@redhat.com>
2021-05-10 12:59:40 +05:30
Rakshith R eae135a0b0 ceph: remove redundant comment in cephfs snapshotclass
This commit removes `# apiVersion: snapshot.storage.k8s.io/v1alpha1`
line in cephfs snapshotclass.yaml which was introduced in PR 7711 by mistake.

Signed-off-by: Rakshith R <rar@redhat.com>
2021-05-10 10:52:39 +05:30
Travis Nielsen 65bffb4360 ceph: add nullable to object gateway settings
In some clusters, the schema validation is failing for the default
object.yaml example that the value must be of a type string null.
While the null value shouldnt be strictly needed, we need working
examples by default.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-07 10:22:33 -06:00
Travis Nielsen 4b06cf6155 Merge pull request #7856 from subhamkrai/add-ssh
ci: update action api token
2021-05-06 23:57:08 -06:00
subhamkrai f988e2e517 ci: update action api token
this commit update the api token
to use correct secret.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-07 11:24:15 +05:30
Travis Nielsen bab71a1312 Merge pull request #7855 from subhamkrai/file-perm
ci: right permission to build script
2021-05-06 19:52:21 -06:00
subhamkrai 4d66b7067b ci: right permission to build script
master build are failing due to bad
permission on build script. this
commit giv +rxw permission to the file.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-07 06:57:08 +05:30
Travis Nielsen 4bf03f86ca Merge pull request #7850 from travisn/multicluster-test-cleanup
ceph: Multicluster test cleanup of external cluster first
2021-05-06 15:25:19 -06:00
Travis Nielsen 5a8b8c7217 ceph: run ceph tests in jenkins if requested
If the [test ceph] text is included in the PR description,
go ahead and run the ceph tests in Jenkins instead of always
skipping them

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-06 14:51:07 -06:00
Travis Nielsen 2b2a1f66c4 ceph: multicluster test cleanup of external cluster first
The multicluster test was never removing the finalizer of the external
cluster since the core cluster was being removed first. Now we remove
the external cluster first to ensure the finalizer will be removed
properly instead of forcefully by the test.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-06 14:51:07 -06:00
Travis Nielsen 795cfbd37f Merge pull request #7849 from travisn/publish-aws-region
build: Include aws region when publishing build
2021-05-06 13:19:05 -06:00
Travis Nielsen 6b27cdd2fb build: include aws region when publishing build
For the github action to publish the build to aws, we also need to
include the aws-region setting in the action settings.

Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
2021-05-06 12:23:38 -06:00
Travis Nielsen 33d784d937 Merge pull request #7526 from parth-gr/operator-debug-logs
core: enhancement in debug logs
2021-05-06 10:41:28 -06:00
Travis Nielsen f6ae92f78a Merge pull request #7807 from synarete/osd-primary-affinity
ceph: allow setting primary-affinity to osd
2021-05-06 10:18:39 -06:00
Shachar Sharon 2a3cfc693b ceph: allow setting primary-affinity to osd
A user with unbalanced system (e.g., some OSDs use a partition which
resides on a device along-side OS partition) may want to have a
fine-grained control on the overall load of specific OSD. While osd
weight affects write-load, primary-affinity affects read-load.

This patch allow user to define osd's primary-affinity (similar to
'DeviceClass' and 'InitialWeight'), which is sent to the osd (via mon)
as part of deployment sequence, using 'ceph osd primary-affinity' command.

Valid values are within the range [0.0, 1.0). If not set, default value
is 1.

ROOK issue: https://github.com/rook/rook/issues/7773

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
2021-05-06 17:46:15 +03:00
Sébastien Han ae5cc49deb Merge pull request #6667 from subhamkrai/docker-gh
ci: push build images to Docker hub
2021-05-06 15:14:44 +02:00
subhamkrai 4683254419 ci: push build images to Docker hub using gh action
We are moving towards github action.
This commit allows pushing build images
to Docker hub using gh action for master
build similar to what Jenkins does.

And, also removing `Publish if Master` step
from the Jenkinsfil file.

Signed-off-by: subhamkrai <srai@redhat.com>
2021-05-06 12:45:24 +05:30