Wait for the mon-canary pods to be terminated before starting the actual
mons. When topology spread constraints are added to evenly spread the
mons, then pod-anti affinity does not allow mons to be created on the
same node where other mons are running, this also includes the
mon-canary pods. We delete the mon-canary pods and then start the actual
mon pods. Sometimes the termination of the canary pods might take more
time, so schedular won't schedular mon pods on that node.
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
The mon canary should quickly shut down after the pod is
deleted, since it has no purpose to continue running.
Since the sleep does not catch the SIGTERM as pid 1,
use a bash trap to exit quickly.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
The OSDs may require different resources based on their device
class. The overall osd resources were only being used, rather
than properly looking up the specific device class resources.
Now the expected resources will take affect per device class.
Co-authored-by: Matthias Osthues <osthues.matthias@gmail.com>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
k8s requires the endpointSlice must have label
`kubernetes.io/service-name` to be associated with
service. Without this label, the k8s service controller
can't link the EndpointSlice to the service.
Signed-off-by: subhamkrai <srai@redhat.com>
The target size ratio is currently always being set to 0, when
neither the legacy targetSizeRatio nor the parameter for
target_size_ratio are set. In this case, we should not set it to 0,
but rather should skip the command to set the target size ratio.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
When OSDs start, init containers attempt to get the latest CephX key for
the OSD to allow OSDs to potentially continue working after key rotation.
However, in Ceph corner cases, mons could be unavailable while OSDs
could still be viable with existing on-disk keys. Since key rotation is
a rare event, it's likely that the on-disk keys are still good.
The worst case scenario is that key updates were needed but didn't
succeed in init containers. In this case, instead of the init container
failing, the OSD startup will fail instead. Thus, this should introduce
no extra risk but merely shift the failure to a different container.
Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
external mode was dependednt on the ceph status to
update the cluster connected condition,
BUt as now the status check will only update the ceph status,
so we will explicitly update the ceph status condition in the
end of the reconcile
Signed-off-by: parth-gr <partharora1010@gmail.com>
currently the health checkup was reporting the
condition and reason to be always connected,
But which might not be the case,
So instead of that dont report the condition and
its phase during the health checkups
Signed-off-by: parth-gr <partharora1010@gmail.com>
if there a bit long to update osds in parallel,
we need to timeout and abort the synchronous loop
and start the cluster reconcile again from the beginning
Signed-off-by: parth-gr <partharora1010@gmail.com>
currently we are updating the mon endpoints
and using it with rook-ceph-csi cm,
But we need latest ports in the cluster info,
during the creation of the ceph connection cr
when csi operator is enabled,
so ceph connection cr can use the latest mons ports
Signed-off-by: parth-gr <partharora1010@gmail.com>
This change introduces support for setting the ceph cache memory limit
ratios that were previously hardcoded.
Codegen was drivey-by updated as the current version errored.
Resolves#16551
Signed-off-by: Tim Buchwaldt <tim.buchwaldt@deepl.com>
The csi volumes and volume mount settings are now
converted to the csi operator driver CR, for example
to allow nix os mounts to be applied to the csi
node plugins.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
This is a fix/workaround to set the Recreate
deployment strategy as default in Rook as
its long proven working without any problem.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
currently, labels are not passed to csi-operator but
for csi-driver lables works as expected. This commit
add changes to add labels on csi-operator driver pod as well.
Signed-off-by: subhamkrai <srai@redhat.com>
CephCSI will remove the livess sidecar
container functionality as it was created
very long back and it should be replaced with
kubernetes GRPC livessness problem.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
we are now adding tentacle to the supported versions and add the
upgrade test from squid to tentacle. Also, clean some unused code.
Signed-off-by: subhamkrai <srai@redhat.com>
If the drained node is added back and one or more others nodes are down
update the blocking pdbs, that is, add blocking pdb to node that was
just added back.
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
The dependency blocking unit test was failing with the latest
library updates due to change in behavior that the garbage
collector is not actually deleting the cluster CR after
the dependencies are cleaned up. Instead, check that the
condition indicates the resource has no dependencies remaining.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
If the CephCluster spec is updated before the prevalidation check, then
Cluster.context still refers to the cancelled context of the operator.
This PR just updates the cluster context to use the latest operator
context.
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
shouldFailoverMonImmediately has a nil pointer exception with mons on
PVC. Rook-ceph-mon-endpoint does not store node information of the mons
on PVC. So `mapping.Hostname` throws nill pointer
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
currently the extraction ipv6 was not correct
used the net package to extract the host ip from
the ipadress
Signed-off-by: parth-gr <partharora1010@gmail.com>
Currently, when there are down OSDs but all PGs are clean we add the
number of downed OSDs ot the main PDB maxUnavailable. For example if
OSDs 1,3,5 are down and all PGs are clean we create the following PDB:
```yaml
maxUnavailable: 4
selector:
matchLabels:
app: rook-ceph-osd
```
This is potentially dangerous as there can be race conditions which can
break the cluster, for example:
1. A new node is added to the cluster with 4 OSDs
2. Those OSDs are down as they have not started up and joined the cluster yet
3. All PGs are healthy as the new OSDs haven't started yet and they are new
4. The rook operator sets maxUnavailable to 5 on the OSD PDB
5. The new OSDs move from down to up as they start
6. Something in the cluster starts a disruption (eviction request)
7. Any 5 OSDs can be disrupted as maxUnavilable is still 5 and the downed OSDs are now up
8. If the 5 disrupted OSDs contain all the replicas of a PG it will cause the PG to go down
To better protect from this scenario, we can instead exclude the downed
OSDs from the main PDB instead of adding to maxUnavailable.
```yaml
maxUnavailable: 1
selector:
matchExpressions:
- key: app
operator: In
values: ["rook-ceph-osd"]
- key: osd
operator: NotIn
values: ["1", "3", "5"]
```
This allows drains to still process when there are downed OSDs and PGs
are clean without allowing the non-downed OSDs to be disrupted.
Signed-off-by: Elias Carter <elias@dropbox.com>
The ceph csi controller plugin did not have the capability to
set host networking, in case the host networking is being enforced
with ROOK_ENFORCE_HOST_NETWORK: true.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>