Merge pull request #12384 from ideepika/feature/ksd-174
mon: add mon storage class support
This commit is contained in:
14 files changed
+758
-132
No files matched your search
@@ -126,6 +126,23 @@ A specific will contain a specific release of Ceph as well as security fixes fro
|
||||
This setting only applies to new monitors that are created when the requested
|
||||
number of monitors increases, or when a monitor fails and is recreated. An
|
||||
[example CRD configuration is provided below](#using-pvc-storage-for-monitors).
|
||||
* `failureDomainLabel`: The label that is expected on each node where the mons
|
||||
are expected to be deployed. The labels must be found in the list of
|
||||
well-known [topology labels](#osd-topology).
|
||||
* `zones`: The failure domain names where the Mons are expected to be deployed.
|
||||
There must be **at least three zones** specified in the list. Each zone can be
|
||||
backed by a different storage class by specifying the `volumeClaimTemplate`.
|
||||
* `name`: The name of the zone, which is the value of the domain label.
|
||||
* `volumeClaimTemplate`: A `PersistentVolumeSpec` used by Rook to create PVCs
|
||||
for monitor storage. This field is optional, and when not provided, HostPath
|
||||
volume mounts are used. The current set of fields from template that are used
|
||||
are `storageClassName` and the `storage` resource request and limit. The
|
||||
default storage size request for new PVCs is `10Gi`. Ensure that associated
|
||||
storage class is configured to use `volumeBindingMode: WaitForFirstConsumer`.
|
||||
This setting only applies to new monitors that are created when the requested
|
||||
number of monitors increases, or when a monitor fails and is recreated. An
|
||||
[example CRD configuration is provided below](#using-pvc-storage-for-monitors).
|
||||
|
||||
* `stretchCluster`: The stretch cluster settings that define the zones (or other failure domain labels) across which to configure the cluster.
|
||||
* `failureDomainLabel`: The label that is expected on each node where the cluster is expected to be deployed. The labels must be found
|
||||
in the list of well-known [topology labels](#osd-topology).
|
||||
@@ -134,7 +151,16 @@ A specific will contain a specific release of Ceph as well as security fixes fro
|
||||
This element is always named `zone` even if a non-default `failureDomainLabel` is specified. The elements have two values:
|
||||
* `name`: The name of the zone, which is the value of the domain label.
|
||||
* `arbiter`: Whether the zone is expected to be the arbiter zone which only runs a single mon. Exactly one zone must be labeled `true`.
|
||||
The two zones that are not the arbiter zone are expected to have OSDs deployed.
|
||||
* `volumeClaimTemplate`: A `PersistentVolumeSpec` used by Rook to create PVCs
|
||||
for monitor storage. This field is optional, and when not provided, HostPath
|
||||
volume mounts are used. The current set of fields from template that are used
|
||||
are `storageClassName` and the `storage` resource request and limit. The
|
||||
default storage size request for new PVCs is `10Gi`. Ensure that associated
|
||||
storage class is configured to use `volumeBindingMode: WaitForFirstConsumer`.
|
||||
This setting only applies to new monitors that are created when the requested
|
||||
number of monitors increases, or when a monitor fails and is recreated. An
|
||||
[example CRD configuration is provided below](#using-pvc-storage-for-monitors).
|
||||
The two zones that are not the arbiter zone are expected to have OSDs deployed.
|
||||
|
||||
If these settings are changed in the CRD the operator will update the number of mons during a periodic check of the mon health, which by default is every 45 seconds.
|
||||
|
||||
|
||||
@@ -7490,6 +7490,31 @@ bool
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>failureDomainLabel</code><br/>
|
||||
<em>
|
||||
string
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>zones</code><br/>
|
||||
<em>
|
||||
<a href="#ceph.rook.io/v1.MonZoneSpec">
|
||||
[]MonZoneSpec
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Zones are specified when we want to provide zonal awareness to mons</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>stretchCluster</code><br/>
|
||||
<em>
|
||||
<a href="#ceph.rook.io/v1.StretchClusterSpec">
|
||||
@@ -7518,6 +7543,62 @@ Kubernetes core/v1.PersistentVolumeClaim
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="ceph.rook.io/v1.MonZoneSpec">MonZoneSpec
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em><a href="#ceph.rook.io/v1.MonSpec">MonSpec</a>, <a href="#ceph.rook.io/v1.StretchClusterSpec">StretchClusterSpec</a>)
|
||||
</p>
|
||||
<div>
|
||||
<p>MonZoneSpec represents the specification of a zone in a Ceph Cluster</p>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>name</code><br/>
|
||||
<em>
|
||||
string
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Name is the name of the zone</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>arbiter</code><br/>
|
||||
<em>
|
||||
bool
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Arbiter determines if the zone contains the arbiter used for stretch cluster mode</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>volumeClaimTemplate</code><br/>
|
||||
<em>
|
||||
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#persistentvolumeclaim-v1-core">
|
||||
Kubernetes core/v1.PersistentVolumeClaim
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>VolumeClaimTemplate is the PVC template</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="ceph.rook.io/v1.MonitoringSpec">MonitoringSpec
|
||||
</h3>
|
||||
<p>
|
||||
@@ -11243,8 +11324,8 @@ string
|
||||
<td>
|
||||
<code>zones</code><br/>
|
||||
<em>
|
||||
<a href="#ceph.rook.io/v1.StretchClusterZoneSpec">
|
||||
[]StretchClusterZoneSpec
|
||||
<a href="#ceph.rook.io/v1.MonZoneSpec">
|
||||
[]MonZoneSpec
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
@@ -11255,62 +11336,6 @@ string
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="ceph.rook.io/v1.StretchClusterZoneSpec">StretchClusterZoneSpec
|
||||
</h3>
|
||||
<p>
|
||||
(<em>Appears on:</em><a href="#ceph.rook.io/v1.StretchClusterSpec">StretchClusterSpec</a>)
|
||||
</p>
|
||||
<div>
|
||||
<p>StretchClusterZoneSpec represents the specification of a stretched zone in a Ceph Cluster</p>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Field</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<code>name</code><br/>
|
||||
<em>
|
||||
string
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Name is the name of the zone</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>arbiter</code><br/>
|
||||
<em>
|
||||
bool
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>Arbiter determines if the zone contains the arbiter</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<code>volumeClaimTemplate</code><br/>
|
||||
<em>
|
||||
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#persistentvolumeclaim-v1-core">
|
||||
Kubernetes core/v1.PersistentVolumeClaim
|
||||
</a>
|
||||
</em>
|
||||
</td>
|
||||
<td>
|
||||
<em>(Optional)</em>
|
||||
<p>VolumeClaimTemplate is the PVC template</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<h3 id="ceph.rook.io/v1.TopicEndpointSpec">TopicEndpointSpec
|
||||
</h3>
|
||||
<p>
|
||||
|
||||
@@ -1354,6 +1354,8 @@ spec:
|
||||
maximum: 9
|
||||
minimum: 0
|
||||
type: integer
|
||||
failureDomainLabel:
|
||||
type: string
|
||||
stretchCluster:
|
||||
description: StretchCluster is the stretch cluster specification
|
||||
properties:
|
||||
@@ -1366,10 +1368,10 @@ spec:
|
||||
zones:
|
||||
description: Zones is the list of zones
|
||||
items:
|
||||
description: StretchClusterZoneSpec represents the specification of a stretched zone in a Ceph Cluster
|
||||
description: MonZoneSpec represents the specification of a zone in a Ceph Cluster
|
||||
properties:
|
||||
arbiter:
|
||||
description: Arbiter determines if the zone contains the arbiter
|
||||
description: Arbiter determines if the zone contains the arbiter used for stretch cluster mode
|
||||
type: boolean
|
||||
name:
|
||||
description: Name is the name of the zone
|
||||
@@ -1816,6 +1818,234 @@ spec:
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
zones:
|
||||
description: Zones are specified when we want to provide zonal awareness to mons
|
||||
items:
|
||||
description: MonZoneSpec represents the specification of a zone in a Ceph Cluster
|
||||
properties:
|
||||
arbiter:
|
||||
description: Arbiter determines if the zone contains the arbiter used for stretch cluster mode
|
||||
type: boolean
|
||||
name:
|
||||
description: Name is the name of the zone
|
||||
type: string
|
||||
volumeClaimTemplate:
|
||||
description: VolumeClaimTemplate is the PVC template
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
finalizers:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
labels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
name:
|
||||
type: string
|
||||
namespace:
|
||||
type: string
|
||||
type: object
|
||||
spec:
|
||||
description: 'spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
|
||||
properties:
|
||||
accessModes:
|
||||
description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
dataSource:
|
||||
description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.'
|
||||
properties:
|
||||
apiGroup:
|
||||
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind is the type of resource being referenced
|
||||
type: string
|
||||
name:
|
||||
description: Name is the name of resource being referenced
|
||||
type: string
|
||||
required:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
dataSourceRef:
|
||||
description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn''t specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn''t set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.'
|
||||
properties:
|
||||
apiGroup:
|
||||
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind is the type of resource being referenced
|
||||
type: string
|
||||
name:
|
||||
description: Name is the name of resource being referenced
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
|
||||
type: string
|
||||
required:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
resources:
|
||||
description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources'
|
||||
properties:
|
||||
claims:
|
||||
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable. It can only be set for containers."
|
||||
items:
|
||||
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
|
||||
properties:
|
||||
name:
|
||||
description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-map-keys:
|
||||
- name
|
||||
x-kubernetes-list-type: map
|
||||
limits:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
|
||||
type: object
|
||||
requests:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
|
||||
type: object
|
||||
type: object
|
||||
selector:
|
||||
description: selector is a label query over volumes to consider for binding.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
storageClassName:
|
||||
description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1'
|
||||
type: string
|
||||
volumeMode:
|
||||
description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.
|
||||
type: string
|
||||
volumeName:
|
||||
description: volumeName is the binding reference to the PersistentVolume backing this claim.
|
||||
type: string
|
||||
type: object
|
||||
status:
|
||||
description: 'status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
|
||||
properties:
|
||||
accessModes:
|
||||
description: 'accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
allocatedResources:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
|
||||
type: object
|
||||
capacity:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: capacity represents the actual resources of the underlying volume.
|
||||
type: object
|
||||
conditions:
|
||||
description: conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.
|
||||
items:
|
||||
description: PersistentVolumeClaimCondition contains details about state of pvc
|
||||
properties:
|
||||
lastProbeTime:
|
||||
description: lastProbeTime is the time we probed the condition.
|
||||
format: date-time
|
||||
type: string
|
||||
lastTransitionTime:
|
||||
description: lastTransitionTime is the time the condition transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: message is the human-readable message indicating details about last transition.
|
||||
type: string
|
||||
reason:
|
||||
description: reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports "ResizeStarted" that means the underlying persistent volume is being resized.
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
type:
|
||||
description: PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type
|
||||
type: string
|
||||
required:
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
phase:
|
||||
description: phase represents the current phase of PersistentVolumeClaim.
|
||||
type: string
|
||||
resizeStatus:
|
||||
description: resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
monitoring:
|
||||
description: Prometheus based Monitoring settings
|
||||
|
||||
+232
-2
@@ -1352,6 +1352,8 @@ spec:
|
||||
maximum: 9
|
||||
minimum: 0
|
||||
type: integer
|
||||
failureDomainLabel:
|
||||
type: string
|
||||
stretchCluster:
|
||||
description: StretchCluster is the stretch cluster specification
|
||||
properties:
|
||||
@@ -1364,10 +1366,10 @@ spec:
|
||||
zones:
|
||||
description: Zones is the list of zones
|
||||
items:
|
||||
description: StretchClusterZoneSpec represents the specification of a stretched zone in a Ceph Cluster
|
||||
description: MonZoneSpec represents the specification of a zone in a Ceph Cluster
|
||||
properties:
|
||||
arbiter:
|
||||
description: Arbiter determines if the zone contains the arbiter
|
||||
description: Arbiter determines if the zone contains the arbiter used for stretch cluster mode
|
||||
type: boolean
|
||||
name:
|
||||
description: Name is the name of the zone
|
||||
@@ -1814,6 +1816,234 @@ spec:
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
zones:
|
||||
description: Zones are specified when we want to provide zonal awareness to mons
|
||||
items:
|
||||
description: MonZoneSpec represents the specification of a zone in a Ceph Cluster
|
||||
properties:
|
||||
arbiter:
|
||||
description: Arbiter determines if the zone contains the arbiter used for stretch cluster mode
|
||||
type: boolean
|
||||
name:
|
||||
description: Name is the name of the zone
|
||||
type: string
|
||||
volumeClaimTemplate:
|
||||
description: VolumeClaimTemplate is the PVC template
|
||||
properties:
|
||||
apiVersion:
|
||||
description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
|
||||
type: string
|
||||
kind:
|
||||
description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
|
||||
type: string
|
||||
metadata:
|
||||
description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata'
|
||||
properties:
|
||||
annotations:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
finalizers:
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
labels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
type: object
|
||||
name:
|
||||
type: string
|
||||
namespace:
|
||||
type: string
|
||||
type: object
|
||||
spec:
|
||||
description: 'spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
|
||||
properties:
|
||||
accessModes:
|
||||
description: 'accessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
dataSource:
|
||||
description: 'dataSource field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot) * An existing PVC (PersistentVolumeClaim) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. When the AnyVolumeDataSource feature gate is enabled, dataSource contents will be copied to dataSourceRef, and dataSourceRef contents will be copied to dataSource when dataSourceRef.namespace is not specified. If the namespace is specified, then dataSourceRef will not be copied to dataSource.'
|
||||
properties:
|
||||
apiGroup:
|
||||
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind is the type of resource being referenced
|
||||
type: string
|
||||
name:
|
||||
description: Name is the name of resource being referenced
|
||||
type: string
|
||||
required:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
dataSourceRef:
|
||||
description: 'dataSourceRef specifies the object from which to populate the volume with data, if a non-empty volume is desired. This may be any object from a non-empty API group (non core object) or a PersistentVolumeClaim object. When this field is specified, volume binding will only succeed if the type of the specified object matches some installed volume populator or dynamic provisioner. This field will replace the functionality of the dataSource field and as such if both fields are non-empty, they must have the same value. For backwards compatibility, when namespace isn''t specified in dataSourceRef, both fields (dataSource and dataSourceRef) will be set to the same value automatically if one of them is empty and the other is non-empty. When namespace is specified in dataSourceRef, dataSource isn''t set to the same value and must be empty. There are three important differences between dataSource and dataSourceRef: * While dataSource only allows two specific types of objects, dataSourceRef allows any non-core object, as well as PersistentVolumeClaim objects. * While dataSource ignores disallowed values (dropping them), dataSourceRef preserves all values, and generates an error if a disallowed value is specified. * While dataSource only allows local objects, dataSourceRef allows objects in any namespaces. (Beta) Using this field requires the AnyVolumeDataSource feature gate to be enabled. (Alpha) Using the namespace field of dataSourceRef requires the CrossNamespaceVolumeDataSource feature gate to be enabled.'
|
||||
properties:
|
||||
apiGroup:
|
||||
description: APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.
|
||||
type: string
|
||||
kind:
|
||||
description: Kind is the type of resource being referenced
|
||||
type: string
|
||||
name:
|
||||
description: Name is the name of resource being referenced
|
||||
type: string
|
||||
namespace:
|
||||
description: Namespace is the namespace of resource being referenced Note that when a namespace is specified, a gateway.networking.k8s.io/ReferenceGrant object is required in the referent namespace to allow that namespace's owner to accept the reference. See the ReferenceGrant documentation for details. (Alpha) This field requires the CrossNamespaceVolumeDataSource feature gate to be enabled.
|
||||
type: string
|
||||
required:
|
||||
- kind
|
||||
- name
|
||||
type: object
|
||||
resources:
|
||||
description: 'resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources'
|
||||
properties:
|
||||
claims:
|
||||
description: "Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. \n This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. \n This field is immutable. It can only be set for containers."
|
||||
items:
|
||||
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
|
||||
properties:
|
||||
name:
|
||||
description: Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container.
|
||||
type: string
|
||||
required:
|
||||
- name
|
||||
type: object
|
||||
type: array
|
||||
x-kubernetes-list-map-keys:
|
||||
- name
|
||||
x-kubernetes-list-type: map
|
||||
limits:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: 'Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
|
||||
type: object
|
||||
requests:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: 'Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
|
||||
type: object
|
||||
type: object
|
||||
selector:
|
||||
description: selector is a label query over volumes to consider for binding.
|
||||
properties:
|
||||
matchExpressions:
|
||||
description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
|
||||
items:
|
||||
description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
|
||||
properties:
|
||||
key:
|
||||
description: key is the label key that the selector applies to.
|
||||
type: string
|
||||
operator:
|
||||
description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||
type: string
|
||||
values:
|
||||
description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
required:
|
||||
- key
|
||||
- operator
|
||||
type: object
|
||||
type: array
|
||||
matchLabels:
|
||||
additionalProperties:
|
||||
type: string
|
||||
description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-map-type: atomic
|
||||
storageClassName:
|
||||
description: 'storageClassName is the name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1'
|
||||
type: string
|
||||
volumeMode:
|
||||
description: volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.
|
||||
type: string
|
||||
volumeName:
|
||||
description: volumeName is the binding reference to the PersistentVolume backing this claim.
|
||||
type: string
|
||||
type: object
|
||||
status:
|
||||
description: 'status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims'
|
||||
properties:
|
||||
accessModes:
|
||||
description: 'accessModes contains the actual access modes the volume backing the PVC has. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1'
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
allocatedResources:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: allocatedResources is the storage resource within AllocatedResources tracks the capacity allocated to a PVC. It may be larger than the actual capacity when a volume expansion operation is requested. For storage quota, the larger value from allocatedResources and PVC.spec.resources is used. If allocatedResources is not set, PVC.spec.resources alone is used for quota calculation. If a volume expansion capacity request is lowered, allocatedResources is only lowered if there are no expansion operations in progress and if the actual volume capacity is equal or lower than the requested capacity. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
|
||||
type: object
|
||||
capacity:
|
||||
additionalProperties:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
description: capacity represents the actual resources of the underlying volume.
|
||||
type: object
|
||||
conditions:
|
||||
description: conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.
|
||||
items:
|
||||
description: PersistentVolumeClaimCondition contains details about state of pvc
|
||||
properties:
|
||||
lastProbeTime:
|
||||
description: lastProbeTime is the time we probed the condition.
|
||||
format: date-time
|
||||
type: string
|
||||
lastTransitionTime:
|
||||
description: lastTransitionTime is the time the condition transitioned from one status to another.
|
||||
format: date-time
|
||||
type: string
|
||||
message:
|
||||
description: message is the human-readable message indicating details about last transition.
|
||||
type: string
|
||||
reason:
|
||||
description: reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports "ResizeStarted" that means the underlying persistent volume is being resized.
|
||||
type: string
|
||||
status:
|
||||
type: string
|
||||
type:
|
||||
description: PersistentVolumeClaimConditionType is a valid value of PersistentVolumeClaimCondition.Type
|
||||
type: string
|
||||
required:
|
||||
- status
|
||||
- type
|
||||
type: object
|
||||
type: array
|
||||
phase:
|
||||
description: phase represents the current phase of PersistentVolumeClaim.
|
||||
type: string
|
||||
resizeStatus:
|
||||
description: resizeStatus stores status of resize operation. ResizeStatus is not set by default but when expansion is complete resizeStatus is set to empty string by resize controller or kubelet. This is an alpha field and requires enabling RecoverVolumeExpansionFailure feature.
|
||||
type: string
|
||||
type: object
|
||||
type: object
|
||||
x-kubernetes-preserve-unknown-fields: true
|
||||
type: object
|
||||
type: array
|
||||
type: object
|
||||
monitoring:
|
||||
description: Prometheus based Monitoring settings
|
||||
|
||||
@@ -50,11 +50,20 @@ func (c *ClusterSpec) IsStretchCluster() bool {
|
||||
return c.Mon.StretchCluster != nil && len(c.Mon.StretchCluster.Zones) > 0
|
||||
}
|
||||
|
||||
func (c *ClusterSpec) ZonesRequired() bool {
|
||||
return c.IsStretchCluster() || len(c.Mon.Zones) > 0
|
||||
}
|
||||
|
||||
func (c *CephCluster) ValidateCreate() (admission.Warnings, error) {
|
||||
if c.Spec.ZonesRequired() {
|
||||
if len(c.Spec.Mon.Zones) < c.Spec.Mon.Count {
|
||||
return nil, errors.New("Not enough zones available for mons, please specify more zones")
|
||||
}
|
||||
}
|
||||
logger.Infof("validate create cephcluster %q", c.ObjectMeta.Name)
|
||||
//If external mode enabled, then check if other fields are empty
|
||||
if c.Spec.External.Enable {
|
||||
if c.Spec.Mon != (MonSpec{}) || c.Spec.Dashboard != (DashboardSpec{}) || !reflect.DeepEqual(c.Spec.Monitoring, (MonitoringSpec{})) || c.Spec.DisruptionManagement != (DisruptionManagementSpec{}) || len(c.Spec.Mgr.Modules) > 0 || len(c.Spec.Network.Provider) > 0 || len(c.Spec.Network.Selectors) > 0 {
|
||||
if !reflect.DeepEqual(c.Spec.Mon, MonSpec{}) || c.Spec.Dashboard != (DashboardSpec{}) || !reflect.DeepEqual(c.Spec.Monitoring, (MonitoringSpec{})) || c.Spec.DisruptionManagement != (DisruptionManagementSpec{}) || len(c.Spec.Mgr.Modules) > 0 || len(c.Spec.Network.Provider) > 0 || len(c.Spec.Network.Selectors) > 0 {
|
||||
return nil, errors.New("invalid create : external mode enabled cannot have mon,dashboard,monitoring,network,disruptionManagement,storage fields in CR")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -530,6 +530,11 @@ type MonSpec struct {
|
||||
// AllowMultiplePerNode determines if we can run multiple monitors on the same node (not recommended)
|
||||
// +optional
|
||||
AllowMultiplePerNode bool `json:"allowMultiplePerNode,omitempty"`
|
||||
// +optional
|
||||
FailureDomainLabel string `json:"failureDomainLabel,omitempty"`
|
||||
// Zones are specified when we want to provide zonal awareness to mons
|
||||
// +optional
|
||||
Zones []MonZoneSpec `json:"zones,omitempty"`
|
||||
// StretchCluster is the stretch cluster specification
|
||||
// +optional
|
||||
StretchCluster *StretchClusterSpec `json:"stretchCluster,omitempty"`
|
||||
@@ -550,15 +555,15 @@ type StretchClusterSpec struct {
|
||||
// Zones is the list of zones
|
||||
// +optional
|
||||
// +nullable
|
||||
Zones []StretchClusterZoneSpec `json:"zones,omitempty"`
|
||||
Zones []MonZoneSpec `json:"zones,omitempty"`
|
||||
}
|
||||
|
||||
// StretchClusterZoneSpec represents the specification of a stretched zone in a Ceph Cluster
|
||||
type StretchClusterZoneSpec struct {
|
||||
// MonZoneSpec represents the specification of a zone in a Ceph Cluster
|
||||
type MonZoneSpec struct {
|
||||
// Name is the name of the zone
|
||||
// +optional
|
||||
Name string `json:"name,omitempty"`
|
||||
// Arbiter determines if the zone contains the arbiter
|
||||
// Arbiter determines if the zone contains the arbiter used for stretch cluster mode
|
||||
// +optional
|
||||
Arbiter bool `json:"arbiter,omitempty"`
|
||||
// VolumeClaimTemplate is the PVC template
|
||||
|
||||
@@ -4252,7 +4252,7 @@ func (in *StretchClusterSpec) DeepCopyInto(out *StretchClusterSpec) {
|
||||
*out = *in
|
||||
if in.Zones != nil {
|
||||
in, out := &in.Zones, &out.Zones
|
||||
*out = make([]StretchClusterZoneSpec, len(*in))
|
||||
*out = make([]MonZoneSpec, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
@@ -4271,7 +4271,7 @@ func (in *StretchClusterSpec) DeepCopy() *StretchClusterSpec {
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StretchClusterZoneSpec) DeepCopyInto(out *StretchClusterZoneSpec) {
|
||||
func (in *MonZoneSpec) DeepCopyInto(out *MonZoneSpec) {
|
||||
*out = *in
|
||||
if in.VolumeClaimTemplate != nil {
|
||||
in, out := &in.VolumeClaimTemplate, &out.VolumeClaimTemplate
|
||||
@@ -4281,12 +4281,12 @@ func (in *StretchClusterZoneSpec) DeepCopyInto(out *StretchClusterZoneSpec) {
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StretchClusterZoneSpec.
|
||||
func (in *StretchClusterZoneSpec) DeepCopy() *StretchClusterZoneSpec {
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MonZoneSpec.
|
||||
func (in *MonZoneSpec) DeepCopy() *MonZoneSpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StretchClusterZoneSpec)
|
||||
out := new(MonZoneSpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -49,25 +49,25 @@ func TestPreClusterStartValidation(t *testing.T) {
|
||||
}{
|
||||
{"no settings", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), Spec: &cephv1.ClusterSpec{}, context: &clusterd.Context{Clientset: testop.New(t, 3)}}}, false},
|
||||
{"even mons", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{Count: 2}}}}, false},
|
||||
{"missing stretch zones", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{
|
||||
{"missing stretch zones", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a"},
|
||||
}}}}}}, true},
|
||||
{"missing arbiter", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{
|
||||
{"missing arbiter", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a"},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
}}}}}}, true},
|
||||
{"missing zone name", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{
|
||||
{"missing zone name", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{
|
||||
{Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
}}}}}}, true},
|
||||
{"valid stretch cluster", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{Count: 3, StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{
|
||||
{"valid stretch cluster", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{Count: 3, StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
}}}}}}, false},
|
||||
{"not enough stretch nodes", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{Count: 5, StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{
|
||||
{"not enough stretch nodes", args{&cluster{ClusterInfo: cephclient.AdminTestClusterInfo("rook-ceph"), context: &clusterd.Context{Clientset: testop.New(t, 3)}, Spec: &cephv1.ClusterSpec{Mon: cephv1.MonSpec{Count: 5, StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
|
||||
@@ -76,10 +76,10 @@ func (c *Cluster) makeDeployment(mgrConfig *mgrConfig) (*apps.Deployment, error)
|
||||
matchLabels := controller.AppLabels(AppName, c.clusterInfo.Namespace)
|
||||
podSpec.Spec.Volumes = append(podSpec.Spec.Volumes, mon.CephSecretVolume())
|
||||
|
||||
// Stretch the mgrs across hosts by default, or across a bigger failure domain for stretch clusters
|
||||
// Stretch the mgrs across hosts by default, or across a bigger failure domain for when zones are required like in case of stretched cluster
|
||||
topologyKey := v1.LabelHostname
|
||||
if c.spec.IsStretchCluster() {
|
||||
topologyKey = mon.StretchFailureDomainLabel(c.spec)
|
||||
if c.spec.ZonesRequired() {
|
||||
topologyKey = mon.GetFailureDomainLabel(c.spec)
|
||||
}
|
||||
k8sutil.SetNodeAntiAffinityForPod(&podSpec.Spec, !c.spec.Mgr.AllowMultiplePerNode, topologyKey, matchLabels, nil)
|
||||
}
|
||||
|
||||
@@ -618,7 +618,7 @@ func (c *Cluster) failoverMon(name string) error {
|
||||
// remove the failed mon from a local list of the existing mons for finding a stretch zone
|
||||
existingMons := c.clusterInfoToMonConfigWithExclude(name)
|
||||
|
||||
zone, err := c.findAvailableZoneIfStretched(existingMons)
|
||||
zone, err := c.findAvailableZone(existingMons)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to find available stretch zone")
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ func TestRemoveExtraMon(t *testing.T) {
|
||||
assert.NotEqual(t, "", removedMon)
|
||||
|
||||
// Don't remove any extra mon from a proper stretch cluster
|
||||
c.spec.Mon.StretchCluster = &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{
|
||||
c.spec.Mon.StretchCluster = &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "x", Arbiter: true},
|
||||
{Name: "y"},
|
||||
{Name: "z"},
|
||||
@@ -265,7 +265,7 @@ func TestSkipMonFailover(t *testing.T) {
|
||||
t.Run("don't skip failover for non-arbiter", func(t *testing.T) {
|
||||
c.spec.Mon.Count = 5
|
||||
c.spec.Mon.StretchCluster = &cephv1.StretchClusterSpec{
|
||||
Zones: []cephv1.StretchClusterZoneSpec{
|
||||
Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a"},
|
||||
{Name: "b"},
|
||||
{Name: "c", Arbiter: true},
|
||||
|
||||
@@ -314,7 +314,7 @@ func (c *Cluster) configureStretchCluster(mons []*monConfig) error {
|
||||
}
|
||||
|
||||
// Create the default crush rule for stretch clusters, that by default will also apply to all pools
|
||||
if err := cephclient.CreateDefaultStretchCrushRule(c.context, c.ClusterInfo, &c.spec, c.stretchFailureDomainName()); err != nil {
|
||||
if err := cephclient.CreateDefaultStretchCrushRule(c.context, c.ClusterInfo, &c.spec, c.getFailureDomainName()); err != nil {
|
||||
return errors.Wrap(err, "failed to create default stretch rule")
|
||||
}
|
||||
|
||||
@@ -322,6 +322,10 @@ func (c *Cluster) configureStretchCluster(mons []*monConfig) error {
|
||||
}
|
||||
|
||||
func (c *Cluster) getArbiterZone() string {
|
||||
if !c.spec.IsStretchCluster() {
|
||||
return ""
|
||||
}
|
||||
|
||||
for _, zone := range c.spec.Mon.StretchCluster.Zones {
|
||||
if zone.Arbiter {
|
||||
return zone.Name
|
||||
@@ -367,7 +371,7 @@ func (c *Cluster) ConfigureArbiter() error {
|
||||
// Wait for the CRUSH map to have at least two zones
|
||||
// The timeout is relatively short since the operator will requeue the reconcile
|
||||
// and try again at a higher level if not yet found
|
||||
failureDomain := c.stretchFailureDomainName()
|
||||
failureDomain := c.getFailureDomainName()
|
||||
logger.Infof("enabling stretch mode... waiting for two failure domains of type %q to be found in the CRUSH map after OSD initialization", failureDomain)
|
||||
pollInterval := 5 * time.Second
|
||||
totalWaitTime := 2 * time.Minute
|
||||
@@ -387,7 +391,7 @@ func (c *Cluster) ConfigureArbiter() error {
|
||||
}
|
||||
|
||||
func (c *Cluster) readyToConfigureArbiter(checkOSDPods bool) (bool, error) {
|
||||
failureDomain := c.stretchFailureDomainName()
|
||||
failureDomain := c.getFailureDomainName()
|
||||
|
||||
if checkOSDPods {
|
||||
// Wait for the OSD pods to be running
|
||||
@@ -528,9 +532,9 @@ func (c *Cluster) initMonConfig(size int) (int, []*monConfig, error) {
|
||||
existingCount := len(c.ClusterInfo.Monitors)
|
||||
for i := len(c.ClusterInfo.Monitors); i < size; i++ {
|
||||
c.maxMonID++
|
||||
zone, err := c.findAvailableZoneIfStretched(mons)
|
||||
zone, err := c.findAvailableZone(mons)
|
||||
if err != nil {
|
||||
return existingCount, mons, errors.Wrap(err, "stretch zone not available")
|
||||
return existingCount, mons, errors.Wrap(err, "zone not available")
|
||||
}
|
||||
mons = append(mons, c.newMonConfig(c.maxMonID, zone))
|
||||
}
|
||||
@@ -595,8 +599,8 @@ func (c *Cluster) newMonConfig(monID int, zone string) *monConfig {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Cluster) findAvailableZoneIfStretched(mons []*monConfig) (string, error) {
|
||||
if !c.spec.IsStretchCluster() {
|
||||
func (c *Cluster) findAvailableZone(mons []*monConfig) (string, error) {
|
||||
if !c.spec.ZonesRequired() {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
@@ -609,14 +613,21 @@ func (c *Cluster) findAvailableZoneIfStretched(mons []*monConfig) (string, error
|
||||
zoneCount[m.Zone]++
|
||||
}
|
||||
|
||||
var zones []cephv1.MonZoneSpec
|
||||
if c.spec.IsStretchCluster() {
|
||||
zones = c.spec.Mon.StretchCluster.Zones
|
||||
} else {
|
||||
zones = c.spec.Mon.Zones
|
||||
}
|
||||
|
||||
// Find a zone in the stretch cluster that still needs an assignment
|
||||
for _, zone := range c.spec.Mon.StretchCluster.Zones {
|
||||
for _, zone := range zones {
|
||||
count, ok := zoneCount[zone.Name]
|
||||
if !ok {
|
||||
// The zone isn't currently assigned to any mon, so return it
|
||||
return zone.Name, nil
|
||||
}
|
||||
if c.spec.Mon.Count == 5 && count == 1 && !zone.Arbiter {
|
||||
if c.spec.IsStretchCluster() && c.spec.Mon.Count == 5 && count == 1 && !zone.Arbiter {
|
||||
// The zone only has 1 mon assigned, but needs 2 mons since it is not the arbiter
|
||||
return zone.Name, nil
|
||||
}
|
||||
@@ -919,8 +930,7 @@ func (c *Cluster) assignMons(mons []*monConfig) error {
|
||||
} else {
|
||||
logger.Infof("mon %q placement using native scheduler", mon.DaemonName)
|
||||
}
|
||||
|
||||
if c.spec.IsStretchCluster() {
|
||||
if c.spec.ZonesRequired() {
|
||||
if schedule == nil {
|
||||
schedule = &controller.MonScheduleInfo{}
|
||||
}
|
||||
@@ -945,21 +955,28 @@ func (c *Cluster) assignMons(mons []*monConfig) error {
|
||||
}
|
||||
|
||||
func (c *Cluster) monVolumeClaimTemplate(mon *monConfig) *v1.PersistentVolumeClaim {
|
||||
if !c.spec.IsStretchCluster() {
|
||||
return c.spec.Mon.VolumeClaimTemplate
|
||||
}
|
||||
|
||||
// If a stretch cluster, a zone can override the template from the default.
|
||||
for _, zone := range c.spec.Mon.StretchCluster.Zones {
|
||||
if zone.Name == mon.Zone {
|
||||
if zone.VolumeClaimTemplate != nil {
|
||||
// Found an override for the volume claim template in the zone
|
||||
return zone.VolumeClaimTemplate
|
||||
if c.spec.ZonesRequired() {
|
||||
// If a stretch cluster, a zone can override the template from the default.
|
||||
|
||||
var zones []cephv1.MonZoneSpec
|
||||
if c.spec.IsStretchCluster() {
|
||||
zones = c.spec.Mon.StretchCluster.Zones
|
||||
} else {
|
||||
zones = c.spec.Mon.Zones
|
||||
}
|
||||
for _, zone := range zones {
|
||||
if zone.Name == mon.Zone {
|
||||
if zone.VolumeClaimTemplate != nil {
|
||||
// Found an override for the volume claim template in the zone
|
||||
return zone.VolumeClaimTemplate
|
||||
}
|
||||
break
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
// Return the default template since one wasn't found in the zone
|
||||
|
||||
// Return the default template since one wasn't found in the zone or zone was not specified
|
||||
return c.spec.Mon.VolumeClaimTemplate
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ func TestConfigureArbiter(t *testing.T) {
|
||||
c := &Cluster{spec: cephv1.ClusterSpec{
|
||||
Mon: cephv1.MonSpec{
|
||||
StretchCluster: &cephv1.StretchClusterSpec{
|
||||
Zones: []cephv1.StretchClusterZoneSpec{
|
||||
Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
@@ -526,22 +526,20 @@ func TestConfigureArbiter(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
func TestFindAvailableZoneMon(t *testing.T) {
|
||||
c := &Cluster{spec: cephv1.ClusterSpec{
|
||||
Mon: cephv1.MonSpec{
|
||||
StretchCluster: &cephv1.StretchClusterSpec{
|
||||
Zones: []cephv1.StretchClusterZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
},
|
||||
Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a"},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
},
|
||||
},
|
||||
}}
|
||||
|
||||
// No mons are assigned to a zone yet
|
||||
existingMons := []*monConfig{}
|
||||
availableZone, err := c.findAvailableZoneIfStretched(existingMons)
|
||||
availableZone, err := c.findAvailableZone(existingMons)
|
||||
assert.NoError(t, err)
|
||||
assert.NotEqual(t, "", availableZone)
|
||||
|
||||
@@ -551,7 +549,7 @@ func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
{ResourceName: "y", Zone: "b"},
|
||||
}
|
||||
c.spec.Mon.Count = 3
|
||||
availableZone, err = c.findAvailableZoneIfStretched(existingMons)
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "c", availableZone)
|
||||
|
||||
@@ -562,7 +560,47 @@ func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
{ResourceName: "z", Zone: "c"},
|
||||
}
|
||||
c.spec.Mon.Count = 3
|
||||
availableZone, err = c.findAvailableZoneIfStretched(existingMons)
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, "", availableZone)
|
||||
}
|
||||
func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
c := &Cluster{spec: cephv1.ClusterSpec{
|
||||
Mon: cephv1.MonSpec{
|
||||
StretchCluster: &cephv1.StretchClusterSpec{
|
||||
Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
|
||||
// No mons are assigned to a zone yet
|
||||
existingMons := []*monConfig{}
|
||||
availableZone, err := c.findAvailableZone(existingMons)
|
||||
assert.NoError(t, err)
|
||||
assert.NotEqual(t, "", availableZone)
|
||||
|
||||
// With 3 mons, we have one available zone
|
||||
existingMons = []*monConfig{
|
||||
{ResourceName: "x", Zone: "a"},
|
||||
{ResourceName: "y", Zone: "b"},
|
||||
}
|
||||
c.spec.Mon.Count = 3
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "c", availableZone)
|
||||
|
||||
// With 3 mons and no available zones
|
||||
existingMons = []*monConfig{
|
||||
{ResourceName: "x", Zone: "a"},
|
||||
{ResourceName: "y", Zone: "b"},
|
||||
{ResourceName: "z", Zone: "c"},
|
||||
}
|
||||
c.spec.Mon.Count = 3
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, "", availableZone)
|
||||
|
||||
@@ -575,7 +613,7 @@ func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
{ResourceName: "q", Zone: "c"},
|
||||
}
|
||||
c.spec.Mon.Count = 5
|
||||
availableZone, err = c.findAvailableZoneIfStretched(existingMons)
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, "", availableZone)
|
||||
|
||||
@@ -586,7 +624,7 @@ func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
{ResourceName: "y", Zone: "b"},
|
||||
{ResourceName: "z", Zone: "c"},
|
||||
}
|
||||
availableZone, err = c.findAvailableZoneIfStretched(existingMons)
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "c", availableZone)
|
||||
|
||||
@@ -597,11 +635,52 @@ func TestFindAvailableZoneForStretchedMon(t *testing.T) {
|
||||
{ResourceName: "y", Zone: "c"},
|
||||
{ResourceName: "z", Zone: "c"},
|
||||
}
|
||||
availableZone, err = c.findAvailableZoneIfStretched(existingMons)
|
||||
availableZone, err = c.findAvailableZone(existingMons)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "a", availableZone)
|
||||
}
|
||||
|
||||
func TestMonVolumeClaimTemplate(t *testing.T) {
|
||||
generalSC := "generalSC"
|
||||
zoneSC := "zoneSC"
|
||||
defaultTemplate := &v1.PersistentVolumeClaim{Spec: v1.PersistentVolumeClaimSpec{StorageClassName: &generalSC}}
|
||||
zoneTemplate := &v1.PersistentVolumeClaim{Spec: v1.PersistentVolumeClaimSpec{StorageClassName: &zoneSC}}
|
||||
type fields struct {
|
||||
spec cephv1.ClusterSpec
|
||||
}
|
||||
type args struct {
|
||||
mon *monConfig
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
fields fields
|
||||
args args
|
||||
want *v1.PersistentVolumeClaim
|
||||
}{
|
||||
{"no template", fields{cephv1.ClusterSpec{}}, args{&monConfig{Zone: "z1"}}, nil},
|
||||
{"default template", fields{cephv1.ClusterSpec{Mon: cephv1.MonSpec{VolumeClaimTemplate: defaultTemplate}}}, args{&monConfig{Zone: "z1"}}, defaultTemplate},
|
||||
{"default template with 3 zones", fields{cephv1.ClusterSpec{Mon: cephv1.MonSpec{
|
||||
VolumeClaimTemplate: defaultTemplate,
|
||||
Zones: []cephv1.MonZoneSpec{{Name: "z1"}, {Name: "z2"}, {Name: "z3"}}}}},
|
||||
args{&monConfig{Zone: "z1"}},
|
||||
defaultTemplate},
|
||||
{"overridden template", fields{cephv1.ClusterSpec{Mon: cephv1.MonSpec{
|
||||
VolumeClaimTemplate: defaultTemplate,
|
||||
Zones: []cephv1.MonZoneSpec{{Name: "z1", VolumeClaimTemplate: zoneTemplate}, {Name: "z2"}, {Name: "z3"}}}}},
|
||||
args{&monConfig{Zone: "z1"}},
|
||||
zoneTemplate},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
c := &Cluster{
|
||||
spec: tt.fields.spec,
|
||||
}
|
||||
if got := c.monVolumeClaimTemplate(tt.args.mon); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Cluster.monVolumeClaimTemplate() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
func TestStretchMonVolumeClaimTemplate(t *testing.T) {
|
||||
generalSC := "generalSC"
|
||||
zoneSC := "zoneSC"
|
||||
@@ -623,12 +702,12 @@ func TestStretchMonVolumeClaimTemplate(t *testing.T) {
|
||||
{"default template", fields{cephv1.ClusterSpec{Mon: cephv1.MonSpec{VolumeClaimTemplate: defaultTemplate}}}, args{&monConfig{Zone: "z1"}}, defaultTemplate},
|
||||
{"default template with 3 zones", fields{cephv1.ClusterSpec{Mon: cephv1.MonSpec{
|
||||
VolumeClaimTemplate: defaultTemplate,
|
||||
StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{{Name: "z1"}, {Name: "z2"}, {Name: "z3"}}}}}},
|
||||
StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{{Name: "z1"}, {Name: "z2"}, {Name: "z3"}}}}}},
|
||||
args{&monConfig{Zone: "z1"}},
|
||||
defaultTemplate},
|
||||
{"overridden template", fields{cephv1.ClusterSpec{Mon: cephv1.MonSpec{
|
||||
VolumeClaimTemplate: defaultTemplate,
|
||||
StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.StretchClusterZoneSpec{{Name: "z1", VolumeClaimTemplate: zoneTemplate}, {Name: "z2"}, {Name: "z3"}}}}}},
|
||||
StretchCluster: &cephv1.StretchClusterSpec{Zones: []cephv1.MonZoneSpec{{Name: "z1", VolumeClaimTemplate: zoneTemplate}, {Name: "z2"}, {Name: "z3"}}}}}},
|
||||
args{&monConfig{Zone: "z1"}},
|
||||
zoneTemplate},
|
||||
}
|
||||
@@ -665,7 +744,7 @@ func TestArbiterPlacement(t *testing.T) {
|
||||
c := &Cluster{spec: cephv1.ClusterSpec{
|
||||
Mon: cephv1.MonSpec{
|
||||
StretchCluster: &cephv1.StretchClusterSpec{
|
||||
Zones: []cephv1.StretchClusterZoneSpec{
|
||||
Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
@@ -701,7 +780,7 @@ func TestCheckIfArbiterReady(t *testing.T) {
|
||||
spec: cephv1.ClusterSpec{
|
||||
Mon: cephv1.MonSpec{
|
||||
StretchCluster: &cephv1.StretchClusterSpec{
|
||||
Zones: []cephv1.StretchClusterZoneSpec{
|
||||
Zones: []cephv1.MonZoneSpec{
|
||||
{Name: "a", Arbiter: true},
|
||||
{Name: "b"},
|
||||
{Name: "c"},
|
||||
|
||||
@@ -56,15 +56,15 @@ func (c *Cluster) getLabels(monConfig *monConfig, canary, includeNewLabels bool)
|
||||
labels["pvc_size"] = size.String()
|
||||
}
|
||||
if monConfig.Zone != "" {
|
||||
labels["stretch-zone"] = monConfig.Zone
|
||||
labels["zone"] = monConfig.Zone
|
||||
}
|
||||
}
|
||||
|
||||
return labels
|
||||
}
|
||||
|
||||
func (c *Cluster) stretchFailureDomainName() string {
|
||||
label := StretchFailureDomainLabel(c.spec)
|
||||
func (c *Cluster) getFailureDomainName() string {
|
||||
label := GetFailureDomainLabel(c.spec)
|
||||
index := strings.Index(label, "/")
|
||||
if index == -1 {
|
||||
return label
|
||||
@@ -72,8 +72,13 @@ func (c *Cluster) stretchFailureDomainName() string {
|
||||
return label[index+1:]
|
||||
}
|
||||
|
||||
func StretchFailureDomainLabel(spec cephv1.ClusterSpec) string {
|
||||
if spec.Mon.StretchCluster.FailureDomainLabel != "" {
|
||||
func GetFailureDomainLabel(spec cephv1.ClusterSpec) string {
|
||||
|
||||
if spec.IsStretchCluster() && spec.Mon.StretchCluster.FailureDomainLabel != "" {
|
||||
return spec.Mon.StretchCluster.FailureDomainLabel
|
||||
}
|
||||
|
||||
if spec.ZonesRequired() && spec.Mon.FailureDomainLabel != "" {
|
||||
return spec.Mon.StretchCluster.FailureDomainLabel
|
||||
}
|
||||
// The default topology label is for a zone
|
||||
@@ -217,8 +222,8 @@ func (c *Cluster) makeMonPod(monConfig *monConfig, canary bool) (*corev1.Pod, er
|
||||
}
|
||||
}
|
||||
|
||||
if c.spec.IsStretchCluster() {
|
||||
nodeAffinity, err := k8sutil.GenerateNodeAffinity(fmt.Sprintf("%s=%s", StretchFailureDomainLabel(c.spec), monConfig.Zone))
|
||||
if c.spec.ZonesRequired() {
|
||||
nodeAffinity, err := k8sutil.GenerateNodeAffinity(fmt.Sprintf("%s=%s", GetFailureDomainLabel(c.spec), monConfig.Zone))
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "failed to generate mon %q node affinity", monConfig.DaemonName)
|
||||
}
|
||||
@@ -322,7 +327,7 @@ func (c *Cluster) makeMonDaemonContainer(monConfig *monConfig) corev1.Container
|
||||
}
|
||||
|
||||
if monConfig.Zone != "" {
|
||||
desiredLocation := fmt.Sprintf("%s=%s", c.stretchFailureDomainName(), monConfig.Zone)
|
||||
desiredLocation := fmt.Sprintf("%s=%s", c.getFailureDomainName(), monConfig.Zone)
|
||||
container.Args = append(container.Args, []string{"--set-crush-location", desiredLocation}...)
|
||||
if monConfig.Zone == c.getArbiterZone() {
|
||||
// remember the arbiter mon to be set later in the reconcile after the OSDs are configured
|
||||
|
||||
Reference in new issue
Block a user