mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
Merge branch 'main' into feat/harbor-ha-replicas
Signed-off-by: Mattia Eleuteri <mattia@hidora.io> Assisted-by: LLM
This commit is contained in:
6 files changed
+110
-14
No files matched your search
@@ -3,6 +3,9 @@ apiVersion: objectstorage.k8s.io/v1alpha1
|
||||
kind: BucketClaim
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-registry
|
||||
labels:
|
||||
release: {{ .Release.Name }}-system
|
||||
component: registry
|
||||
spec:
|
||||
bucketClassName: {{ $seaweedfs }}
|
||||
protocols:
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
suite: registry BucketClaim is selected by the registry WorkloadMonitor
|
||||
|
||||
release:
|
||||
name: harbor
|
||||
namespace: tenant-test
|
||||
|
||||
# The WorkloadMonitor controller lists BucketClaims by the monitor's selector,
|
||||
# so a BucketClaim without matching labels gets no Workload and its storage
|
||||
# never reaches billing. The registry keeps its images in this bucket, so it is
|
||||
# reported under the registry monitor, as the registry PVC was before storage
|
||||
# moved to S3. Both sides are asserted so that renaming either one fails here.
|
||||
set:
|
||||
_namespace:
|
||||
host: example.org
|
||||
ingress: nginx
|
||||
gateway: ""
|
||||
seaweedfs: seaweedfs
|
||||
_cluster:
|
||||
solver: http01
|
||||
|
||||
tests:
|
||||
- it: labels the registry BucketClaim with the registry monitor's selector
|
||||
template: templates/bucket.yaml
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: BucketClaim
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
release: harbor-system
|
||||
component: registry
|
||||
|
||||
- it: selects the registry BucketClaim from the registry monitor
|
||||
template: templates/harbor.yaml
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: harbor-registry
|
||||
asserts:
|
||||
- isKind:
|
||||
of: WorkloadMonitor
|
||||
- equal:
|
||||
path: spec.selector
|
||||
value:
|
||||
release: harbor-system
|
||||
component: registry
|
||||
@@ -473,6 +473,17 @@ spec:
|
||||
{{- end }}
|
||||
- metadata:
|
||||
name: disk-system
|
||||
{{- /* The worker WorkloadMonitor selects PVCs by these labels. CAPK
|
||||
stamps cluster-name and role on the VM and its VMI template
|
||||
only, copying dataVolumeTemplates verbatim, and CDI copies a
|
||||
DataVolume's labels onto the PVC it creates -- so without them
|
||||
here the disk is never tracked as a Workload. cluster-name must
|
||||
NOT be added: the Kubernetes backup strategy selects DataVolumes
|
||||
and PVCs by it, and would then back up and restore-in-place
|
||||
every worker root disk as cluster data. */}}
|
||||
labels:
|
||||
cluster.x-k8s.io/deployment-name: {{ .clusterName }}-{{ .groupName }}
|
||||
cluster.x-k8s.io/role: worker
|
||||
{{- /* usePopulator=false stays ONLY on the HTTP/import path: it preserves
|
||||
the legacy import behaviour and keeps an image-omitted DV — hence the
|
||||
KMT hash — byte-identical to the pre-feature render, so those workers
|
||||
@@ -1138,8 +1149,11 @@ spec:
|
||||
{{- end }}
|
||||
kind: kubernetes
|
||||
type: worker
|
||||
{{- /* No cluster-name here: deployment-name already names one
|
||||
MachineDeployment in the namespace, and requiring cluster-name would
|
||||
force it onto the worker disk, which the Kubernetes backup strategy
|
||||
would then select (see the disk-system labels above). */}}
|
||||
selector:
|
||||
cluster.x-k8s.io/cluster-name: {{ $clusterName }}
|
||||
cluster.x-k8s.io/deployment-name: {{ $clusterName }}-{{ $groupName }}
|
||||
cluster.x-k8s.io/role: worker
|
||||
version: {{ $.Chart.Version }}
|
||||
|
||||
@@ -3,7 +3,7 @@ matches the golden render of a GPU pool:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
|
||||
kind: KubevirtMachineTemplate
|
||||
metadata:
|
||||
name: kubernetes-myk8s-md0-8ed0ab
|
||||
name: kubernetes-myk8s-md0-26667b
|
||||
namespace: tenant-test
|
||||
spec:
|
||||
template:
|
||||
@@ -19,6 +19,9 @@ matches the golden render of a GPU pool:
|
||||
- metadata:
|
||||
annotations:
|
||||
cdi.kubevirt.io/storage.usePopulator: "false"
|
||||
labels:
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
name: disk-system
|
||||
spec:
|
||||
source:
|
||||
@@ -115,7 +118,7 @@ matches the golden render of a GPU pool:
|
||||
infrastructureRef:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
|
||||
kind: KubevirtMachineTemplate
|
||||
name: kubernetes-myk8s-md0-8ed0ab
|
||||
name: kubernetes-myk8s-md0-26667b
|
||||
namespace: tenant-test
|
||||
version: v1.35.6
|
||||
3: |
|
||||
@@ -149,7 +152,6 @@ matches the golden render of a GPU pool:
|
||||
kind: kubernetes
|
||||
minReplicas: 0
|
||||
selector:
|
||||
cluster.x-k8s.io/cluster-name: kubernetes-myk8s
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
type: worker
|
||||
@@ -159,7 +161,7 @@ matches the golden render of a kubelet-override pool:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
|
||||
kind: KubevirtMachineTemplate
|
||||
metadata:
|
||||
name: kubernetes-myk8s-md0-2d362e
|
||||
name: kubernetes-myk8s-md0-04d5d9
|
||||
namespace: tenant-test
|
||||
spec:
|
||||
template:
|
||||
@@ -175,6 +177,9 @@ matches the golden render of a kubelet-override pool:
|
||||
- metadata:
|
||||
annotations:
|
||||
cdi.kubevirt.io/storage.usePopulator: "false"
|
||||
labels:
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
name: disk-system
|
||||
spec:
|
||||
source:
|
||||
@@ -268,7 +273,7 @@ matches the golden render of a kubelet-override pool:
|
||||
infrastructureRef:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
|
||||
kind: KubevirtMachineTemplate
|
||||
name: kubernetes-myk8s-md0-2d362e
|
||||
name: kubernetes-myk8s-md0-04d5d9
|
||||
namespace: tenant-test
|
||||
version: v1.35.6
|
||||
3: |
|
||||
@@ -302,7 +307,6 @@ matches the golden render of a kubelet-override pool:
|
||||
kind: kubernetes
|
||||
minReplicas: 0
|
||||
selector:
|
||||
cluster.x-k8s.io/cluster-name: kubernetes-myk8s
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
type: worker
|
||||
@@ -312,7 +316,7 @@ matches the golden render of the pool objects:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
|
||||
kind: KubevirtMachineTemplate
|
||||
metadata:
|
||||
name: kubernetes-myk8s-md0-a6ac3e
|
||||
name: kubernetes-myk8s-md0-57ef01
|
||||
namespace: tenant-test
|
||||
spec:
|
||||
template:
|
||||
@@ -329,6 +333,9 @@ matches the golden render of the pool objects:
|
||||
- metadata:
|
||||
annotations:
|
||||
cdi.kubevirt.io/storage.usePopulator: "false"
|
||||
labels:
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
name: disk-system
|
||||
spec:
|
||||
source:
|
||||
@@ -424,7 +431,7 @@ matches the golden render of the pool objects:
|
||||
infrastructureRef:
|
||||
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
|
||||
kind: KubevirtMachineTemplate
|
||||
name: kubernetes-myk8s-md0-a6ac3e
|
||||
name: kubernetes-myk8s-md0-57ef01
|
||||
namespace: tenant-test
|
||||
version: v1.35.6
|
||||
3: |
|
||||
@@ -458,7 +465,6 @@ matches the golden render of the pool objects:
|
||||
kind: kubernetes
|
||||
minReplicas: 0
|
||||
selector:
|
||||
cluster.x-k8s.io/cluster-name: kubernetes-myk8s
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
type: worker
|
||||
|
||||
@@ -115,8 +115,35 @@ tests:
|
||||
path: spec.type
|
||||
value: worker
|
||||
- equal:
|
||||
path: spec.selector["cluster.x-k8s.io/cluster-name"]
|
||||
value: kubernetes-myk8s
|
||||
path: spec.selector
|
||||
value:
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
|
||||
# CDI copies the DataVolume's labels onto the PVC it creates, and CAPK does
|
||||
# not label dataVolumeTemplates, so the worker disk only joins the
|
||||
# WorkloadMonitor above if the template carries its whole selector.
|
||||
- it: labels the worker disk with the WorkloadMonitor selector
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: KubevirtMachineTemplate
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.virtualMachineTemplate.spec.dataVolumeTemplates[0].metadata.labels
|
||||
value:
|
||||
cluster.x-k8s.io/deployment-name: kubernetes-myk8s-md0
|
||||
cluster.x-k8s.io/role: worker
|
||||
|
||||
# The Kubernetes backup strategy selects DataVolumes and PVCs by
|
||||
# cluster-name, so carrying it would back up every worker root disk and make
|
||||
# an in-place restore delete and restore it as cluster data.
|
||||
- it: keeps cluster-name off the worker disk
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: KubevirtMachineTemplate
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.virtualMachineTemplate.spec.dataVolumeTemplates[0].metadata.labels["cluster.x-k8s.io/cluster-name"]
|
||||
---
|
||||
suite: worker node pool validation
|
||||
templates:
|
||||
|
||||
@@ -246,7 +246,7 @@ tests:
|
||||
value: KubevirtMachineTemplate
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: kubernetes-myk8s-md0-ce2335
|
||||
value: kubernetes-myk8s-md0-d5921f
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: KubevirtMachineTemplate
|
||||
@@ -314,7 +314,7 @@ tests:
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: kubernetes-myk8s-md0-ce2335
|
||||
value: kubernetes-myk8s-md0-d5921f
|
||||
|
||||
# KubeVirt declares cores as uint32, so a count past its ceiling cannot size
|
||||
# the guest even though it is a whole number.
|
||||
|
||||
Reference in new issue
Block a user