Merge pull request #10606 from rook/mergify/bp/release-1.9/pr-10484
core: fix spelling (backport #10484)
This commit is contained in:
90 files changed
+157
-158
No files matched your search
+1
-1
@@ -31,7 +31,7 @@ to share the details of their usage publicly at this time.
|
||||
to accelerate the growth of the Canadian Information and Communications Technology (ICT) sector.
|
||||
The Rook Ceph operator is key to the Kubernetes clusters frequently set up for projects by
|
||||
small-medium enterprises in the CENGN labs.
|
||||
* [Avisi](https://www.avisi.nl/) develops and operates software for organizations like the the Dutch
|
||||
* [Avisi](https://www.avisi.nl/) develops and operates software for organizations like the Dutch
|
||||
Notary Association. They have survived multiple disaster scenarios already with Rook and it has
|
||||
made their cloud native journey in the private cloud so much easier by providing a powerful tool
|
||||
that lets them take advantage of a mature storage product with ease and peace of mind.
|
||||
|
||||
@@ -16,7 +16,7 @@ docs](https://docs.ceph.com/en/latest/man/8/rbd/)
|
||||
|
||||
Having multiple namespaces in a pool would allow multiple Kubernetes clusters
|
||||
to share one unique ceph cluster without creating a pool per kubernetes cluster
|
||||
and it will also allow to have tenant isolation between multiple tenenats in a
|
||||
and it will also allow to have tenant isolation between multiple tenants in a
|
||||
single Kubernetes cluster without creating multiple pools for tenants.
|
||||
|
||||
Rook allows creation of Ceph BlockPool
|
||||
|
||||
@@ -7,7 +7,7 @@ For more information about user management and capabilities see the [Ceph docs](
|
||||
|
||||
## Use Case
|
||||
|
||||
Use Client CRD in case you want to integrate Rook with with applications that are using LibRBD directly.
|
||||
Use Client CRD in case you want to integrate Rook with applications that are using LibRBD directly.
|
||||
For example for OpenStack deployment with Ceph backend use Client CRD to create OpenStack services users.
|
||||
|
||||
The Client CRD is not needed for Flex or CSI driver users. The drivers create the needed users automatically.
|
||||
|
||||
@@ -36,7 +36,7 @@ Rook allows an even number of mons for higher durability. See the [disaster reco
|
||||
|
||||
The number of mons to create in a cluster depends on your tolerance for losing a node. If you have 1 mon zero nodes can be lost
|
||||
to maintain quorum. With 3 mons one node can be lost, and with 5 mons two nodes can be lost. Because the Rook operator will automatically
|
||||
start a new new monitor if one dies, you typically only need three mons. The more mons you have, the more overhead there will be to make
|
||||
start a new monitor if one dies, you typically only need three mons. The more mons you have, the more overhead there will be to make
|
||||
a change to the cluster, which could become a performance issue in a large cluster.
|
||||
|
||||
## Mitigating Monitor Failure
|
||||
|
||||
@@ -12,7 +12,7 @@ There are three CSI drivers integrated with Rook that will enable different scen
|
||||
pods, or the exports can be mounted directly via an NFS client from inside or outside the
|
||||
Kubernetes cluster. [More information](../../CRDs/ceph-nfs-crd.md#ceph-csi-nfs-provisioner-and-nfs-csi-driver).
|
||||
|
||||
The Ceph Filesysetem (CephFS) and RADOS Block Device (RBD) drivers are enabled automatically with
|
||||
The Ceph Filesystem (CephFS) and RADOS Block Device (RBD) drivers are enabled automatically with
|
||||
the Rook operator. The NFS driver is disabled by default. All drivers will be started in the same
|
||||
namespace as the operator when the first CephCluster CR is created.
|
||||
|
||||
|
||||
@@ -240,7 +240,7 @@ a service and service monitor.
|
||||
kubectl create -f csi-metrics-service-monitor.yaml
|
||||
```
|
||||
|
||||
This will create the service monitor to have promethues monitor CSI
|
||||
This will create the service monitor to have prometheus monitor CSI
|
||||
|
||||
### Collecting RBD per-image IO statistics
|
||||
|
||||
@@ -290,6 +290,6 @@ spec:
|
||||
serverAddress: http://rook-prometheus.rook-ceph.svc:9090
|
||||
metricName: collecting_ceph_rgw_put
|
||||
query: |
|
||||
sum(rate(ceph_rgw_put[2m])) # promethues query used for autoscaling
|
||||
sum(rate(ceph_rgw_put[2m])) # prometheus query used for autoscaling
|
||||
threshold: "90"
|
||||
```
|
||||
@@ -8,7 +8,7 @@ Rook supports the creation of new buckets and access to existing buckets via two
|
||||
* an `Object Bucket (OB)` is a custom resource automatically generated when a bucket is provisioned. It is a global resource, typically not visible to non-admin users, and contains information specific to the bucket. It is described by an OB CRD, also shown below.
|
||||
|
||||
An OBC references a storage class which is created by an administrator. The storage class defines whether the bucket requested is a new bucket or an existing bucket. It also defines the bucket retention policy.
|
||||
Users request a new or existing bucket by creating an OBC which is shown below. The ceph provisioner detects the OBC and creates a new bucket or grants access to an existing bucket, depending the the storage class referenced in the OBC. It also generates a Secret which provides credentials to access the bucket, and a ConfigMap which contains the bucket's endpoint. Application pods consume the information in the Secret and ConfigMap to access the bucket. Please note that to make provisioner watch the cluster namespace only you need to set `ROOK_OBC_WATCH_OPERATOR_NAMESPACE` to `true` in the operator manifest, otherwise it watches all namespaces.
|
||||
Users request a new or existing bucket by creating an OBC which is shown below. The ceph provisioner detects the OBC and creates a new bucket or grants access to an existing bucket, depending the storage class referenced in the OBC. It also generates a Secret which provides credentials to access the bucket, and a ConfigMap which contains the bucket's endpoint. Application pods consume the information in the Secret and ConfigMap to access the bucket. Please note that to make provisioner watch the cluster namespace only you need to set `ROOK_OBC_WATCH_OPERATOR_NAMESPACE` to `true` in the operator manifest, otherwise it watches all namespaces.
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ kubectl create -f realm-a-keys.yaml
|
||||
Once the admin knows the endpoint and the secret for the keys has been created, the admin should create:
|
||||
|
||||
1. A [CephObjectRealm](../../CRDs/Object-Storage/ceph-object-multisite-crd.md#object-realm-settings) matching to the realm on the other Ceph cluster, with an endpoint as described above.
|
||||
1. A [CephObjectZoneGroup](../../CRDs/Object-Storage/ceph-object-multisite-crd.md#object-zone-group-settings) matching the master zone group name or the master CephObjectZoneGroup from the cluster the the realm was pulled from.
|
||||
1. A [CephObjectZoneGroup](../../CRDs/Object-Storage/ceph-object-multisite-crd.md#object-zone-group-settings) matching the master zone group name or the master CephObjectZoneGroup from the cluster the realm was pulled from.
|
||||
1. A [CephObjectZone](../../CRDs/Object-Storage/ceph-object-multisite-crd.md#object-zone-settings) referring to the CephObjectZoneGroup created above.
|
||||
1. A CephObjectStore referring to the new CephObjectZone resource.
|
||||
|
||||
|
||||
@@ -364,6 +364,6 @@ kubectl -n rook-ceph get secret rook-ceph-object-user-my-store-my-user -o jsonpa
|
||||
|
||||
Multisite is a feature of Ceph that allows object stores to replicate its data over multiple Ceph clusters.
|
||||
|
||||
Multisite also allows object stores to be independent and isloated from other object stores in a cluster.
|
||||
Multisite also allows object stores to be independent and isolated from other object stores in a cluster.
|
||||
|
||||
For more information on multisite please read the [ceph multisite overview](ceph-object-multisite.md) for how to run it.
|
||||
@@ -648,7 +648,7 @@ workaround are still at risk for OSD failures in the future.
|
||||
|
||||
To resolve the issue, immediately update to v1.6.8 or higher. After the update, no corruption should
|
||||
occur on OSDs created in the future. Next, to get back to a healthy Ceph cluster state, focus on one
|
||||
corruped disk at a time and [remove all OSDs on each corrupted disk](../Storage-Configuration/Advanced/ceph-osd-mgmt.md#remove-an-osd)
|
||||
corrupted disk at a time and [remove all OSDs on each corrupted disk](../Storage-Configuration/Advanced/ceph-osd-mgmt.md#remove-an-osd)
|
||||
one disk at a time.
|
||||
|
||||
As an example, you may have `/dev/sdb` with two unexpected partitions (`/dev/sdb2` and `/dev/sdb3`)
|
||||
@@ -665,7 +665,7 @@ as well as a second corrupted disk `/dev/sde` with one unexpected partition (`/d
|
||||
See [the teardown document](../Storage-Configuration/ceph-teardown.md#zapping-devices) for details.
|
||||
4. After this, scale up the Rook operator to deploy a new OSD to `/dev/sdb`. This will allow Ceph to
|
||||
use `/dev/sdb` for data recovery and replication while the next OSDs are removed.
|
||||
5. Now Repeat steps 1-4 for `/dev/sde` and `/dev/sde2`, and continue for any other corruped disks.
|
||||
5. Now Repeat steps 1-4 for `/dev/sde` and `/dev/sde2`, and continue for any other corrupted disks.
|
||||
|
||||
If your Rook-Ceph cluster does not have any critical data stored in it, it may be simpler to
|
||||
uninstall Rook completely and redeploy with v1.6.8 or higher.
|
||||
|
||||
@@ -301,7 +301,7 @@ The external-attacher is a sidecar container that attaches volumes to nodes by c
|
||||
running in Kubernetes controller-manager does not have any direct interfaces to CSI drivers. More details can
|
||||
be found [here](https://github.com/kubernetes-csi/external-attacher).
|
||||
|
||||
If any issue exists in attaching the PVC to the application pod first check the volumettachment object created
|
||||
If any issue exists in attaching the PVC to the application pod first check the volumeattachment object created
|
||||
and also log from csi-attacher sidecar container in provisioner pod.
|
||||
|
||||
```console
|
||||
|
||||
@@ -11,7 +11,7 @@ For common issues specific to Ceph, see the [Ceph Common Issues](ceph-common-iss
|
||||
|
||||
## Troubleshooting Techniques
|
||||
|
||||
Kubernetes status and logs are the the main resources needed to investigate issues in any Rook cluster.
|
||||
Kubernetes status and logs are the main resources needed to investigate issues in any Rook cluster.
|
||||
|
||||
## Kubernetes Tools
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ title: Ceph Upgrades
|
||||
This guide will walk you through the steps to upgrade the version of Ceph in a Rook cluster.
|
||||
Rook and Ceph upgrades are designed to ensure data remains available even while
|
||||
the upgrade is proceeding. Rook will perform the upgrades in a rolling fashion
|
||||
such that application pods are are not disrupted.
|
||||
such that application pods are not disrupted.
|
||||
|
||||
Rook is cautious when performing upgrades. When an upgrade is requested (the Ceph image has been
|
||||
updated in the CR), Rook will go through all the daemons one by one and will individually perform
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Health Verification
|
||||
|
||||
Rook and Ceph upgrades are designed to ensure data remains available even while
|
||||
the upgrade is proceeding. Rook will perform the upgrades in a rolling fashion
|
||||
such that application pods are are not disrupted. To ensure the upgrades are
|
||||
such that application pods are not disrupted. To ensure the upgrades are
|
||||
seamless, it is important to begin the upgrades with Ceph in a fully healthy state.
|
||||
Let's first review some ways that you can verify the health of your cluster.
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ cephClusterSpec:
|
||||
|
||||
# WaitTimeoutForHealthyOSDInMinutes defines the time (in minutes) the operator would wait before an OSD can be stopped for upgrade or restart.
|
||||
# If the timeout exceeds and OSD is not ok to stop, then the operator would skip upgrade for the current OSD and proceed with the next one
|
||||
# if `continueUpgradeAfterChecksEvenIfNotHealthy` is `false`. If `continueUpgradeAfterChecksEvenIfNotHealthy` is `true`, then opertor would
|
||||
# if `continueUpgradeAfterChecksEvenIfNotHealthy` is `false`. If `continueUpgradeAfterChecksEvenIfNotHealthy` is `true`, then operator would
|
||||
# continue with the upgrade of an OSD even if its not ok to stop after the timeout. This timeout won't be applied if `skipUpgradeChecks` is `true`.
|
||||
# The default wait timeout is 10 minutes.
|
||||
waitTimeoutForHealthyOSDInMinutes: 10
|
||||
|
||||
@@ -322,7 +322,7 @@ csi:
|
||||
memory: 1Gi
|
||||
cpu: 500m
|
||||
|
||||
# Set provisonerTolerations and provisionerNodeAffinity for provisioner pod.
|
||||
# Set provisionerTolerations and provisionerNodeAffinity for provisioner pod.
|
||||
# The CSI provisioner would be best to start on the same nodes as other ceph daemons.
|
||||
# provisionerTolerations:
|
||||
# - key: key
|
||||
|
||||
@@ -39,7 +39,7 @@ spec:
|
||||
continueUpgradeAfterChecksEvenIfNotHealthy: false
|
||||
# WaitTimeoutForHealthyOSDInMinutes defines the time (in minutes) the operator would wait before an OSD can be stopped for upgrade or restart.
|
||||
# If the timeout exceeds and OSD is not ok to stop, then the operator would skip upgrade for the current OSD and proceed with the next one
|
||||
# if `continueUpgradeAfterChecksEvenIfNotHealthy` is `false`. If `continueUpgradeAfterChecksEvenIfNotHealthy` is `true`, then opertor would
|
||||
# if `continueUpgradeAfterChecksEvenIfNotHealthy` is `false`. If `continueUpgradeAfterChecksEvenIfNotHealthy` is `true`, then operator would
|
||||
# continue with the upgrade of an OSD even if its not ok to stop after the timeout. This timeout won't be applied if `skipUpgradeChecks` is `true`.
|
||||
# The default wait timeout is 10 minutes.
|
||||
waitTimeoutForHealthyOSDInMinutes: 10
|
||||
|
||||
@@ -665,9 +665,9 @@ class RadosJSON:
|
||||
def _join_host_port(self, endpoint, port):
|
||||
port = "{}".format(port)
|
||||
# regex to check the given endpoint is enclosed in square brackets
|
||||
ipv6_regx = re.compile(r"^\[[^]]*\]$")
|
||||
ipv6_regex = re.compile(r"^\[[^]]*\]$")
|
||||
# endpoint has ':' in it and if not (already) enclosed in square brackets
|
||||
if endpoint.count(":") and not ipv6_regx.match(endpoint):
|
||||
if endpoint.count(":") and not ipv6_regex.match(endpoint):
|
||||
endpoint = "[{}]".format(endpoint)
|
||||
if not port:
|
||||
return endpoint
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# This example is for Kubernetes running an ngnix-ingress
|
||||
# This example is for Kubernetes running an nginx-ingress
|
||||
# and an ACME (e.g. Let's Encrypt) certificate service
|
||||
#
|
||||
# The nginx-ingress annotations support the dashboard
|
||||
|
||||
@@ -17,7 +17,7 @@ spec:
|
||||
- port: csi-http-metrics
|
||||
path: /metrics
|
||||
interval: 5s
|
||||
# comment csi-grpc-metrics realated information if csi grpc metrics is not enabled
|
||||
# comment csi-grpc-metrics related information if csi grpc metrics is not enabled
|
||||
- port: csi-grpc-metrics
|
||||
path: /metrics
|
||||
interval: 5s
|
||||
@@ -293,7 +293,7 @@ spec:
|
||||
description: |
|
||||
The device health module has determined that the number of devices predicted to
|
||||
fail can not be remediated automatically, since it would take too many osd's out of
|
||||
the cluster, impacting performance and potentially availabililty. You should add new
|
||||
the cluster, impacting performance and potentially availability. You should add new
|
||||
OSDs to the cluster to allow data to be relocated to avoid the data integrity issues.
|
||||
- alert: CephDeviceFailureRelocationIncomplete
|
||||
expr: ceph_health_detail{name="DEVICE_HEALTH_IN_USE"} == 1
|
||||
@@ -309,7 +309,7 @@ spec:
|
||||
soon, but the normal process of relocating the data on the device to other
|
||||
OSDs in the cluster is blocked.
|
||||
|
||||
Check the the cluster has available freespace. It may be necessary to add
|
||||
Check the cluster has available freespace. It may be necessary to add
|
||||
more disks to the cluster to allow the data from the failing device to
|
||||
successfully migrate.
|
||||
|
||||
@@ -525,7 +525,7 @@ spec:
|
||||
type: ceph_default
|
||||
oid: 1.3.6.1.4.1.50495.1.2.1.7.2
|
||||
annotations:
|
||||
summary: One or more platcment groups are marked unclean
|
||||
summary: One or more placement groups are marked unclean
|
||||
description: >
|
||||
{{ $value }} PGs haven't been clean for more than 15 minutes in pool {{ $labels.name }}.
|
||||
Unclean PGs haven't been able to completely recover from a previous failure.
|
||||
@@ -559,7 +559,7 @@ spec:
|
||||
description: >
|
||||
Data redundancy may be reduced, or is at risk, since one or more OSDs are at or above their
|
||||
'full' threshold. Add more capacity to the cluster, or delete unwanted data.
|
||||
- alert: CephPGUnavilableBlockingIO
|
||||
- alert: CephPGUnavailableBlockingIO
|
||||
# PG_AVAILABILITY, but an OSD is not in a DOWN state
|
||||
expr: ((ceph_health_detail{name="PG_AVAILABILITY"} == 1) - scalar(ceph_health_detail{name="OSD_DOWN"})) == 1
|
||||
for: 1m
|
||||
@@ -597,7 +597,7 @@ spec:
|
||||
summary: Placement group(s) have not been scrubbed
|
||||
description: |
|
||||
One or more PGs have not been scrubbed recently. The scrub process is a data integrity
|
||||
feature, protectng against bit-rot. It checks that objects and their metadata (size and
|
||||
feature, protecting against bit-rot. It checks that objects and their metadata (size and
|
||||
attributes) match across object replicas. When PGs miss their scrub window, it may
|
||||
indicate the scrub window is too small, or PGs were not in a 'clean' state during the
|
||||
scrub window.
|
||||
@@ -630,7 +630,7 @@ spec:
|
||||
summary: Placement group(s) have not been deep scrubbed
|
||||
description: |
|
||||
One or more PGs have not been deep scrubbed recently. Deep scrub is a data integrity
|
||||
feature, protectng against bit-rot. It compares the contents of objects and their
|
||||
feature, protecting against bit-rot. It compares the contents of objects and their
|
||||
replicas for inconsistency. When PGs miss their deep scrub window, it may indicate
|
||||
that the window is too small or PGs were not in a 'clean' state during the deep-scrub
|
||||
window.
|
||||
@@ -767,7 +767,7 @@ spec:
|
||||
annotations:
|
||||
summary: One or more Ceph pools are getting full
|
||||
description: |
|
||||
A pool has exceeeded it warning (percent full) threshold, or the OSDs
|
||||
A pool has exceeded it warning (percent full) threshold, or the OSDs
|
||||
supporting the pool have reached their NEARFULL thresholds. Writes may
|
||||
continue, but you are at risk of the pool going read only if more capacity
|
||||
isn't made available.
|
||||
|
||||
@@ -44,7 +44,7 @@ spec:
|
||||
labels:
|
||||
# key: value
|
||||
|
||||
# Resource equests and limits to apply to NFS server pods
|
||||
# Resource requests and limits to apply to NFS server pods
|
||||
resources:
|
||||
# limits:
|
||||
# cpu: "500m"
|
||||
|
||||
@@ -61,7 +61,7 @@ allowHostNetwork: true
|
||||
# This need to be set to true as we use HostPath
|
||||
allowHostDirVolumePlugin: true
|
||||
priority:
|
||||
# SYS_ADMIN is needed for rbd to execture rbd map command
|
||||
# SYS_ADMIN is needed for rbd to execute rbd map command
|
||||
allowedCapabilities: ["SYS_ADMIN"]
|
||||
# Needed as we run liveness container on daemonset pods
|
||||
allowHostPorts: true
|
||||
@@ -449,7 +449,6 @@ data:
|
||||
# memory: 256Mi
|
||||
# cpu: 100m
|
||||
|
||||
|
||||
# (Optional) CEPH CSI NFS provisioner resource requirement list, Put here list of resource
|
||||
# requests and limits you want to apply for provisioner pod
|
||||
# CSI_NFS_PROVISIONER_RESOURCE: |
|
||||
|
||||
@@ -411,7 +411,7 @@ data:
|
||||
# memory: 1Gi
|
||||
# cpu: 500m
|
||||
|
||||
# Configure CSI CSI Ceph FS grpc and liveness metrics port
|
||||
# Configure CSI Ceph FS grpc and liveness metrics port
|
||||
# CSI_CEPHFS_GRPC_METRICS_PORT: "9091"
|
||||
# CSI_CEPHFS_LIVENESS_METRICS_PORT: "9081"
|
||||
# Configure CSI RBD grpc and liveness metrics port
|
||||
|
||||
@@ -239,7 +239,7 @@ export DO_NOT_INCLUDE_POD_SECURITY_POLICY_RESOURCES=true
|
||||
export ADDITIONAL_HELM_CLI_OPTIONS="--set csi.nfs.enabled=true"
|
||||
./build/rbac/get-helm-rbac.sh > "$OLM_RBAC_YAML_FILE"
|
||||
|
||||
# TODO: do we need separate clusterrole/clusterrolebinding/role/rolebinding/servicaccount files, or
|
||||
# TODO: do we need separate clusterrole/clusterrolebinding/role/rolebinding/serviceaccount files, or
|
||||
# can these just stay in rbac.yaml? If they need to be separate, we can do that here with YQ.
|
||||
|
||||
generate_csv "$@"
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
### OSDs
|
||||
|
||||
OSDs do not fit under the single PodDisruptionBudget pattern. Ceph's ability to tolerate pod disruptions in one failure domain is dependent on the overall health of the cluster.
|
||||
Even if an upgrade agent were only to drain one node at a time, Ceph would have to wait until there were no undersized PGs before moving on the the next.
|
||||
Even if an upgrade agent were only to drain one node at a time, Ceph would have to wait until there were no undersized PGs before moving on the next.
|
||||
|
||||
The failure domain will be determined by the smallest failure domain of all the Ceph Pools in that cluster.
|
||||
We begin with creating a single PodDisruptionBudget for all the OSD with maxUnavailable=1. This will allow one OSD to go down anytime. Once the user drains a node and an OSD goes down, we determine the failure domain for the draining OSD (using the OSD deployment labels). Then we create blocking PodDisruptionBudgets (maxUnavailable=0) for all other failure domains and delete the main PodDisruptionBudget. This blocks OSDs from going down in multiple failure domains simultaneously.
|
||||
@@ -56,7 +56,7 @@ An OSD can be down due to reasons other than node drain, say, disk failure. In s
|
||||
|
||||
### Mon, Mgr, MDS, RGW, RBDMirror
|
||||
|
||||
Since there is no strict failure domain requirement for each of these, and they are not logically grouped, a stactic PDB will suffice.
|
||||
Since there is no strict failure domain requirement for each of these, and they are not logically grouped, a static PDB will suffice.
|
||||
|
||||
A single PodDisruptionBudget is created and owned by the respective controllers, and updated only according to changes in the CRDs that change the amount of pods.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ else, maxUnavailable = 0.
|
||||
|
||||
We can share a ceph health cache with the other controller-runtime reconcilers that have to watch the PG "cleanliness".
|
||||
|
||||
The MDB will target `Machine`s selected by a label maintainted by the `machine-controller`. The label is `fencegroup.rook.io/<cluster-name>`.
|
||||
The MDB will target `Machine`s selected by a label maintained by the `machine-controller`. The label is `fencegroup.rook.io/<cluster-name>`.
|
||||
|
||||
## machine-controller
|
||||
This controller watches OSDs and `Machine`s. It ensures that each `Machine` with OSDs from a `CephCluster` have the label `fencegroup.rook.io/<cluster-name>`, and those that do not have running OSDs do not have label.
|
||||
@@ -68,5 +68,5 @@ This will ensure that no `Machine` without running OSDs will be protected by the
|
||||
- MachineHealthCheck fences the Node.
|
||||
- Ceph resources on the node go down.
|
||||
- Some Ceph PGs are now not active+clean.
|
||||
- machinedisruptionbudget-controller sets maxUnavailble to 0 on the MachineDisruptionBudget.
|
||||
- machinedisruptionbudget-controller sets maxUnavailable to 0 on the MachineDisruptionBudget.
|
||||
- If another labeled node needs to be fenced, it will only happen after the Ceph PGs become active+clean again when the OSDs are rescheduled and backfilled.
|
||||
@@ -60,7 +60,7 @@ To enable Ceph's multisite, the following steps need to happen.
|
||||
2. If an admins pulls a realm on a Rook Ceph cluster from another Ceph cluster, the admin should create:
|
||||
|
||||
- A [ceph-object-realm](/design/ceph/object/realm.md) referring to the realm on the other Ceph cluster, and an endpoint in a master zone in that realm.
|
||||
- A [ceph-object-zone-group](/design/ceph/object/zone-group.md) referring to the realm that was pulled or matching the ceph-object-zone-group resource from the cluster the the realm was pulled from.
|
||||
- A [ceph-object-zone-group](/design/ceph/object/zone-group.md) referring to the realm that was pulled or matching the ceph-object-zone-group resource from the cluster the realm was pulled from.
|
||||
- A [ceph-object-zone](/design/ceph/object/zone.md) referring to the zone group that the new zone will be in.
|
||||
- A [ceph-object-store](/design/ceph/object/store.md) referring to the ceph-object-zone resource.
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ By default, the object store will be created independently from any other object
|
||||
|
||||
If desired to configure the object store to replicate and sync data amongst object-store or Ceph clusters, the `zone` section would be required.
|
||||
|
||||
This section enables the the object store to be part of a specified ceph-object-zone.
|
||||
This section enables the object store to be part of a specified ceph-object-zone.
|
||||
|
||||
Specifying this section also ensures that the pool section in the ceph-object-zone is used for the object-store. If pools are specified for the object-store they are neither created nor deleted.
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ A [ceph-object-pull-realm](/design/object/ceph-object-pull-realm.md) resource mu
|
||||
|
||||
Once the ceph-object-pull-realm is configured a ceph-object-zone must be created.
|
||||
|
||||
After an ceph-object-store is configured to be in this ceph-object-zone, the all Cehph multisite resources will be running and data between the two clusters will start syncing.
|
||||
After an ceph-object-store is configured to be in this ceph-object-zone, the all Ceph multisite resources will be running and data between the two clusters will start syncing.
|
||||
|
||||
## Deleting and Reconfiguring the Ceph Object Zone
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ The CPU limits would merely limit the "throughput" of the component when reachin
|
||||
|
||||
## Application of Resource Constraints
|
||||
The resource constraints are defined in the rook Cluster, Filesystem and RGW CRDs.
|
||||
The default is to not set resource requirements, this translates to the `qosClasss: BestEffort` (`qosClasss` will be later on explained in [Automatic Algorithm](#automatic-algorithm)).
|
||||
The default is to not set resource requirements, this translates to the `qosClass: BestEffort` (`qosClass` will be later on explained in [Automatic Algorithm](#automatic-algorithm)).
|
||||
|
||||
### Automatic Algorithm
|
||||
The user is able to enable and disable the automatic resource algorithm as he wants.
|
||||
|
||||
@@ -39,7 +39,7 @@ We can add Conditions simply in the Custom Resource struct as:
|
||||
|
||||
type ClusterStatus struct{
|
||||
FinalCondition ConditionType `json:"finalcondition,omitempty"`
|
||||
Message string `json:"message,omitmepty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Condition []RookConditions `json:"conditions,omitempty"`
|
||||
CephStatus *CephStatus `json:"ceph,omitempty"`
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ metadata:
|
||||
name: rook-operator
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["namespaces", "serviceaccounts", "secrets", "pods", "services", "nodes", "nodes/proxy", "configmaps", "events", "persistenvolumes", "persistentvolumeclaims"]
|
||||
resources: ["namespaces", "serviceaccounts", "secrets", "pods", "services", "nodes", "nodes/proxy", "configmaps", "events", "persistentvolumes", "persistentvolumeclaims"]
|
||||
verbs: [ "get", "list", "watch", "patch", "create", "update", "delete" ]
|
||||
- apiGroups: ["extensions"]
|
||||
resources: ["thirdpartyresources", "deployments", "daemonsets", "replicasets"]
|
||||
@@ -79,7 +79,7 @@ metadata:
|
||||
name: rook-ceph-agent
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods", "secrets", "configmaps", "persistenvolumes", "nodes", "nodes/proxy"]
|
||||
resources: ["pods", "secrets", "configmaps", "persistentvolumes", "nodes", "nodes/proxy"]
|
||||
verbs: [ "get", "list" ]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["storageclasses"]
|
||||
|
||||
@@ -130,7 +130,7 @@ were originally designed to be ephemeral, but it turns out that orchestrators
|
||||
like DeepSea store them permanently in order to have a source of truth when
|
||||
(re-)provisioning OSDs. Also, Drive Groups were originally designed to be host
|
||||
specific. But the concept of hosts is not really required for the Drive Group
|
||||
data structure make sense, as they only select a subset of a set of aviailble
|
||||
data structure make sense, as they only select a subset of a set of available
|
||||
drives.
|
||||
|
||||
DeepSea has a documentation of [some example drive
|
||||
|
||||
@@ -9,7 +9,7 @@ support large clusters, Rook should be able to update (and upgrade) multiple OSD
|
||||
|
||||
## High-level requirements
|
||||
|
||||
### Ability to set a maximumum number of OSDs to be updated simultaneously
|
||||
### Ability to set a maximum number of OSDs to be updated simultaneously
|
||||
In the worst (but unlikely) case, all OSDs which are updated for a given parallel update operation
|
||||
might fail to come back online after they are updated. Users may wish to limit the number of OSDs
|
||||
updated in parallel in order to avoid too many OSDs failing in this way.
|
||||
@@ -109,7 +109,7 @@ The plan was to identify OSD Deployments which need updated by looking at the OS
|
||||
(1) a `rook-version` label that does not match the current version of the Rook operator AND/OR
|
||||
(2) a `ceph-version` label that does not match the current Ceph version being deployed. This is an
|
||||
invalid optimization that does not account for OSD Deployments changing due to CephCluster resource
|
||||
updates. Instead of trying to optimize, it is better to always update OSD Deplyments and rely on the
|
||||
updates. Instead of trying to optimize, it is better to always update OSD Deployments and rely on the
|
||||
lower level update calls to finish quickly when there is no update to apply.
|
||||
|
||||
### User configuration
|
||||
|
||||
@@ -271,7 +271,7 @@ func placementTestGetTopologySpreadConstraints(topologyKey string) []v1.Topology
|
||||
{
|
||||
MaxSkew: 1,
|
||||
TopologyKey: topologyKey,
|
||||
WhenUnsatisfiable: "DoNotScheudule",
|
||||
WhenUnsatisfiable: "DoNotSchedule",
|
||||
LabelSelector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{"foo": "bar"},
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@ func TestNodeExists(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestResolveNodeNotExist(t *testing.T) {
|
||||
// a non existing node should return nil
|
||||
// a nonexistent node should return nil
|
||||
storageSpec := StorageScopeSpec{}
|
||||
node := storageSpec.ResolveNode("fake node")
|
||||
assert.Nil(t, node)
|
||||
|
||||
@@ -81,7 +81,7 @@ func CreateImage(context *clusterd.Context, clusterInfo *ClusterInfo, name, pool
|
||||
size = ImageMinSize
|
||||
}
|
||||
|
||||
// Roundup the size of the volume image since we only create images on 1MB bundaries and we should never create an image
|
||||
// Roundup the size of the volume image since we only create images on 1MB boundaries and we should never create an image
|
||||
// size that's smaller than the requested one, e.g, requested 1048698 bytes should be 2MB while not be truncated to 1MB
|
||||
sizeMB := int((size + ImageMinSize - 1) / ImageMinSize)
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ type ClusterInfo struct {
|
||||
// A context to cancel the context it is used to determine whether the reconcile loop should
|
||||
// exist (if the context has been cancelled). This cannot be in main clusterd context since this
|
||||
// is a pointer passed through the entire life cycle or the operator. If the context is
|
||||
// cancelled it will immedialy be re-created, thus existing reconciles loops will not be
|
||||
// cancelled it will immediately be re-created, thus existing reconciles loops will not be
|
||||
// cancelled.
|
||||
// Whereas if passed through clusterInfo, we don't have that problem since clusterInfo is
|
||||
// re-hydrated when a context is cancelled.
|
||||
|
||||
@@ -214,20 +214,20 @@ func CreatePoolWithPGs(context *clusterd.Context, clusterInfo *ClusterInfo, clus
|
||||
|
||||
func checkForImagesInPool(context *clusterd.Context, clusterInfo *ClusterInfo, name string) error {
|
||||
var err error
|
||||
logger.Debugf("checking any images/snapshosts present in pool %q", name)
|
||||
logger.Debugf("checking any images/snapshots present in pool %q", name)
|
||||
stats, err := GetPoolStatistics(context, clusterInfo, name)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "No such file or directory") {
|
||||
return nil
|
||||
}
|
||||
return errors.Wrapf(err, "failed to list images/snapshosts in pool %s", name)
|
||||
return errors.Wrapf(err, "failed to list images/snapshots in pool %s", name)
|
||||
}
|
||||
if stats.Images.Count == 0 && stats.Images.SnapCount == 0 {
|
||||
logger.Infof("no images/snapshosts present in pool %q", name)
|
||||
logger.Infof("no images/snapshots present in pool %q", name)
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.Errorf("pool %q contains images/snapshosts", name)
|
||||
return errors.Errorf("pool %q contains images/snapshots", name)
|
||||
}
|
||||
|
||||
// DeletePool purges a pool from Ceph
|
||||
|
||||
@@ -70,17 +70,17 @@ func getRadosNamespaceStatistics(context *clusterd.Context, clusterInfo *Cluster
|
||||
}
|
||||
|
||||
func checkForImagesInRadosNamespace(context *clusterd.Context, clusterInfo *ClusterInfo, poolName, namespaceName string) error {
|
||||
logger.Debugf("checking any images/snapshosts present in pool %s/%s in k8s namespace %q", poolName, namespaceName, clusterInfo.Namespace)
|
||||
logger.Debugf("checking any images/snapshots present in pool %s/%s in k8s namespace %q", poolName, namespaceName, clusterInfo.Namespace)
|
||||
stats, err := getRadosNamespaceStatistics(context, clusterInfo, poolName, namespaceName)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to list images/snapshosts in pool %s/%s", poolName, namespaceName)
|
||||
return errors.Wrapf(err, "failed to list images/snapshots in pool %s/%s", poolName, namespaceName)
|
||||
}
|
||||
if stats.Images.Count == 0 && stats.Images.SnapCount == 0 {
|
||||
logger.Infof("no images/snapshosts present in pool %s/%s in k8s namespace %q", poolName, namespaceName, clusterInfo.Namespace)
|
||||
logger.Infof("no images/snapshots present in pool %s/%s in k8s namespace %q", poolName, namespaceName, clusterInfo.Namespace)
|
||||
return nil
|
||||
}
|
||||
|
||||
return errors.Errorf("pool %s/%s contains %d images and %d snapshosts", poolName, namespaceName, stats.Images.Count, stats.Images.SnapCount)
|
||||
return errors.Errorf("pool %s/%s contains %d images and %d snapshots", poolName, namespaceName, stats.Images.Count, stats.Images.SnapCount)
|
||||
}
|
||||
|
||||
// DeleteRadosNamespace delete a rados namespace.
|
||||
|
||||
@@ -130,7 +130,7 @@ func OkToStop(context *clusterd.Context, clusterInfo *ClusterInfo, deployment, d
|
||||
// now trying to parse and find how many mons are presents
|
||||
// if we have less than 3 mons we skip the check and do best-effort
|
||||
// we do less than 3 because during the initial bootstrap the mon sequence is updated too
|
||||
// so running running the check on 2/3 mon fails
|
||||
// so running the check on 2/3 mon fails
|
||||
// versions.Mon looks like this map[ceph version 15.0.0-12-g6c8fb92 (6c8fb920cb1d862f36ee852ed849a15f9a50bd68) octopus (dev):1]
|
||||
// now looping over a single element since we can't address the key directly (we don't know its name)
|
||||
for _, monCount := range versions.Mon {
|
||||
|
||||
@@ -257,7 +257,7 @@ func Provision(context *clusterd.Context, agent *OsdAgent, crushLocation, topolo
|
||||
volumeGroupName := getVolumeGroupName(deviceOSDs[0].BlockPath)
|
||||
|
||||
// If empty the osd is using the ceph-volume raw mode
|
||||
// so it's consumming a raw block device and LVM is not used
|
||||
// so it's consuming a raw block device and LVM is not used
|
||||
// so there is nothing to de-activate
|
||||
if volumeGroupName != "" {
|
||||
if err := releaseLVMDevice(context, volumeGroupName); err != nil {
|
||||
|
||||
@@ -416,7 +416,7 @@ func UpdateLVMConfig(context *clusterd.Context, onPVC, lvBackedPV bool) error {
|
||||
// And reject everything else
|
||||
// We have 2 different regex depending on the version of LVM present in the container...
|
||||
// Since https://github.com/lvmteam/lvm2/commit/08396b4bce45fb8311979250623f04ec0ddb628c#diff-13c602a6258e57ce666a240e67c44f38
|
||||
// the content changed, so depending which version is installled one of the two replace will work
|
||||
// the content changed, so depending which version is installed one of the two replace will work
|
||||
if lvBackedPV {
|
||||
// ceph-volume calls lvs to locate given "vg/lv", so allow "/dev" here. However, ignore loopback devices
|
||||
output = bytes.Replace(output, []byte(`# filter = [ "a|.*/|" ]`), []byte(`filter = [ "a|^/mnt/.*|", "r|^/dev/loop.*|", "a|^/dev/.*|", "r|.*|" ]`), 1)
|
||||
|
||||
@@ -1368,7 +1368,7 @@ func TestPrintCVLogContent(t *testing.T) {
|
||||
cvLogFilePath := path.Join(cvLogDir, "ceph-volume.log")
|
||||
assert.Equal(t, path.Join(cvLogDir, "ceph-volume.log"), cvLogFilePath)
|
||||
|
||||
// Print c-v log, it is empty so this is similating a failure (e,g: the file does not exist)
|
||||
// Print c-v log, it is empty so this is simulating a failure (e,g: the file does not exist)
|
||||
cvLog := readCVLogContent(tmp.Name())
|
||||
assert.Empty(t, cvLog, cvLog)
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ func (r *ReconcileCephClient) reconcile(request reconcile.Request) (reconcile.Re
|
||||
return reconcile.Result{}, *cephClient, errors.Wrap(err, "failed to get cephClient")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephClient.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ func (c *ClusterController) initializeCluster(cluster *cluster) error {
|
||||
}
|
||||
}
|
||||
|
||||
// Depending on the cluster type choose the correct orchestation
|
||||
// Depending on the cluster type choose the correct orchestration
|
||||
if cluster.Spec.External.Enable {
|
||||
err := c.configureExternalCephCluster(cluster)
|
||||
if err != nil {
|
||||
|
||||
@@ -228,7 +228,7 @@ func (c *ClusterController) configureExternalClusterMonitoring(context *clusterd
|
||||
return errors.Wrap(err, "failed to configure external metrics endpoint")
|
||||
}
|
||||
|
||||
// Deploy external ServiceMonittor
|
||||
// Deploy external ServiceMonitor
|
||||
logger.Info("creating external service monitor")
|
||||
// servicemonitor takes some metadata from the service for easy mapping
|
||||
err = manager.EnableServiceMonitor("")
|
||||
|
||||
@@ -58,7 +58,7 @@ func TestNodeAffinity(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
// label nodes so they appear as not scheduable / invalid
|
||||
// label nodes so they appear as not schedulable / invalid
|
||||
node, _ := clientset.CoreV1().Nodes().Get(ctx, "node0", metav1.GetOptions{})
|
||||
node.Labels = map[string]string{"label": "foo"}
|
||||
_, err := clientset.CoreV1().Nodes().Update(ctx, node, metav1.UpdateOptions{})
|
||||
|
||||
@@ -162,7 +162,7 @@ func (c *Cluster) updateAndCreateOSDs(
|
||||
updateConfig *updateConfig,
|
||||
errs *provisionErrors, // add errors here
|
||||
) error {
|
||||
// tick every mintue to check-in on housekeeping stuff and report overall progress
|
||||
// tick every minute to check-in on housekeeping stuff and report overall progress
|
||||
minuteTicker := time.NewTicker(minuteTickerDuration)
|
||||
defer minuteTicker.Stop()
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ func fullDaemonName(daemonID string) string {
|
||||
return fmt.Sprintf("client.rbd-mirror.%s", daemonID)
|
||||
}
|
||||
|
||||
func (r *ReconcileCephRBDMirror) reconcileAddBoostrapPeer(cephRBDMirror *cephv1.CephRBDMirror, namespacedName types.NamespacedName) (reconcile.Result, error) {
|
||||
func (r *ReconcileCephRBDMirror) reconcileAddBootstrapPeer(cephRBDMirror *cephv1.CephRBDMirror, namespacedName types.NamespacedName) (reconcile.Result, error) {
|
||||
// List all the peers secret, we can have more than one peer we might want to configure
|
||||
// For each, get the Kubernetes Secret and import the "peer token" so that we can configure the mirroring
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ func (r *ReconcileCephRBDMirror) reconcile(request reconcile.Request) (reconcile
|
||||
r.updateStatus(k8sutil.ObservedGenerationNotAvailable, request.NamespacedName, k8sutil.EmptyStatus)
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephRBDMirror.ObjectMeta.Generation
|
||||
|
||||
@@ -223,7 +223,7 @@ func (r *ReconcileCephRBDMirror) reconcile(request reconcile.Request) (reconcile
|
||||
|
||||
// Add bootstrap peer if any
|
||||
logger.Debug("reconciling ceph rbd mirror peers addition")
|
||||
reconcileResponse, err = r.reconcileAddBoostrapPeer(cephRBDMirror, request.NamespacedName)
|
||||
reconcileResponse, err = r.reconcileAddBootstrapPeer(cephRBDMirror, request.NamespacedName)
|
||||
if err != nil {
|
||||
return opcontroller.ImmediateRetryResult, *cephRBDMirror, errors.Wrap(err, "failed to add ceph rbd mirror peer")
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Package telemetry codifes the Rook telemetry spec used to record Rook information for Ceph
|
||||
// Package telemetry codifies the Rook telemetry spec used to record Rook information for Ceph
|
||||
// telemetry. See: https://docs.ceph.com/en/latest/mgr/telemetry/
|
||||
package telemetry
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ func (c *clientCluster) onK8sNode(ctx context.Context, object runtime.Object) bo
|
||||
logger.Debug(opcontroller.OperatorNotInitializedMessage)
|
||||
return false
|
||||
}
|
||||
// If it fails, this might be due to the the operator just starting and catching an add event for that node
|
||||
// If it fails, this might be due to the operator just starting and catching an add event for that node
|
||||
logger.Debugf("failed to get osds on node %q, assume reconcile is necessary", nodeName)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -36,11 +36,11 @@ import (
|
||||
|
||||
const (
|
||||
//nolint:gosec // since this is not leaking any hardcoded credentials, it's just the prefix of the secret name
|
||||
poolMirrorBoostrapPeerSecretName = "pool-peer-token"
|
||||
poolMirrorBootstrapPeerSecretName = "pool-peer-token"
|
||||
//nolint:gosec // since this is not leaking any hardcoded credentials, it's just the prefix of the secret name
|
||||
fsMirrorBoostrapPeerSecretName = "fs-peer-token"
|
||||
fsMirrorBootstrapPeerSecretName = "fs-peer-token"
|
||||
//nolint:gosec // // since this is not leaking any hardcoded credentials, it's just the prefix of the secret name
|
||||
clusterMirrorBoostrapPeerSecretName = "cluster-peer-token"
|
||||
clusterMirrorBootstrapPeerSecretName = "cluster-peer-token"
|
||||
//nolint:gosec // since this is not leaking any hardcoded credentials, it's just the prefix of the secret name
|
||||
RBDMirrorBootstrapPeerSecretName = "rbdMirrorBootstrapPeerSecretName"
|
||||
//nolint:gosec // since this is not leaking any hardcoded credentials, it's just the prefix of the secret name
|
||||
@@ -50,20 +50,20 @@ const (
|
||||
func CreateBootstrapPeerSecret(ctx *clusterd.Context, clusterInfo *cephclient.ClusterInfo, object client.Object, ownerInfo *k8sutil.OwnerInfo) (reconcile.Result, error) {
|
||||
var err error
|
||||
var ns, name, daemonType string
|
||||
var boostrapToken []byte
|
||||
var bootstrapToken []byte
|
||||
switch objectType := object.(type) {
|
||||
case *cephv1.CephBlockPool:
|
||||
ns = objectType.Namespace
|
||||
name = objectType.Name
|
||||
daemonType = "rbd"
|
||||
// Create rbd mirror bootstrap peer token
|
||||
boostrapToken, err = cephclient.CreateRBDMirrorBootstrapPeer(ctx, clusterInfo, name)
|
||||
bootstrapToken, err = cephclient.CreateRBDMirrorBootstrapPeer(ctx, clusterInfo, name)
|
||||
if err != nil {
|
||||
return ImmediateRetryResult, errors.Wrapf(err, "failed to create %s-mirror bootstrap peer", daemonType)
|
||||
}
|
||||
|
||||
// Add additional information to the peer token
|
||||
boostrapToken, err = expandBootstrapPeerToken(ctx, clusterInfo, boostrapToken)
|
||||
bootstrapToken, err = expandBootstrapPeerToken(ctx, clusterInfo, bootstrapToken)
|
||||
if err != nil {
|
||||
return ImmediateRetryResult, errors.Wrap(err, "failed to add extra information to rbd-mirror bootstrap peer")
|
||||
}
|
||||
@@ -72,13 +72,13 @@ func CreateBootstrapPeerSecret(ctx *clusterd.Context, clusterInfo *cephclient.Cl
|
||||
ns = objectType.Namespace
|
||||
daemonType = "cluster-rbd"
|
||||
// Create rbd mirror bootstrap peer token
|
||||
boostrapToken, err = cephclient.CreateRBDMirrorBootstrapPeerWithoutPool(ctx, clusterInfo)
|
||||
bootstrapToken, err = cephclient.CreateRBDMirrorBootstrapPeerWithoutPool(ctx, clusterInfo)
|
||||
if err != nil {
|
||||
return ImmediateRetryResult, errors.Wrapf(err, "failed to create %s-mirror bootstrap peer", daemonType)
|
||||
}
|
||||
|
||||
// Add additional information to the peer token
|
||||
boostrapToken, err = expandBootstrapPeerToken(ctx, clusterInfo, boostrapToken)
|
||||
bootstrapToken, err = expandBootstrapPeerToken(ctx, clusterInfo, bootstrapToken)
|
||||
if err != nil {
|
||||
return ImmediateRetryResult, errors.Wrap(err, "failed to add extra information to rbd-mirror bootstrap peer")
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func CreateBootstrapPeerSecret(ctx *clusterd.Context, clusterInfo *cephclient.Cl
|
||||
ns = objectType.Namespace
|
||||
name = objectType.Name
|
||||
daemonType = "cephfs"
|
||||
boostrapToken, err = cephclient.CreateFSMirrorBootstrapPeer(ctx, clusterInfo, name)
|
||||
bootstrapToken, err = cephclient.CreateFSMirrorBootstrapPeer(ctx, clusterInfo, name)
|
||||
if err != nil {
|
||||
return ImmediateRetryResult, errors.Wrapf(err, "failed to create %s-mirror bootstrap peer", daemonType)
|
||||
}
|
||||
@@ -97,7 +97,7 @@ func CreateBootstrapPeerSecret(ctx *clusterd.Context, clusterInfo *cephclient.Cl
|
||||
}
|
||||
|
||||
// Generate and create a Kubernetes Secret with this token
|
||||
s := GenerateBootstrapPeerSecret(object, boostrapToken)
|
||||
s := GenerateBootstrapPeerSecret(object, bootstrapToken)
|
||||
|
||||
// set ownerref to the Secret
|
||||
err = ownerInfo.SetControllerReference(s)
|
||||
@@ -136,7 +136,7 @@ func GenerateBootstrapPeerSecret(object client.Object, token []byte) *v1.Secret
|
||||
|
||||
s := &v1.Secret{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: buildBoostrapPeerSecretName(object),
|
||||
Name: buildBootstrapPeerSecretName(object),
|
||||
Namespace: entityNamespace,
|
||||
},
|
||||
Data: map[string][]byte{
|
||||
@@ -149,14 +149,14 @@ func GenerateBootstrapPeerSecret(object client.Object, token []byte) *v1.Secret
|
||||
return s
|
||||
}
|
||||
|
||||
func buildBoostrapPeerSecretName(object client.Object) string {
|
||||
func buildBootstrapPeerSecretName(object client.Object) string {
|
||||
switch objectType := object.(type) {
|
||||
case *cephv1.CephFilesystem:
|
||||
return fmt.Sprintf("%s-%s", fsMirrorBoostrapPeerSecretName, objectType.Name)
|
||||
return fmt.Sprintf("%s-%s", fsMirrorBootstrapPeerSecretName, objectType.Name)
|
||||
case *cephv1.CephBlockPool:
|
||||
return fmt.Sprintf("%s-%s", poolMirrorBoostrapPeerSecretName, objectType.Name)
|
||||
return fmt.Sprintf("%s-%s", poolMirrorBootstrapPeerSecretName, objectType.Name)
|
||||
case *cephv1.CephCluster:
|
||||
return fmt.Sprintf("%s-%s", clusterMirrorBoostrapPeerSecretName, objectType.Name)
|
||||
return fmt.Sprintf("%s-%s", clusterMirrorBootstrapPeerSecretName, objectType.Name)
|
||||
}
|
||||
|
||||
return ""
|
||||
@@ -167,9 +167,9 @@ func GenerateStatusInfo(object client.Object) map[string]string {
|
||||
|
||||
switch object.(type) {
|
||||
case *cephv1.CephFilesystem:
|
||||
m[FSMirrorBootstrapPeerSecretName] = buildBoostrapPeerSecretName(object)
|
||||
m[FSMirrorBootstrapPeerSecretName] = buildBootstrapPeerSecretName(object)
|
||||
case *cephv1.CephBlockPool:
|
||||
m[RBDMirrorBootstrapPeerSecretName] = buildBoostrapPeerSecretName(object)
|
||||
m[RBDMirrorBootstrapPeerSecretName] = buildBootstrapPeerSecretName(object)
|
||||
}
|
||||
|
||||
return m
|
||||
|
||||
@@ -48,7 +48,7 @@ const (
|
||||
)
|
||||
|
||||
// WatchControllerPredicate is a special update filter for update events
|
||||
// do not reconcile if the the status changes, this avoids a reconcile storm loop
|
||||
// do not reconcile if the status changes, this avoids a reconcile storm loop
|
||||
//
|
||||
// returning 'true' means triggering a reconciliation
|
||||
// returning 'false' means do NOT trigger a reconciliation
|
||||
|
||||
@@ -83,7 +83,7 @@ func Test_extractCephCSIVersion(t *testing.T) {
|
||||
assert.Equal(t, &expectedVersion, version)
|
||||
assert.Nil(t, err)
|
||||
|
||||
csiString = []byte(`Cephcsi Version: rubish
|
||||
csiString = []byte(`Cephcsi Version: rubbish
|
||||
Git Commit: e58d537a07ca0184f67d33db85bf6b4911624b44
|
||||
Go Version: go1.12.15
|
||||
Compiler: gc
|
||||
|
||||
@@ -15,7 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Package clusterdisruption implements the controller for ensuring that drains occus in a safe manner.
|
||||
Package clusterdisruption implements the controller for ensuring that drains occurs in a safe manner.
|
||||
The design and purpose for clusterdisruption management is found at:
|
||||
https://github.com/rook/rook/blob/master/design/ceph/ceph-managed-disruptionbudgets.md
|
||||
*/
|
||||
|
||||
@@ -167,7 +167,7 @@ func TestGetOSDFailureDomains(t *testing.T) {
|
||||
expectedDrainingFailureDomains: []string{},
|
||||
},
|
||||
{
|
||||
name: "case 2: osd in zone-1 is pending and node is unscheduable",
|
||||
name: "case 2: osd in zone-1 is pending and node is unschedulable",
|
||||
osds: []appsv1.Deployment{fakeOSDDeployment(1, 0), fakeOSDDeployment(2, 1),
|
||||
fakeOSDDeployment(3, 1)},
|
||||
osdPods: []corev1.Pod{fakeOSDPod(1, ""), fakeOSDPod(2, nodeName),
|
||||
@@ -178,7 +178,7 @@ func TestGetOSDFailureDomains(t *testing.T) {
|
||||
expectedDrainingFailureDomains: []string{"zone-1"},
|
||||
},
|
||||
{
|
||||
name: "case 3: osd in zone-1 and zone-2 are pending and node is unscheduable",
|
||||
name: "case 3: osd in zone-1 and zone-2 are pending and node is unschedulable",
|
||||
osds: []appsv1.Deployment{fakeOSDDeployment(1, 0), fakeOSDDeployment(2, 0),
|
||||
fakeOSDDeployment(3, 1)},
|
||||
osdPods: []corev1.Pod{fakeOSDPod(1, ""), fakeOSDPod(2, ""),
|
||||
@@ -189,7 +189,7 @@ func TestGetOSDFailureDomains(t *testing.T) {
|
||||
expectedDrainingFailureDomains: []string{"zone-1", "zone-2"},
|
||||
},
|
||||
{
|
||||
name: "case 4: osd in zone-1 is pending but osd node is scheduable",
|
||||
name: "case 4: osd in zone-1 is pending but osd node is schedulable",
|
||||
osds: []appsv1.Deployment{fakeOSDDeployment(1, 0), fakeOSDDeployment(2, 1),
|
||||
fakeOSDDeployment(3, 1)},
|
||||
osdPods: []corev1.Pod{fakeOSDPod(1, nodeName), fakeOSDPod(2, nodeName),
|
||||
@@ -200,7 +200,7 @@ func TestGetOSDFailureDomains(t *testing.T) {
|
||||
expectedDrainingFailureDomains: []string{},
|
||||
},
|
||||
{
|
||||
name: "case 5: osd in zone-1 is pending but osd node is not scheduable",
|
||||
name: "case 5: osd in zone-1 is pending but osd node is not schedulable",
|
||||
osds: []appsv1.Deployment{fakeOSDDeployment(1, 0), fakeOSDDeployment(2, 1),
|
||||
fakeOSDDeployment(3, 1)},
|
||||
osdPods: []corev1.Pod{fakeOSDPod(1, nodeName), fakeOSDPod(2, nodeName),
|
||||
|
||||
@@ -232,7 +232,7 @@ func (c *ClusterMap) GetCluster(namespace string) (*cephv1.CephCluster, bool) {
|
||||
return cluster, true
|
||||
}
|
||||
|
||||
// GetClusterNamespaces returns the internal clustermap for iteration purporses
|
||||
// GetClusterNamespaces returns the internal clustermap for iteration purposes
|
||||
func (c *ClusterMap) GetClusterNamespaces() []string {
|
||||
defer c.mux.Unlock()
|
||||
c.mux.Lock()
|
||||
|
||||
@@ -184,7 +184,7 @@ func (r *ReconcileCephFilesystem) reconcile(request reconcile.Request) (reconcil
|
||||
}
|
||||
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephFilesystem.ObjectMeta.Generation
|
||||
|
||||
@@ -360,7 +360,7 @@ func (r *ReconcileCephFilesystem) reconcile(request reconcile.Request) (reconcil
|
||||
}
|
||||
|
||||
logger.Info("reconciling add cephfs-mirror peer configuration")
|
||||
err = r.reconcileAddBoostrapPeer(cephFilesystem, request.NamespacedName)
|
||||
err = r.reconcileAddBootstrapPeer(cephFilesystem, request.NamespacedName)
|
||||
if err != nil {
|
||||
return opcontroller.ImmediateRetryResult, *cephFilesystem,
|
||||
errors.Wrapf(err, "failed to configure mirroring for filesystem %q.", cephFilesystem.Name)
|
||||
@@ -473,7 +473,7 @@ func (r *ReconcileCephFilesystem) reconcileMirroring(cephFilesystem *cephv1.Ceph
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *ReconcileCephFilesystem) reconcileAddBoostrapPeer(cephFilesystem *cephv1.CephFilesystem, namespacedName types.NamespacedName) error {
|
||||
func (r *ReconcileCephFilesystem) reconcileAddBootstrapPeer(cephFilesystem *cephv1.CephFilesystem, namespacedName types.NamespacedName) error {
|
||||
if cephFilesystem.Spec.Mirroring.Peers == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ func (f *Filesystem) doFilesystemCreate(context *clusterd.Context, clusterInfo *
|
||||
}
|
||||
}
|
||||
|
||||
// create the filesystem ('fs new' needs to be forced in order to reuse pre-existing pools)
|
||||
// create the filesystem ('fs new' needs to be forced in order to reuse preexisting pools)
|
||||
// if only one pool is created new it won't work (to avoid inconsistencies).
|
||||
if err := cephclient.CreateFilesystem(context, clusterInfo, f.Name, metadataPool.Name, dataPoolNames); err != nil {
|
||||
return err
|
||||
|
||||
@@ -155,7 +155,7 @@ func (r *ReconcileFilesystemMirror) reconcile(request reconcile.Request) (reconc
|
||||
}
|
||||
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := filesystemMirror.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ func (r *ReconcileCephNFS) reconcile(request reconcile.Request) (reconcile.Resul
|
||||
return reconcile.Result{}, *cephNFS, errors.Wrap(err, "failed to get cephNFS")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephNFS.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ func (r *ReconcileCephObjectStore) reconcile(request reconcile.Request) (reconci
|
||||
return reconcile.Result{}, *cephObjectStore, errors.Wrap(err, "failed to get cephObjectStore")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephObjectStore.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ func (c *bucketChecker) checkObjectStoreHealth() error {
|
||||
|
||||
logger.Debugf("successfully checked object store endpoint for object store %q", c.namespacedName.String())
|
||||
|
||||
// Update the EndpointStatus in the CR to reflect the healthyness
|
||||
// Update the EndpointStatus in the CR to reflect the healthiness
|
||||
updateStatusBucket(c.objContext.clusterInfo.Context, c.client, c.namespacedName, cephv1.ConditionConnected, "")
|
||||
|
||||
return nil
|
||||
|
||||
@@ -480,7 +480,7 @@ func joinMultisite(objContext *Context, endpointArg, zoneEndpoints, namespace st
|
||||
|
||||
logger.Infof("added object store %q to realm %q, zonegroup %q, zone %q", objContext.Name, objContext.Realm, objContext.ZoneGroup, objContext.Zone)
|
||||
|
||||
// create system user for realm for master zone in master zonegorup for multisite scenario
|
||||
// create system user for realm for master zone in master zonegroup for multisite scenario
|
||||
if zoneIsMaster && zoneGroupIsMaster {
|
||||
err = createSystemUser(objContext, namespace)
|
||||
if err != nil {
|
||||
|
||||
@@ -120,7 +120,7 @@ const (
|
||||
effectDeny effect = "Deny"
|
||||
)
|
||||
|
||||
// PolicyStatment is the Go representation of a PolicyStatement json struct
|
||||
// PolicyStatement is the Go representation of a PolicyStatement json struct
|
||||
// it defines what Actions that a Principle can or cannot perform on a Resource
|
||||
type PolicyStatement struct {
|
||||
// Sid (optional) is the PolicyStatement's unique identifier
|
||||
@@ -234,7 +234,7 @@ func (bp *BucketPolicy) EjectPrincipals(users ...string) *BucketPolicy {
|
||||
return bp
|
||||
}
|
||||
|
||||
// NewPolicyStatement generates a new PolicyStatement. PolicyStatment methods are designed to
|
||||
// NewPolicyStatement generates a new PolicyStatement. PolicyStatement methods are designed to
|
||||
// be chain called with dot notation to allow for easy configuration at creation. This is preferable
|
||||
// to a long parameter list.
|
||||
func NewPolicyStatement() *PolicyStatement {
|
||||
|
||||
@@ -138,7 +138,7 @@ func (r *ReconcileObjectRealm) reconcile(request reconcile.Request) (reconcile.R
|
||||
return reconcile.Result{}, *cephObjectRealm, errors.Wrap(err, "failed to get CephObjectRealm")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephObjectRealm.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -182,17 +182,17 @@ func TestGetTlsCaCert(t *testing.T) {
|
||||
objectStore := simpleStore()
|
||||
|
||||
t.Run("no gateway cert ref", func(t *testing.T) {
|
||||
tlsCert, insesure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
tlsCert, insecure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, insesure)
|
||||
assert.False(t, insecure)
|
||||
assert.Nil(t, tlsCert)
|
||||
})
|
||||
|
||||
t.Run("gateway cert ref but secret no found", func(t *testing.T) {
|
||||
objectStore.Spec.Gateway.SSLCertificateRef = "my-secret"
|
||||
tlsCert, insesure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
tlsCert, insecure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
assert.Error(t, err)
|
||||
assert.False(t, insesure)
|
||||
assert.False(t, insecure)
|
||||
assert.Nil(t, tlsCert)
|
||||
})
|
||||
|
||||
@@ -207,10 +207,10 @@ func TestGetTlsCaCert(t *testing.T) {
|
||||
_, err := objContext.Context.Clientset.CoreV1().Secrets(objContext.clusterInfo.Namespace).Create(context.TODO(), s, metav1.CreateOptions{})
|
||||
assert.NoError(t, err)
|
||||
objectStore.Spec.Gateway.SSLCertificateRef = "my-secret"
|
||||
tlsCert, insesure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
tlsCert, insecure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
assert.Error(t, err)
|
||||
assert.EqualError(t, err, "failed to get TLS certificate from secret, unknown secret type \"Yolo\"")
|
||||
assert.False(t, insesure)
|
||||
assert.False(t, insecure)
|
||||
assert.Nil(t, tlsCert)
|
||||
err = objContext.Context.Clientset.CoreV1().Secrets(objContext.clusterInfo.Namespace).Delete(context.TODO(), s.Name, metav1.DeleteOptions{})
|
||||
assert.NoError(t, err)
|
||||
@@ -227,10 +227,10 @@ func TestGetTlsCaCert(t *testing.T) {
|
||||
_, err := objContext.Context.Clientset.CoreV1().Secrets(objContext.clusterInfo.Namespace).Create(context.TODO(), s, metav1.CreateOptions{})
|
||||
assert.NoError(t, err)
|
||||
objectStore.Spec.Gateway.SSLCertificateRef = "my-secret"
|
||||
tlsCert, insesure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
tlsCert, insecure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
assert.Error(t, err)
|
||||
assert.EqualError(t, err, "failed to get TLS certificate from secret, token is \"Opaque\" but key \"cert\" does not exist")
|
||||
assert.False(t, insesure)
|
||||
assert.False(t, insecure)
|
||||
assert.Nil(t, tlsCert)
|
||||
err = objContext.Context.Clientset.CoreV1().Secrets(objContext.clusterInfo.Namespace).Delete(context.TODO(), s.Name, metav1.DeleteOptions{})
|
||||
assert.NoError(t, err)
|
||||
@@ -256,9 +256,9 @@ BvjQDN6didwQ
|
||||
_, err := objContext.Context.Clientset.CoreV1().Secrets(objContext.clusterInfo.Namespace).Create(context.TODO(), s, metav1.CreateOptions{})
|
||||
assert.NoError(t, err)
|
||||
objectStore.Spec.Gateway.SSLCertificateRef = "my-secret"
|
||||
tlsCert, insesure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
tlsCert, insecure, err := GetTlsCaCert(objContext, &objectStore.Spec)
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, insesure)
|
||||
assert.False(t, insecure)
|
||||
assert.NotNil(t, tlsCert)
|
||||
err = objContext.Context.Clientset.CoreV1().Secrets(objContext.clusterInfo.Namespace).Delete(context.TODO(), s.Name, metav1.DeleteOptions{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -66,7 +66,7 @@ func TestNewS3Agent(t *testing.T) {
|
||||
assert.NotNil(t, s3Agent.Client.Config.HTTPClient.Transport.(*http.Transport).TLSClientConfig.RootCAs)
|
||||
assert.False(t, *s3Agent.Client.Config.DisableSSL)
|
||||
})
|
||||
t.Run("test with insesure tls client cert", func(t *testing.T) {
|
||||
t.Run("test with insecure tls client cert", func(t *testing.T) {
|
||||
debug := true
|
||||
insecure := true
|
||||
tlsCert := []byte("tlsCert")
|
||||
|
||||
@@ -108,7 +108,7 @@ func (r *ReconcileBucketTopic) reconcile(request reconcile.Request) (reconcile.R
|
||||
return reconcile.Result{}, errors.Wrapf(err, "failed to get CephBucketTopic %q", request.NamespacedName)
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephBucketTopic.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ func (r *ReconcileObjectStoreUser) reconcile(request reconcile.Request) (reconci
|
||||
return reconcile.Result{}, *cephObjectStoreUser, errors.Wrap(err, "failed to get CephObjectStoreUser")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephObjectStoreUser.ObjectMeta.Generation
|
||||
|
||||
@@ -268,7 +268,7 @@ func (r *ReconcileObjectStoreUser) reconcile(request reconcile.Request) (reconci
|
||||
}
|
||||
|
||||
func (r *ReconcileObjectStoreUser) reconcileCephUser(cephObjectStoreUser *cephv1.CephObjectStoreUser) (reconcile.Result, error) {
|
||||
err := r.createorUpdateCephUser(cephObjectStoreUser)
|
||||
err := r.createOrUpdateCephUser(cephObjectStoreUser)
|
||||
if err != nil {
|
||||
return reconcile.Result{}, errors.Wrapf(err, "failed to create/update object store user %q", cephObjectStoreUser.Name)
|
||||
}
|
||||
@@ -276,7 +276,7 @@ func (r *ReconcileObjectStoreUser) reconcileCephUser(cephObjectStoreUser *cephv1
|
||||
return reconcile.Result{}, nil
|
||||
}
|
||||
|
||||
func (r *ReconcileObjectStoreUser) createorUpdateCephUser(u *cephv1.CephObjectStoreUser) error {
|
||||
func (r *ReconcileObjectStoreUser) createOrUpdateCephUser(u *cephv1.CephObjectStoreUser) error {
|
||||
logger.Infof("creating ceph object user %q in namespace %q", u.Name, u.Namespace)
|
||||
|
||||
logCreateOrUpdate := fmt.Sprintf("retrieved existing ceph object user %q", u.Name)
|
||||
|
||||
@@ -340,7 +340,7 @@ func TestBuildUpdateStatusInfo(t *testing.T) {
|
||||
assert.Equal(t, "rook-ceph-object-user-my-store-my-user", statusInfo["secretName"])
|
||||
}
|
||||
|
||||
func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
func TestCreateOrUpdateCephUser(t *testing.T) {
|
||||
// Set DEBUG logging
|
||||
capnslog.SetGlobalLogLevel(capnslog.DEBUG)
|
||||
|
||||
@@ -425,7 +425,7 @@ func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
assert.NoError(t, err)
|
||||
|
||||
t.Run("user with empty name", func(t *testing.T) {
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
@@ -433,7 +433,7 @@ func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
objectUser.Name = name
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
@@ -441,7 +441,7 @@ func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
objectUser.Spec.Quotas = &cephv1.ObjectUserQuotaSpec{MaxBuckets: &maxbucket}
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
@@ -453,7 +453,7 @@ func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
}
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
@@ -463,35 +463,35 @@ func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
objectUser.Spec.Quotas = &cephv1.ObjectUserQuotaSpec{MaxObjects: &maxobject}
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
t.Run("setting MaxSize for the user", func(t *testing.T) {
|
||||
objectUser.Spec.Quotas = &cephv1.ObjectUserQuotaSpec{MaxSize: &maxsize}
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
t.Run("resetting MaxSize and MaxObjects for the user", func(t *testing.T) {
|
||||
objectUser.Spec.Quotas = nil
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
t.Run("setting both MaxSize and MaxObjects for the user", func(t *testing.T) {
|
||||
objectUser.Spec.Quotas = &cephv1.ObjectUserQuotaSpec{MaxObjects: &maxobject, MaxSize: &maxsize}
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
t.Run("resetting MaxSize and MaxObjects again for the user", func(t *testing.T) {
|
||||
objectUser.Spec.Quotas = nil
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
|
||||
@@ -503,7 +503,7 @@ func TestCreateorUpdateCephUser(t *testing.T) {
|
||||
objectUser.Spec.Quotas = &cephv1.ObjectUserQuotaSpec{MaxBuckets: &maxbucket, MaxObjects: &maxobject, MaxSize: &maxsize}
|
||||
userConfig = generateUserConfig(objectUser)
|
||||
r.userConfig = &userConfig
|
||||
err = r.createorUpdateCephUser(objectUser)
|
||||
err = r.createOrUpdateCephUser(objectUser)
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
}
|
||||
@@ -135,7 +135,7 @@ func (r *ReconcileObjectZone) reconcile(request reconcile.Request) (reconcile.Re
|
||||
return reconcile.Result{}, *cephObjectZone, errors.Wrap(err, "failed to get CephObjectZone")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephObjectZone.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ func (r *ReconcileObjectZoneGroup) reconcile(request reconcile.Request) (reconci
|
||||
return reconcile.Result{}, errors.Wrap(err, "failed to get CephObjectZoneGroup")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephObjectZoneGroup.ObjectMeta.Generation
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ func (r *ReconcileCephBlockPool) reconcile(request reconcile.Request) (reconcile
|
||||
return opcontroller.ImmediateRetryResult, *cephBlockPool, errors.Wrap(err, "failed to get CephBlockPool")
|
||||
}
|
||||
// update observedGeneration local variable with current generation value,
|
||||
// because generation can be changed before reconile got completed
|
||||
// because generation can be changed before reconcile got completed
|
||||
// CR status will be updated at end of reconcile, so to reflect the reconcile has finished
|
||||
observedGeneration := cephBlockPool.ObjectMeta.Generation
|
||||
|
||||
@@ -322,7 +322,7 @@ func (r *ReconcileCephBlockPool) reconcile(request reconcile.Request) (reconcile
|
||||
|
||||
// Add bootstrap peer if any
|
||||
logger.Debug("reconciling ceph bootstrap peers import")
|
||||
reconcileResponse, err = r.reconcileAddBoostrapPeer(cephBlockPool, request.NamespacedName)
|
||||
reconcileResponse, err = r.reconcileAddBootstrapPeer(cephBlockPool, request.NamespacedName)
|
||||
if err != nil {
|
||||
return reconcileResponse, *cephBlockPool, errors.Wrap(err, "failed to add ceph rbd mirror peer")
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
"sigs.k8s.io/controller-runtime/pkg/reconcile"
|
||||
)
|
||||
|
||||
func (r *ReconcileCephBlockPool) reconcileAddBoostrapPeer(pool *cephv1.CephBlockPool,
|
||||
func (r *ReconcileCephBlockPool) reconcileAddBootstrapPeer(pool *cephv1.CephBlockPool,
|
||||
namespacedName types.NamespacedName) (reconcile.Result, error) {
|
||||
|
||||
if pool.Spec.Mirroring.Peers == nil {
|
||||
|
||||
@@ -70,7 +70,7 @@ func VerifyPodLabels(appName, namespace, daemonType, daemonID string, labels map
|
||||
return combineErrors(errA, errB, errC)
|
||||
}
|
||||
|
||||
// AssertLabelsContainCephRequirements asserts that the the labels under test contain the labels
|
||||
// AssertLabelsContainCephRequirements asserts that the labels under test contain the labels
|
||||
// which all Ceph pods should have. This can be used with labels for Kubernetes Deployments,
|
||||
// DaemonSets, etc.
|
||||
func AssertLabelsContainCephRequirements(
|
||||
|
||||
@@ -255,7 +255,7 @@ func webhookRules(name, resource, resourceServicePath string) admv1.ValidatingWe
|
||||
}
|
||||
}
|
||||
|
||||
func deleteIssuerAndCetificate(ctx context.Context, certMgrClient *cs.CertmanagerV1Client, clusterdContext *clusterd.Context) error {
|
||||
func deleteIssuerAndCertificate(ctx context.Context, certMgrClient *cs.CertmanagerV1Client, clusterdContext *clusterd.Context) error {
|
||||
|
||||
err := clusterdContext.Clientset.AdmissionregistrationV1().ValidatingWebhookConfigurations().Delete(ctx, webhookConfigName, metav1.DeleteOptions{})
|
||||
if err != nil && !kerrors.IsNotFound(err) {
|
||||
|
||||
@@ -53,7 +53,7 @@ func createWebhook(ctx context.Context, context *clusterd.Context) (bool, error)
|
||||
|
||||
if os.Getenv(webhookEnv) == "true" {
|
||||
logger.Info("delete Issuer and Certificate since secret is not found")
|
||||
if err = deleteIssuerAndCetificate(ctx, certMgrClient, context); err != nil {
|
||||
if err = deleteIssuerAndCertificate(ctx, certMgrClient, context); err != nil {
|
||||
logger.Errorf("failed to delete issuer or certificate. %v", err)
|
||||
}
|
||||
return false, nil
|
||||
@@ -84,7 +84,7 @@ func createWebhook(ctx context.Context, context *clusterd.Context) (bool, error)
|
||||
if apierrors.IsNotFound(err) {
|
||||
// If secret is not found. All good ! Proceed with rook without admission controllers
|
||||
logger.Info("delete Issuer and Certificate since secret is not found")
|
||||
if err = deleteIssuerAndCetificate(ctx, certMgrClient, context); err != nil {
|
||||
if err = deleteIssuerAndCertificate(ctx, certMgrClient, context); err != nil {
|
||||
logger.Infof("could not delete issuer or certificate. %v", err)
|
||||
}
|
||||
logger.Infof("admission webhook secret %q not found. proceeding without the admission controller", admissionControllerAppName)
|
||||
|
||||
@@ -39,7 +39,7 @@ type WaitOptions struct {
|
||||
|
||||
// ErrorOnTimeout defines whether the operation should time out with an error. If ErrorOnTimeout
|
||||
// is true and the operation times out, the operation is considered a failure. If ErrorOnTimeout
|
||||
// is false and the operation times out, the operation should log a warning but not not report
|
||||
// is false and the operation times out, the operation should log a warning but not report
|
||||
// failure.
|
||||
ErrorOnTimeout bool
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func ArgumentsMatchExpected(actualArgs []string, expectedArgs [][]string) error
|
||||
return nil
|
||||
}
|
||||
|
||||
// AssertLabelsContainRookRequirements asserts that the the labels under test contain the labels
|
||||
// AssertLabelsContainRookRequirements asserts that the labels under test contain the labels
|
||||
// which all Rook pods should have. This can be used with labels for Kubernetes Deployments,
|
||||
// DaemonSets, etc.
|
||||
func AssertLabelsContainRookRequirements(t *testing.T, labels map[string]string, appName string) {
|
||||
|
||||
@@ -62,7 +62,7 @@ func VolumeIsHostPath(volumeName, path string, volumes []v1.Volume) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// VolumeMountExists returns returns a descriptive error if the volume mount does not exist.
|
||||
// VolumeMountExists returns a descriptive error if the volume mount does not exist.
|
||||
func VolumeMountExists(mountName string, mounts []v1.VolumeMount) error {
|
||||
_, err := getMount(mountName, mounts)
|
||||
return err
|
||||
|
||||
@@ -124,7 +124,7 @@ func (b *BlockOperation) DeleteStorageClass(storageClassName string) error {
|
||||
|
||||
// BlockDelete Function to delete a Block using Rook
|
||||
// Input parameters -
|
||||
// manifest - pod definition where pvc is described - delete is run on the the yaml definition
|
||||
// manifest - pod definition where pvc is described - delete is run on the yaml definition
|
||||
// Output - k8s delete pvc operation output and/or error
|
||||
func (b *BlockOperation) DeleteBlock(manifest string) (string, error) {
|
||||
args := []string{"delete", "-f", "-"}
|
||||
|
||||
@@ -64,7 +64,7 @@ func (o *ObjectUserOperation) UserSecretExists(namespace string, store string, u
|
||||
//GetResource(blah) returns success if blah is or is not found.
|
||||
//err = success and found_sec not "No resources found." means it was found
|
||||
//err = success and found_sec contains "No resources found." means it was not found
|
||||
//err != success is an other error
|
||||
//err != success is another error
|
||||
if err == nil && !strings.Contains(message, "No resources found") {
|
||||
logger.Infof("Object User Secret Exists")
|
||||
return true
|
||||
|
||||
@@ -122,8 +122,8 @@ func (h *CephInstaller) configureRookCephClusterViaHelm(upgrade bool) error {
|
||||
"resources": nil,
|
||||
}
|
||||
values["monitoring"] = map[string]interface{}{
|
||||
"enabled": true,
|
||||
"createPromtheusRules": true,
|
||||
"enabled": true,
|
||||
"createPrometheusRules": true,
|
||||
}
|
||||
values["ingress"] = map[string]interface{}{
|
||||
"dashboard": map[string]interface{}{
|
||||
|
||||
@@ -29,7 +29,7 @@ import (
|
||||
|
||||
var logger = capnslog.NewPackageLogger("github.com/rook/rook", "testutil")
|
||||
|
||||
// CommandArgs is a warpper for cmd args
|
||||
// CommandArgs is a wrapper for cmd args
|
||||
type CommandArgs struct {
|
||||
Command string
|
||||
CmdArgs []string
|
||||
|
||||
@@ -180,7 +180,7 @@ function creatingPrerequisites(){
|
||||
echo "creating Prerequisites deployments - Prometheus Operator and Prometheus Instances"
|
||||
# creating Prometheus operator
|
||||
kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/v0.40.0/bundle.yaml
|
||||
# waitng for Prometheus operator to get ready
|
||||
# waiting for Prometheus operator to get ready
|
||||
timeout 30 sh -c "until [ $(kubectl get pod -l app.kubernetes.'io/name'=prometheus-operator -o json | jq -r '.items[0].status.phase') = Running ]; do echo 'waiting for prometheus-operator to get created' && sleep 1; done"
|
||||
# creating a service monitor that will watch the Rook cluster and collect metrics regularly
|
||||
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/deploy/examples/monitoring/service-monitor.yaml
|
||||
@@ -190,7 +190,7 @@ function creatingPrerequisites(){
|
||||
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/deploy/examples/monitoring/prometheus.yaml
|
||||
# create prometheus-service
|
||||
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/deploy/examples/monitoring/prometheus-service.yaml
|
||||
# waitng for prometheus-rook-prometheus-0 pod to get ready
|
||||
# waiting for prometheus-rook-prometheus-0 pod to get ready
|
||||
timeout 60 sh -c "until [ $(kubectl get pod -l prometheus=rook-prometheus -nrook-ceph -o json | jq -r '.items[0].status.phase') = Running ]; do echo 'waiting for prometheus-rook-prometheus-0 pod to get created' && sleep 1; done"
|
||||
if [ "$(kubectl get pod -l prometheus=rook-prometheus -nrook-ceph)" == "" ]
|
||||
then
|
||||
|
||||
@@ -433,7 +433,7 @@ function deploy_multus() {
|
||||
kubectl create namespace rook-ceph || true
|
||||
|
||||
# install network attachment definitions
|
||||
IFACE="eth0" # the runner has eth0 so we don't need any heureustics to find the interface
|
||||
IFACE="eth0" # the runner has eth0 so we don't need any heuristics to find the interface
|
||||
kubectl apply -f - <<EOF
|
||||
---
|
||||
apiVersion: k8s.cni.cncf.io/v1
|
||||
|
||||
Reference in new issue
Block a user