Commit Graph
3964 Commits
Author SHA1 Message Date
Satoru Takeuchi 57eb4ae827 osd: support encrypted OSD on partiton
Let's use raw mode for encrypted OSD. This mode supports encrypted
OSD on partition.

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

Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
(cherry picked from commit 093125904b)
2023-09-20 22:32:19 +00:00
sp98 639b1ae25a osd: make osd pod to sleep when osds are flapping
When OSDs flap, ceph stops the OSD daemon if its marked down greater than
5 times in 600 seconds. But OSD pod restarts and marks the OSD `up` again.
This causes the PGs mapped to these OSDs to peer. While the PGs are peering,
IO to these PGs are blocked.

So we need to ensure that if ceph is marking OSD `down` due to flapping, OSD pod
should not restart to mark the OSDs `up` again.

This PR adds a sleep to the OSD pod if the container returned with a 0 exit code
Default behavior is to sleep for 6 hrs. But user can configure it from the
ceph cluster spec.

Signed-off-by: sp98 <sapillai@redhat.com>
(cherry picked from commit 4eb9f62205)
2023-09-15 18:24:50 +00:00
travisn 19ffd749e0 mgr: allow more than two mgrs
While two mgrs is considered sufficient, more mgr daemons are
now allowed in case the admin wants even more fault tolerance
to the active mgr going down, in case multiple mgrs go down.
Up to five mgr pods will be allowed. All mgrs will be in
standby mode except one active mgr. All mgr pods have a sidecar
that will update their respective pod specs with the active
or passive label.

Signed-off-by: travisn <tnielsen@redhat.com>
(cherry picked from commit 66547d27be)
2023-09-14 21:03:43 +00:00
Travis Nielsen 41004d8d2f Merge pull request #12831 from rook/mergify/bp/release-1.12/pr-12791
core: restart ceph daemons when network updated (backport #12791)
2023-09-12 16:23:59 -06:00
Matthew Penner 9744c97227 exporter: bind to all interfaces if IPv6 is enabled
Previously ceph-exporter would only bind to IPv4 interfaces. Now if the
CephCluster is configured with `dualStack: true` and/or `ipFamily: IPv6`
an additional flag (`--addrs ::`) will be added to the ceph-exporter
container to make it listen both IPv6 and IPv4 interfaces.

Signed-off-by: Matthew Penner <me@matthewp.io>
(cherry picked from commit d09a43df37)
2023-09-12 20:10:55 +00:00
Sebastian Hasler 38958ecce2 object: unique username for OBC even when preceding OBC was retained
For an OBC's name we cannot simply use the OBC's namespace and name,
because they can be reused, while the preceding bucket might be
retained by reclaimPolicy. (Commit 2733375ca4 also didn't solve
this issue, as it is an intra-cluster issue.) Therefore we instead
use the OBC's UID which should be unique within the cluster and
across clusters.

Signed-off-by: Sebastian Hasler <sebastian.hasler@stuvus.uni-stuttgart.de>
(cherry picked from commit 041fc1a71c)
2023-09-12 16:11:06 +00:00
Blaine Gardner 8b72dfa020 multus: detect network CIDRs via canary
Change how Rook detects network CIDRs for Multus networks. The IPAM
configuration is only defined as an arbitrary string JSON blob with a
"type" field and nothing more. Rook's detection of CIDRs for whereabouts
had already grown out of date since the initial implementation.
Additionally, Rook did not support DHCP IPAM, which is a reasonable
choice for users. And more, Rook did not support CNI plugin chaining,
which further complicates NADs. Based on the CNI spec, network chaning
can result in any changes to network CIDRs from the first-given plugin.

All these problems make it more and more difficult for Rook to support
Multus by inspecting the NAD itself to predict network CIDRs. Instead,
it is better for Rook to treat the CNI process as a black box. To
preserve legacy functionality of auto-detecting networks and to make
that as robust as possible, change to a canary-style architecture like
that used for Ceph mons, from which Rook will detect the network CIDRs
if possible.

Also allow users to specify overrides for CIDR ranges. This allows Rook
to still support esoteric and unexpected NAD or network configurations
where a CIDR range is not detectable or where the range detected would
be incomplete. Because it may be impossible for Rook to understand the
network CIDRs wholistically while residing only on a portion of the
network, this feature should have been present from Multus's inception.

Improving CIDR auto-detection and allowing users to specify overrides
for auto-detected CIDRs rounds out Rook's Multus support for CephCluster
(core/RADOS) installations. No further architectural changes should be
needed for CephClusters as regards application of public/cluster network
CIDRs for Multus networks.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
(cherry picked from commit 3c43268d0a)
2023-09-07 19:43:17 +00:00
Louis Bailleul e65e7bac12 operator: config default interval value for discovery daemon
Correctly set discoveryInterval default value by passing defaultDiscoverInterval to k8sutil.GetValue
Allow to set ROOK_DISCOVER_DEVICES_INTERVAL env var through discoveryDaemonInterval helm value

Signed-off-by: Louis Bailleul <louis.bailleul@pgs.com>
(cherry picked from commit e56122cbce)
2023-09-07 09:12:46 -06:00
subhamkrai 233e68ecbf operator: move most of discover pod setting to cm
It's better to move most of discover daemon setting
from env to configmap rook-ceph-operator-config.
Although, we are moving to configmap, we keep reading settings
from env but the priority will be configmap settings.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit fb39580067)
2023-09-07 14:15:55 +00:00
sp98 ba91dec40f osd: replace existing OSDs to use new store
This follow up the #12507
- fixes replacing of encrypted OSDs.
- Updates OSD status at the end of reconcile

Signed-off-by: sp98 <sapillai@redhat.com>
(cherry picked from commit 11b8d10a5a)
2023-09-05 14:58:43 +00:00
Travis Nielsen a4114f1292 Merge pull request #12830 from rook/mergify/bp/release-1.12/pr-12487
csi: enable csi-addons-side when crds are deployed (backport #12487)
2023-09-05 08:33:34 -06:00
Divyansh Kamboj b17df46f5e monitoring: set port for servicemonitor for ceph-exporter
ceph-exporter's ServiceMonitor and Service CRD contain different port
name, which results in no metrics being collected by prometheus.

this commit makes GetCephMonitor configurable, which we use to set
consistent port names in ServiceMonitor and Service for ceph-exporter.

Signed-off-by: Divyansh Kamboj <dkamboj@redhat.com>
(cherry picked from commit 708dd29a97)
2023-09-01 17:59:33 +00:00
subhamkrai 64fecc7564 core: restart ceph daemons when network updated
We need to restart all the ceph daemons whenever
cephCluster network settings are modified like
requiremsgr2, encryption and compression. This
required for Ceph to consider the new settings
it require new ceph daemons all over.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 29d2b6a071)
2023-09-01 14:43:26 +00:00
subhamkrai 0ad92bd4b8 csi: enable csi-addons-side when crds are deployed
when deploying csi, we'll check if csi-addons crds
are deployed we'll enable csi-addons sidecar by default.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit a755ec156a)
2023-09-01 13:24:40 +00:00
Jiffin Tony Thottan b1e2826708 object: avoid creating same bucket for two different OBC
If bucket exists for Provision(), then check whether user in the OBC and
owner of bucket are same.

Signed-off-by: Jiffin Tony Thottan <thottanjiffin@gmail.com>
(cherry picked from commit b39e813290)
2023-08-31 21:10:53 +00:00
go-bai 808cdf9c57 mon: typo in json tag of struct MonMap
The json tag in struct MonMap had a spelling error where "json" was incorrectly splled as "josn". This commit corrects the spelling to "json".

Signed-off-by: go-bai <599500688@qq.com>
(cherry picked from commit f4cfa95768)
2023-08-29 14:07:52 +00:00
Madhu Rajanna c71d5714f3 core: return valid CIDR ip
we need to return a valid CIDR IP
to get it fenced properly, the previously
returned one was like `10.63.0.5:0/32` which
is not a valid CIDR, removing `:0` to look like
proper IP CIDR.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit eb304a5073)
2023-08-28 14:35:32 +00:00
Travis Nielsen 71c151cca4 Merge pull request #12769 from rook/mergify/bp/release-1.12/pr-12724
csi: set ceph cluster as ControllerRef for holder ds (backport #12724)
2023-08-28 08:29:07 -06:00
travisn 3876561a44 object: allow creating an object user in different namespace
The object user was previously required to be created in the
same namespace as the object store and the cluster. Now,
the object user can be reconciled even in a different namespace
from the cluster and object store. The namespace would be specified
in the object user CR.

Signed-off-by: travisn <tnielsen@redhat.com>
(cherry picked from commit 2b1cc4c7b8)
2023-08-25 19:01:44 +00:00
travisn 17e3e68576 build: remove go modules under apis directory
The go package dependencies (go.mod and go.sum) were created
under the pkg/apis directory to simplify the dependencies for
other projects referencing the rook repo. The downside is that
the dependabot can no longer open a working and valid PR since
the bot is not aware of the go.mod and go.sum in the apis directory.

Since the reduction of dependencies for vault in #12455,
the list of extra dependencies is not quite so extensive.
We are putting effort into shrinking the dependency list instead
of using the modules files in the apis subdirectory.

Note that #12419 updated the dependencies for the latest controller
runtime which also increased the size of the modules
list in the pkgs subdirectory, which means the difference
in dependencies in the pkgs subdirectory is no longer
signficant anyway.

Signed-off-by: travisn <tnielsen@redhat.com>
(cherry picked from commit 1a4917de78)

# Conflicts:
#	.github/workflows/update_dependabot_bundler_pr.yml
2023-08-22 19:51:31 +00:00
Madhu Rajanna 8ce7c719d6 csi: set ceph cluster as ControllerRef for holder
Setting ceph cluster as the ControllerRef
for the holder daemonset set so that when
a ceph cluster is deleted the holder daemoset
will also gets deleted.

fixes: #12645

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit d7a4f0038c)
2023-08-22 13:42:03 +00:00
Travis Nielsen 77d398cb3e Merge pull request #12752 from rook/mergify/bp/release-1.12/pr-12507
Replace OSD to use new backend store (backport #12507)
2023-08-21 14:46:28 -06:00
sp98 84b7b68582 osd: replace osd to use new backend store
If osd store is updated in the ceph cluster, then
delete OSDs one by one, cleanup disks and provision a new OSD on
the same disk

Signed-off-by: sp98 <sapillai@redhat.com>
(cherry picked from commit 886bb357ef)
2023-08-17 18:42:52 +00:00
Deepika Upadhyay c174df9665 docs: amend for clarity on failureDomainLabel and VolumeClaimTemplate
Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
(cherry picked from commit 427c53786b)
2023-08-17 17:53:35 +00:00
Deepika Upadhyay 632bf12743 mon: update mon deployment
* fixes mon zonal deployment of 2 per zone to 1 if zones field is
  specified.
* adds zones field doc to CRDs Documentation.
* add code for picking up failureDomainLabel if specified for zones
  field in mon deployment

Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
(cherry picked from commit b67bf2d6f0)
2023-08-17 17:53:34 +00:00
Deepika Upadhyay 0e63059eb7 mon: fix some of the zonal storageclass support failures
Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
(cherry picked from commit 0d86588620)
2023-08-17 17:53:34 +00:00
Deepika Upadhyay c4ed09c3e6 mon: add failure domain label for zonal topology
Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
(cherry picked from commit 764f6597c0)
2023-08-17 17:53:33 +00:00
Deepika Upadhyay 46f29e7135 mon: add mon storage class support
if zones field is specified, deploy the mon based on the zone specified,
this will help with higher mon availability.

See also: https://github.com/rook/rook/pull/11407/

Signed-off-by: Deepika Upadhyay <deepika@koor.tech>
(cherry picked from commit 2231d73259)
2023-08-17 17:53:32 +00:00
Travis Nielsen 0b80329518 Merge pull request #12739 from rook/mergify/bp/release-1.12/pr-12679
operator: log op. config cm setting when changed (backport #12679)
2023-08-16 13:52:09 -06:00
subhamkrai b4e94f75cd ci: fix golangCI lint remove k8s.io/utils/pointer
golangci linter was throughing error `k8s.io/utils/pointer`
package is deprecated. So, I have removed that.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit a25071ac29)
2023-08-16 17:12:02 +00:00
subhamkrai 00b941be28 build: update vault and other indirect imports
update vault and other indirect imports. Also,
updating k8s package to `v0.28.0-rc.0` since with
v0.27.4 it was through build error.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit ab3763767f)
2023-08-16 17:12:01 +00:00
subhamkrai 835048a38d operator: log op. config cm setting when changed
earlier, we're always logging when `GetValue` method is
called to get operator config  values which somettime
spamming the logs for example `ROOK_WATCH_FOR_NODE_FAILURE`
keep logging every time 5 min.

Now, we'll store the settings in the map and log only when
map key value is changed.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 733be02577)
2023-08-16 17:10:36 +00:00
Madhu Rajanna 9260f4fe9f file: ignore exit code 22 when adding datapool
Ignore the exit code 22 when adding the
datapool to a filesystem.

updates: #12673

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit bd9b42d221)
2023-08-15 17:23:21 +00:00
Niels de Vos 6afe22a2f8 nfs: run dbus-daemon sidecar as dbus user instead of root
When the dbus-daemon in the sidecar is started as "root" user, it fails
with the following log entry:

Failed to start message bus: Failed to drop capabilities: Operation not permitted

By starting the sidecar as "dbus" user (uid=81), the executable does not
try to drop capabilities, and starts successfully.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
(cherry picked from commit 320b112cc6)
2023-08-11 19:43:14 +00:00
Travis Nielsen 17ad5fb962 Merge pull request #12685 from rook/mergify/bp/release-1.12/pr-12681
csi: add mode csi pods to the list to force delete pod (backport #12681)
2023-08-09 10:24:51 -06:00
karthik-us cc819f00df csi: add maxUnavailable for cephfs csi daemonset
Adding maxUnavailable parameter to the cephfs csi daemonset. The
default value of maxUnavailable = 1 can make the upgrade process
slower in environments with large number of nodes.

Fixes: #12636
Signed-off-by: karthik-us <ksubrahm@redhat.com>
(cherry picked from commit 2675c976d5)
2023-08-08 17:12:41 +00:00
Madhu Rajanna bba3e43f3c csi: add nfs pods to the list to delete pod
Add nfs pods label to the list so that Rook
can get all the pods on the failed node and
force delete the pods stuck in terminating state.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 29faca9032)
2023-08-08 17:11:39 +00:00
Madhu Rajanna bec26312cc csi: add holder pods to the list to delete pod
Add holder pods label to the list so that Rook
can get all the pods on the failed node and
force delete the pods stuck in terminating state.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 22bfc9de3d)
2023-08-08 17:11:38 +00:00
Travis Nielsen 927b628ed6 Merge pull request #12658 from rook/mergify/bp/release-1.12/pr-12561
mon: delete ParseMonEndpoints from mon package (backport #12561)
2023-08-04 10:54:25 -06:00
Lucas Henry 9cb7a51fef operator: fix formatting of some logger methods
Some logging instructions use formatting syntax `%q`, but the logging method is
`Info` or `Debug` instead of `Debugf` and `Infof`. As a result, the arguments of
the method were concatenated instead of formatted properly.

Signed-off-by: Lucas Henry <polyedre@disroot.org>
(cherry picked from commit c948183c0e)
2023-08-04 14:56:55 +00:00
Henry Davies 5ec9fb39b9 mon: delete ParseMonEndpoints from mon package
The function ParseMonEndpoints existed twice, once in the mon package
and once in the controller package. It has now been deleted from the
mon package. Usages in the mon package now reference the function
in the controller package.

Signed-off-by: Henry Davies <henrydavies@hotmail.co.uk>
(cherry picked from commit 2c8949e195)
2023-08-03 14:01:33 +00:00
Travis Nielsen 58b0f5f294 Merge pull request #12626 from rook/mergify/bp/release-1.12/pr-12501
osd: use cp -a command for copying init-containers binary (backport #12501)
2023-07-31 15:07:15 -06:00
parth-gr d237dff985 external: set RequireMsgr2 if v2 port is configured
Currently if we use the msgr2 port,
cs-cluster-config-json looks like
"monitors":["192.59.109.11:3300","192.59.109.13:6789","192.59.109.12:6789"]

The first monitor is passed by python script and rest are
Discovered by rook operator, so if the first mon is using the v2 port
lets update the other mons also by setting up the RequireMsgr2 flag

Signed-off-by: parth-gr <paarora@redhat.com>
(cherry picked from commit 2c4897f88c)
2023-07-31 19:21:43 +00:00
Sheetal Pamecha 7a19548091 osd: use cp -a command for copying init-containers
remove copy-binaries cmd and related code

Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
(cherry picked from commit d86fa2abbc)
2023-07-31 18:05:28 +00:00
Sachin Prabhu 22b4e5d7ea nfs: fix null pointer deref in generateSssdSidecarResources()
0a151e913 results in a bug which causes null pointer dereference when
Kerberos is not setup. This causes a failure in Unit test
TestReconcileCephNFS_addSecurityConfigsToPod

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
(cherry picked from commit 6cf4627ccd)
2023-07-28 13:57:55 +00:00
Travis Nielsen b3c3cfe389 Merge pull request #12587 from rook/mergify/bp/release-1.12/pr-12562
object: update ceph cosi driver image to v0.1.1 (backport #12562)
2023-07-27 12:46:48 -06:00
Blaine Gardner d81e8e6a12 Merge pull request #12590 from rook/mergify/bp/release-1.12/pr-12560
object: do not add objectstore endpoint to zone when sync is disabled (backport #12560)
2023-07-27 11:54:27 -06:00
Sachin Prabhu b63ac550d2 nfs: mount krb5.conf and krb5.keytab in the sssd container
This will enable us to use GSSAPI in sssd for authentication when
connecting to the remote LDAP server.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
(cherry picked from commit 0a151e913d)
2023-07-26 22:53:11 +00:00
Blaine Gardner d81d21367b Merge pull request #12588 from rook/mergify/bp/release-1.12/pr-12575
core: force delete rook-ceph-exporter pod (backport #12575)
2023-07-26 16:45:22 -06:00
subhamkrai 98f51c2514 core: node fencing, skip pv when pv is not backed by csi
when node fencing is triggered and a negative case where
one deployment pod consuming pv not provisioned by csi
and another deployment pod with rbd rwo are on the same
node and node fencing is triggered.

In this case rook operator panics since it is trigger to get
field `pv.Spec.CSI.Driver` which will be nil.

Also, skip static pv as there is no `imageName` in the spec
rbd status command will fail.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 72386eb1d0)
2023-07-26 16:45:01 +00:00