-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: allow reconcile on storage size changes #1651
Open
coleenquadros
wants to merge
6
commits into
stolostron:main
Choose a base branch
from
coleenquadros:fix_reconcile
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+78
−26
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1b553fd
allow reconcile on storage size chnages
coleenquadros 9b08519
test additional cluster
coleenquadros 0873e27
add logs
coleenquadros 476d4bb
update
coleenquadros 328bd1c
update
coleenquadros 5d664fb
update
coleenquadros File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,8 @@ AGENT_NS="open-cluster-management-agent" | |
HUB_NS="open-cluster-management-hub" | ||
OBSERVABILITY_NS="open-cluster-management-observability" | ||
IMAGE_REPO="quay.io/stolostron" | ||
export MANAGED_CLUSTER="local-cluster" # registration-operator needs this | ||
export LOCAL_CLUSTER="local-cluster" # registration-operator needs this | ||
export MANAGED_CLUSTER="managed-cluster" # registration-operator needs this | ||
|
||
SED_COMMAND=${SED}' -i-e -e' | ||
|
||
|
@@ -45,7 +46,7 @@ deploy_hub_spoke_core() { | |
if [[ ! -d "_repo_ocm" ]]; then | ||
git clone --depth 1 --branch $OCM_BRANCH https://github.com/stolostron/ocm.git ./_repo_ocm | ||
fi | ||
${SED_COMMAND} "s~clusterName: cluster1$~clusterName: ${MANAGED_CLUSTER}~g" ./_repo_ocm/deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml | ||
${SED_COMMAND} "s~clusterName: cluster1$~clusterName: ${LOCAL_CLUSTER}~g" ./_repo_ocm/deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml | ||
|
||
make deploy-hub cluster-ip deploy-spoke-operator apply-spoke-cr -C ./_repo_ocm | ||
|
||
|
@@ -57,28 +58,53 @@ deploy_hub_spoke_core() { | |
kubectl -n "${HUB_NS}" rollout status deploy cluster-manager-registration-controller --timeout=120s | ||
kubectl -n "${HUB_NS}" rollout status deploy cluster-manager-registration-webhook --timeout=120s | ||
kubectl -n "${HUB_NS}" rollout status deploy cluster-manager-work-webhook --timeout=120s | ||
|
||
} | ||
|
||
deploy_managed_cluster() { | ||
cd ${ROOTDIR} | ||
|
||
export OCM_BRANCH=main | ||
export IMAGE_NAME=quay.io/stolostron/registration-operator:$LATEST_SNAPSHOT | ||
export REGISTRATION_OPERATOR_IMAGE=quay.io/stolostron/registration-operator:$LATEST_SNAPSHOT | ||
export REGISTRATION_IMAGE=quay.io/stolostron/registration:$LATEST_SNAPSHOT | ||
export WORK_IMAGE=quay.io/stolostron/work:$LATEST_SNAPSHOT | ||
export PLACEMENT_IMAGE=quay.io/stolostron/placement:$LATEST_SNAPSHOT | ||
export ADDON_MANAGER_IMAGE=quay.io/stolostron/addon-manager:$LATEST_SNAPSHOT | ||
|
||
if [[ ! -d "_repo_ocm_2" ]]; then | ||
git clone --depth 1 --branch $OCM_BRANCH https://github.com/stolostron/ocm.git ./_repo_ocm_2 | ||
fi | ||
${SED_COMMAND} "s~clusterName: cluster1$~clusterName: ${MANAGED_CLUSTER}~g" ./_repo_ocm_2/deploy/klusterlet/config/samples/operator_open-cluster-management_klusterlets.cr.yaml | ||
|
||
make cluster-ip deploy-spoke-operator apply-spoke-cr -C ./_repo_ocm_2 | ||
} | ||
|
||
|
||
# approve the CSR for cluster join request | ||
approve_csr_joinrequest() { | ||
echo "wait for CSR for cluster join reqest is created..." | ||
for i in {1..60}; do | ||
# TODO(morvencao): remove the hard-coded cluster label | ||
csrs=$(kubectl get csr -lopen-cluster-management.io/cluster-name=${MANAGED_CLUSTER}) | ||
if [[ -n ${csrs} ]]; then | ||
csrnames=$(kubectl get csr -lopen-cluster-management.io/cluster-name=${MANAGED_CLUSTER} -o jsonpath={.items..metadata.name}) | ||
for csrname in ${csrnames}; do | ||
echo "approve CSR: ${csrname}" | ||
kubectl certificate approve ${csrname} | ||
done | ||
break | ||
fi | ||
if [[ ${i} -eq 60 ]]; then | ||
echo "timeout wait for CSR is created." | ||
exit 1 | ||
fi | ||
echo "retrying in 10s..." | ||
sleep 10 | ||
clusters=($LOCAL_CLUSTER $MANAGED_CLUSTER) | ||
for cluster in "${clusters[@]}"; do | ||
echo "Processing CSR for cluster: $cluster" | ||
for i in {1..60}; do | ||
# TODO(morvencao): remove the hard-coded cluster label | ||
csrs=$(kubectl get csr -lopen-cluster-management.io/cluster-name=${cluster}) | ||
if [[ -n ${csrs} ]]; then | ||
csrnames=$(kubectl get csr -lopen-cluster-management.io/cluster-name=${cluster} -o jsonpath={.items..metadata.name}) | ||
for csrname in ${csrnames}; do | ||
echo "approve CSR: ${csrname}" | ||
kubectl certificate approve ${csrname} | ||
done | ||
break | ||
fi | ||
if [[ ${i} -eq 60 ]]; then | ||
echo "timeout wait for CSR is created." | ||
exit 1 | ||
fi | ||
echo "retrying in 10s..." | ||
sleep 10 | ||
done | ||
done | ||
|
||
for i in {1..20}; do | ||
|
@@ -234,6 +260,7 @@ wait_for_deployment_ready() { | |
# function execute is the main routine to do the actual work | ||
execute() { | ||
deploy_hub_spoke_core | ||
deploy_managed_cluster | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The managed cluster tests are great! But should be a separate PR. |
||
approve_csr_joinrequest | ||
deploy_mco_operator | ||
deploy_grafana_test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,7 +245,7 @@ func (r *MultiClusterObservabilityReconciler) Reconcile(ctx context.Context, req | |
|
||
// handle storagesize changes | ||
result, err := r.HandleStorageSizeChange(instance) | ||
if result != nil { | ||
if err != nil { | ||
return *result, err | ||
} | ||
|
||
|
@@ -372,13 +372,13 @@ func (r *MultiClusterObservabilityReconciler) Reconcile(ctx context.Context, req | |
|
||
// create an Observatorium CR | ||
result, err = GenerateObservatoriumCR(r.Client, r.Scheme, instance) | ||
if result != nil { | ||
if err != nil { | ||
return *result, err | ||
} | ||
|
||
// generate grafana datasource to point to observatorium api gateway | ||
result, err = GenerateGrafanaDataSource(r.Client, r.Scheme, instance) | ||
if result != nil { | ||
if err != nil { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the fix? Only returning if we have a nil error? |
||
return *result, err | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
024-10-24T15:26:45.177Z INFO controller_multiclustermonitoring Coleen Old observatorium CR spec {"oldSpec": {"image":"registry.redhat.io/rhacm2/thanos-rhel9@sha256:caf27fd686b2ae1d6cb0ebe02cf195a2e7caece3ac8bda0c0e88f92678da6bd2","imagePullPolicy":"IfNotPresent","compact":{"replicas":1,"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"200Gi"}},"storageClassName":"gp3-csi"}},"retentionResolutionRaw":"365d","retentionResolution5m":"365d","retentionResolution1h":"365d","enableDownsampling":true,"resources":{"requests":{"cpu":"100m","memory":"512Mi"}},"serviceMonitor":true,"deleteDelay":"48h"},"receiveController":{"image":"registry.redhat.io/rhacm2/thanos-receive-controller-rhel9@sha256:739292da294b1b536cfea4d4cb63bc39f95cb917695026b1660f9022a73d58ee","imagePullPolicy":"IfNotPresent","version":"master-2022-04-01-b58820f","resources":{"requests":{"cpu":"4m","memory":"32Mi"}},"serviceMonitor":true},"receivers":{"replicas":3,"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"100Gi"}},"storageClassName":"gp3-csi"}},"replicationFactor":3,"resources":{"requests":{"cpu":"300m","memory":"512Mi"}},"serviceMonitor":true,"retention":"24h"},"queryFrontend":{"replicas":2,"resources":{"requests":{"cpu":"100m","memory":"256Mi"}},"serviceMonitor":true,"cache":{"image":"registry.redhat.io/rhacm2/memcached-rhel9@sha256:9600034019ce695e89aecb6ac255d591b201fc40a7f3d9796f42d043f0340623","imagePullPolicy":"IfNotPresent","version":"1.6.3-alpine","exporterImage":"registry.redhat.io/rhacm2/memcached-exporter-rhel9@sha256:2c6e39ecbeed3dc4d30225b9a2ed0840c6d41c032ee08d63c7f8f092f3ee81e6","exporterImagePullPolicy":"IfNotPresent","exporterVersion":"v0.9.0","replicas":3,"memoryLimitMb":1024,"maxItemSize":"1m","connectionLimit":1024,"resources":{"requests":{"cpu":"45m","memory":"128Mi"}},"exporterResources":{"requests":{"cpu":"5m","memory":"50Mi"}},"serviceMonitor":true}},"store":{"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Gi"}},"storageClassName":"gp3-csi"}},"shards":3,"cache":{"image":"registry.redhat.io/rhacm2/memcached-rhel9@sha256:9600034019ce695e89aecb6ac255d591b201fc40a7f3d9796f42d043f0340623","imagePullPolicy":"IfNotPresent","version":"1.6.3-alpine","exporterImage":"registry.redhat.io/rhacm2/memcached-exporter-rhel9@sha256:2c6e39ecbeed3dc4d30225b9a2ed0840c6d41c032ee08d63c7f8f092f3ee81e6","exporterImagePullPolicy":"IfNotPresent","exporterVersion":"v0.9.0","replicas":3,"memoryLimitMb":1024,"maxItemSize":"1m","connectionLimit":1024,"resources":{"requests":{"cpu":"45m","memory":"128Mi"}},"exporterResources":{"requests":{"cpu":"5m","memory":"50Mi"}},"serviceMonitor":true},"resources":{"requests":{"cpu":"100m","memory":"1Gi"}},"serviceMonitor":true},"rule":{"replicas":3,"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"2Gi"}},"storageClassName":"gp3-csi"}},"rulesConfig":[{"name":"thanos-ruler-default-rules","key":"default_rules.yaml"}],"extraVolumeMounts":[{"type":"configMap","mountPath":"/etc/thanos/configmaps/alertmanager-ca-bundle","name":"alertmanager-ca-bundle","key":"service-ca.crt"}],"alertmanagerConfigFile":{"name":"thanos-ruler-config","key":"config.yaml"},"reloaderImage":"registry.redhat.io/openshift4/ose-configmap-reloader@sha256:fa5b2e42a27e3ab5f0a0d2a103b5602b81d1b29eb788b54cc60ad547744ad053","reloaderImagePullPolicy":"IfNotPresent","resources":{"requests":{"cpu":"50m","memory":"512Mi"}},"reloaderResources":{"requests":{"cpu":"4m","memory":"25Mi"}},"serviceMonitor":true,"blockDuration":"2h","retention":"24h","evalInterval":"300s"},"query":{"replicas":2,"resources":{"requests":{"cpu":"300m","memory":"1Gi"}},"serviceMonitor":true,"lookbackDelta":"600s"}}} | ||
2024-10-24T15:26:45.177Z INFO controller_multiclustermonitoring Coleen New observatorium CR spec {"newSpec": {"image":"registry.redhat.io/rhacm2/thanos-rhel9@sha256:caf27fd686b2ae1d6cb0ebe02cf195a2e7caece3ac8bda0c0e88f92678da6bd2","imagePullPolicy":"IfNotPresent","compact":{"replicas":1,"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"250Gi"}},"storageClassName":"gp3-csi"}},"retentionResolutionRaw":"365d","retentionResolution5m":"365d","retentionResolution1h":"365d","enableDownsampling":true,"resources":{"requests":{"cpu":"500m","memory":"1Gi"}},"serviceMonitor":true,"deleteDelay":"48h"},"receiveController":{"image":"registry.redhat.io/rhacm2/thanos-receive-controller-rhel9@sha256:739292da294b1b536cfea4d4cb63bc39f95cb917695026b1660f9022a73d58ee","imagePullPolicy":"IfNotPresent","version":"master-2022-04-01-b58820f","resources":{"requests":{"cpu":"4m","memory":"32Mi"}},"serviceMonitor":true},"receivers":{"replicas":3,"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"100Gi"}},"storageClassName":"gp3-csi"}},"replicationFactor":3,"resources":{"requests":{"cpu":"300m","memory":"512Mi"}},"serviceMonitor":true,"retention":"24h"},"queryFrontend":{"replicas":2,"resources":{"requests":{"cpu":"100m","memory":"256Mi"}},"serviceMonitor":true,"cache":{"image":"registry.redhat.io/rhacm2/memcached-rhel9@sha256:9600034019ce695e89aecb6ac255d591b201fc40a7f3d9796f42d043f0340623","imagePullPolicy":"IfNotPresent","version":"1.6.3-alpine","exporterImage":"registry.redhat.io/rhacm2/memcached-exporter-rhel9@sha256:2c6e39ecbeed3dc4d30225b9a2ed0840c6d41c032ee08d63c7f8f092f3ee81e6","exporterImagePullPolicy":"IfNotPresent","exporterVersion":"v0.9.0","replicas":3,"memoryLimitMb":1024,"maxItemSize":"1m","connectionLimit":1024,"resources":{"requests":{"cpu":"45m","memory":"128Mi"}},"exporterResources":{"requests":{"cpu":"5m","memory":"50Mi"}},"serviceMonitor":true}},"store":{"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Gi"}},"storageClassName":"gp3-csi"}},"shards":3,"cache":{"image":"registry.redhat.io/rhacm2/memcached-rhel9@sha256:9600034019ce695e89aecb6ac255d591b201fc40a7f3d9796f42d043f0340623","imagePullPolicy":"IfNotPresent","version":"1.6.3-alpine","exporterImage":"registry.redhat.io/rhacm2/memcached-exporter-rhel9@sha256:2c6e39ecbeed3dc4d30225b9a2ed0840c6d41c032ee08d63c7f8f092f3ee81e6","exporterImagePullPolicy":"IfNotPresent","exporterVersion":"v0.9.0","replicas":3,"memoryLimitMb":1024,"maxItemSize":"1m","connectionLimit":1024,"resources":{"requests":{"cpu":"45m","memory":"128Mi"}},"exporterResources":{"requests":{"cpu":"5m","memory":"50Mi"}},"serviceMonitor":true},"resources":{"requests":{"cpu":"100m","memory":"1Gi"}},"serviceMonitor":true},"rule":{"replicas":3,"volumeClaimTemplate":{"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"2Gi"}},"storageClassName":"gp3-csi"}},"rulesConfig":[{"name":"thanos-ruler-default-rules","key":"default_rules.yaml"}],"extraVolumeMounts":[{"type":"configMap","mountPath":"/etc/thanos/configmaps/alertmanager-ca-bundle","name":"alertmanager-ca-bundle","key":"service-ca.crt"}],"alertmanagerConfigFile":{"name":"thanos-ruler-config","key":"config.yaml"},"reloaderImage":"registry.redhat.io/openshift4/ose-configmap-reloader@sha256:fa5b2e42a27e3ab5f0a0d2a103b5602b81d1b29eb788b54cc60ad547744ad053","reloaderImagePullPolicy":"IfNotPresent","resources":{"requests":{"cpu":"50m","memory":"512Mi"}},"reloaderResources":{"requests":{"cpu":"4m","memory":"25Mi"}},"serviceMonitor":true,"blockDuration":"2h","retention":"24h","evalInterval":"300s"},"query":{"replicas":2,"resources":{"requests":{"cpu":"300m","memory":"1Gi"}},"serviceMonitor":true,"lookbackDelta":"600s"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: Cluster | ||
apiVersion: kind.x-k8s.io/v1alpha4 | ||
nodes: | ||
- role: control-plane | ||
extraPortMappings: | ||
- containerPort: 80 | ||
hostPort: 81 | ||
listenAddress: "0.0.0.0" | ||
- containerPort: 443 | ||
hostPort: 444 | ||
listenAddress: "0.0.0.0" | ||
- containerPort: 6443 | ||
hostPort: 32807 | ||
listenAddress: "0.0.0.0" | ||
- containerPort: 31001 | ||
hostPort: 31002 | ||
listenAddress: "127.0.0.1" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?