Skip to content
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

What could be the reasons that Karmada search is not syncing data to the OpenSearch backend store? #5753

Open
mohamedawnallah opened this issue Oct 28, 2024 · 2 comments
Labels
kind/question Indicates an issue that is a support question.

Comments

@mohamedawnallah
Copy link
Contributor

mohamedawnallah commented Oct 28, 2024

Please provide an in-depth description of the question you have:

I've been following the Karmada search documentation, but data hasn't been automatically uploaded to the OpenSearch backend. Additionally, the logs show no indication of when syncing happens with the backend store.

Logs:

dev@test:$ kubectl logs pod/karmada-search-bb6c75bc7-tl27g -n karmada-system --context karmada-host
...
I1028 11:54:10.836710       1 multi_cluster_cache.go:100] Add cache for cluster member2
I1028 11:54:10.836741       1 cluster_cache.go:86] Add cache for member2 apps/v1, Resource=deployments
I1028 11:54:10.836808       1 multi_cluster_cache.go:100] Add cache for cluster member1
I1028 11:54:10.836831       1 cluster_cache.go:86] Add cache for member1 apps/v1, Resource=deployments
I1028 11:54:10.842021       1 controller.go:373] Create new informer for cluster member2
I1028 11:54:10.842042       1 controller.go:388] Try to build informer manager for cluster member2
I1028 11:54:10.862834       1 controller.go:414] Add informer for member2, apps/v1, Resource=deployments
I1028 11:54:10.862873       1 controller.go:417] Start informer for member2
I1028 11:54:10.963217       1 controller.go:420] Start informer for member2 done
I1028 11:54:10.963287       1 controller.go:373] Create new informer for cluster member1
I1028 11:54:10.963294       1 controller.go:388] Try to build informer manager for cluster member1
I1028 11:54:10.978225       1 controller.go:414] Add informer for member1, apps/v1, Resource=deployments
I1028 11:54:10.978381       1 controller.go:417] Start informer for member1
I1028 11:54:11.078897       1 controller.go:420] Start informer for member1 done
W1028 11:55:42.241921       1 cache.go:120] SingleClusterInformerManager for cluster(member3) is nil.
W1028 11:55:44.906116       1 cache.go:120] SingleClusterInformerManager for cluster(member3) is nil.

Context

  • Karmada Cluster Creation Method: hack/local-up-karmada.sh
  • Resource Registry Configuration:
dev@test:$ cat deployment-search.yaml
apiVersion: search.karmada.io/v1alpha1
kind: ResourceRegistry
metadata:
  name: deployment-search
spec:
  backendStore:
    openSearch:
      addresses:
        - http://karmada-opensearch.karmada-system.svc:9200
  targetCluster:
    clusterNames:
  resourceSelectors:
    - apiVersion: apps/v1
      kind: Deployment
  • Karmada Deployment Verification:
dev@test:$ kubectl karmada get deployments
nginx    Karmada   2/2     2            2           17h   -
  • Karmada OpenSearch Verification:
dev@test:$ kubectl karmada get deployments
NAMESPACE            NAME                                                       READY   STATUS    RESTARTS   AGE
karmada-system       pod/karmada-opensearch-645ff55978-6wvwl                    1/1     Running   0          18h
karmada-system       pod/karmada-opensearch-dashboards-5b457f6cf7-25k5j         1/1     Running   0          18h
...
  • Cached Deployments from member 1 and member 2:
dev@test:$ kubectl --kubeconfig $HOME/.kube/karmada.config --context karmada-apiserver get --raw /apis/search.karmada.io/v1alpha1/search/cache/apis/apps/v1/deployments
{
  "apiVersion": "apps/v1",
  "items": [
    {
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "annotations": {
          "deployment.kubernetes.io/revision": "1",
          "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app\":\"nginx\"},\"name\":\"nginx\",\"namespace\":\"default\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"app\":\"nginx\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"nginx\"}},\"spec\":{\"containers\":[{\"image\":\"nginx\",\"name\":\"nginx\"}]}}}}\n",
          "propagationpolicy.karmada.io/name": "nginx-propagation",
          "propagationpolicy.karmada.io/namespace": "default",
          "resource.karmada.io/cached-from-cluster": "member1",
          "resourcebinding.karmada.io/name": "nginx-deployment",
          "resourcebinding.karmada.io/namespace": "default",
          "resourcetemplate.karmada.io/generation": "2",
          "resourcetemplate.karmada.io/managed-annotations": "kubectl.kubernetes.io/last-applied-configuration,propagationpolicy.karmada.io/name,propagationpolicy.karmada.io/namespace,resourcebinding.karmada.io/name,resourcebinding.karmada.io/namespace,resourcetemplate.karmada.io/generation,resourcetemplate.karmada.io/managed-annotations,resourcetemplate.karmada.io/managed-labels,resourcetemplate.karmada.io/uid,work.karmada.io/conflict-resolution,work.karmada.io/name,work.karmada.io/namespace",
          "resourcetemplate.karmada.io/managed-labels": "app,karmada.io/managed,propagationpolicy.karmada.io/permanent-id,resourcebinding.karmada.io/permanent-id,work.karmada.io/permanent-id",
          "resourcetemplate.karmada.io/uid": "ee0cceb3-2902-4bcd-9695-e4916ca1e157",
          "work.karmada.io/conflict-resolution": "abort",
          "work.karmada.io/name": "nginx-687f7fb96f",
          "work.karmada.io/namespace": "karmada-es-member1"
        },
        "creationTimestamp": "2024-10-27T20:52:11Z",
        "generation": 1,
        "labels": {
          "app": "nginx",
          "karmada.io/managed": "true",
          "propagationpolicy.karmada.io/permanent-id": "6af11235-0eec-4bca-9934-0093a729fd0d",
          "resourcebinding.karmada.io/permanent-id": "7dda689f-56b6-4b22-b455-3d6d6a670e2d",
          "work.karmada.io/permanent-id": "f7e634b4-4e95-49d6-9a40-257d24a7d3d5"
        },
        "managedFields": [
          {
            "apiVersion": "apps/v1",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:metadata": {
                "f:annotations": {
                  ".": {},
                  "f:kubectl.kubernetes.io/last-applied-configuration": {},
                  "f:propagationpolicy.karmada.io/name": {},
                  "f:propagationpolicy.karmada.io/namespace": {},
                  "f:resourcebinding.karmada.io/name": {},
                  "f:resourcebinding.karmada.io/namespace": {},
                  "f:resourcetemplate.karmada.io/generation": {},
                  "f:resourcetemplate.karmada.io/managed-annotations": {},
                  "f:resourcetemplate.karmada.io/managed-labels": {},
                  "f:resourcetemplate.karmada.io/uid": {},
                  "f:work.karmada.io/conflict-resolution": {},
                  "f:work.karmada.io/name": {},
                  "f:work.karmada.io/namespace": {}
                },
                "f:labels": {
                  ".": {},
                  "f:app": {},
                  "f:karmada.io/managed": {},
                  "f:propagationpolicy.karmada.io/permanent-id": {},
                  "f:resourcebinding.karmada.io/permanent-id": {},
                  "f:work.karmada.io/permanent-id": {}
                }
              },
              "f:spec": {
                "f:progressDeadlineSeconds": {},
                "f:replicas": {},
                "f:revisionHistoryLimit": {},
                "f:selector": {},
                "f:strategy": {
                  "f:rollingUpdate": {
                    ".": {},
                    "f:maxSurge": {},
                    "f:maxUnavailable": {}
                  },
                  "f:type": {}
                },
                "f:template": {
                  "f:metadata": {
                    "f:labels": {
                      ".": {},
                      "f:app": {}
                    }
                  },
                  "f:spec": {
                    "f:containers": {
                      "k:{\"name\":\"nginx\"}": {
                        ".": {},
                        "f:image": {},
                        "f:imagePullPolicy": {},
                        "f:name": {},
                        "f:resources": {},
                        "f:terminationMessagePath": {},
                        "f:terminationMessagePolicy": {}
                      }
                    },
                    "f:dnsPolicy": {},
                    "f:restartPolicy": {},
                    "f:schedulerName": {},
                    "f:securityContext": {},
                    "f:terminationGracePeriodSeconds": {}
                  }
                }
              }
            },
            "manager": "karmada-controller-manager",
            "operation": "Update",
            "time": "2024-10-27T20:52:11Z"
          },
          {
            "apiVersion": "apps/v1",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:metadata": {
                "f:annotations": {
                  "f:deployment.kubernetes.io/revision": {}
                }
              },
              "f:status": {
                "f:availableReplicas": {},
                "f:conditions": {
                  ".": {},
                  "k:{\"type\":\"Available\"}": {
                    ".": {},
                    "f:lastTransitionTime": {},
                    "f:lastUpdateTime": {},
                    "f:message": {},
                    "f:reason": {},
                    "f:status": {},
                    "f:type": {}
                  },
                  "k:{\"type\":\"Progressing\"}": {
                    ".": {},
                    "f:lastTransitionTime": {},
                    "f:lastUpdateTime": {},
                    "f:message": {},
                    "f:reason": {},
                    "f:status": {},
                    "f:type": {}
                  }
                },
                "f:observedGeneration": {},
                "f:readyReplicas": {},
                "f:replicas": {},
                "f:updatedReplicas": {}
              }
            },
            "manager": "kube-controller-manager",
            "operation": "Update",
            "subresource": "status",
            "time": "2024-10-27T20:52:13Z"
          }
        ],
        "name": "nginx",
        "namespace": "default",
        "resourceVersion": "45343",
        "uid": "df228e48-289b-4723-bbc0-e4bd5a23427d"
      },
      "spec": {
        "progressDeadlineSeconds": 600,
        "replicas": 1,
        "revisionHistoryLimit": 10,
        "selector": {
          "matchLabels": {
            "app": "nginx"
          }
        },
        "strategy": {
          "rollingUpdate": {
            "maxSurge": "25%",
            "maxUnavailable": "25%"
          },
          "type": "RollingUpdate"
        },
        "template": {
          "metadata": {
            "creationTimestamp": null,
            "labels": {
              "app": "nginx"
            }
          },
          "spec": {
            "containers": [
              {
                "image": "nginx",
                "imagePullPolicy": "Always",
                "name": "nginx",
                "resources": {},
                "terminationMessagePath": "/dev/termination-log",
                "terminationMessagePolicy": "File"
              }
            ],
            "dnsPolicy": "ClusterFirst",
            "restartPolicy": "Always",
            "schedulerName": "default-scheduler",
            "securityContext": {},
            "terminationGracePeriodSeconds": 30
          }
        }
      },
      "status": {
        "availableReplicas": 1,
        "conditions": [
          {
            "lastTransitionTime": "2024-10-27T20:52:13Z",
            "lastUpdateTime": "2024-10-27T20:52:13Z",
            "message": "Deployment has minimum availability.",
            "reason": "MinimumReplicasAvailable",
            "status": "True",
            "type": "Available"
          },
          {
            "lastTransitionTime": "2024-10-27T20:52:11Z",
            "lastUpdateTime": "2024-10-27T20:52:13Z",
            "message": "ReplicaSet \"nginx-676b6c5bbc\" has successfully progressed.",
            "reason": "NewReplicaSetAvailable",
            "status": "True",
            "type": "Progressing"
          }
        ],
        "observedGeneration": 1,
        "readyReplicas": 1,
        "replicas": 1,
        "updatedReplicas": 1
      }
    },
    {
      "apiVersion": "apps/v1",
      "kind": "Deployment",
      "metadata": {
        "annotations": {
          "deployment.kubernetes.io/revision": "1",
          "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"labels\":{\"app\":\"nginx\"},\"name\":\"nginx\",\"namespace\":\"default\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"app\":\"nginx\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"nginx\"}},\"spec\":{\"containers\":[{\"image\":\"nginx\",\"name\":\"nginx\"}]}}}}\n",
          "propagationpolicy.karmada.io/name": "nginx-propagation",
          "propagationpolicy.karmada.io/namespace": "default",
          "resource.karmada.io/cached-from-cluster": "member2",
          "resourcebinding.karmada.io/name": "nginx-deployment",
          "resourcebinding.karmada.io/namespace": "default",
          "resourcetemplate.karmada.io/generation": "2",
          "resourcetemplate.karmada.io/managed-annotations": "kubectl.kubernetes.io/last-applied-configuration,propagationpolicy.karmada.io/name,propagationpolicy.karmada.io/namespace,resourcebinding.karmada.io/name,resourcebinding.karmada.io/namespace,resourcetemplate.karmada.io/generation,resourcetemplate.karmada.io/managed-annotations,resourcetemplate.karmada.io/managed-labels,resourcetemplate.karmada.io/uid,work.karmada.io/conflict-resolution,work.karmada.io/name,work.karmada.io/namespace",
          "resourcetemplate.karmada.io/managed-labels": "app,karmada.io/managed,propagationpolicy.karmada.io/permanent-id,resourcebinding.karmada.io/permanent-id,work.karmada.io/permanent-id",
          "resourcetemplate.karmada.io/uid": "ee0cceb3-2902-4bcd-9695-e4916ca1e157",
          "work.karmada.io/conflict-resolution": "abort",
          "work.karmada.io/name": "nginx-687f7fb96f",
          "work.karmada.io/namespace": "karmada-es-member2"
        },
        "creationTimestamp": "2024-10-27T20:52:11Z",
        "generation": 1,
        "labels": {
          "app": "nginx",
          "karmada.io/managed": "true",
          "propagationpolicy.karmada.io/permanent-id": "6af11235-0eec-4bca-9934-0093a729fd0d",
          "resourcebinding.karmada.io/permanent-id": "7dda689f-56b6-4b22-b455-3d6d6a670e2d",
          "work.karmada.io/permanent-id": "27f297b9-f0c9-42ac-aa3e-0ed66521e202"
        },
        "managedFields": [
          {
            "apiVersion": "apps/v1",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:metadata": {
                "f:annotations": {
                  ".": {},
                  "f:kubectl.kubernetes.io/last-applied-configuration": {},
                  "f:propagationpolicy.karmada.io/name": {},
                  "f:propagationpolicy.karmada.io/namespace": {},
                  "f:resourcebinding.karmada.io/name": {},
                  "f:resourcebinding.karmada.io/namespace": {},
                  "f:resourcetemplate.karmada.io/generation": {},
                  "f:resourcetemplate.karmada.io/managed-annotations": {},
                  "f:resourcetemplate.karmada.io/managed-labels": {},
                  "f:resourcetemplate.karmada.io/uid": {},
                  "f:work.karmada.io/conflict-resolution": {},
                  "f:work.karmada.io/name": {},
                  "f:work.karmada.io/namespace": {}
                },
                "f:labels": {
                  ".": {},
                  "f:app": {},
                  "f:karmada.io/managed": {},
                  "f:propagationpolicy.karmada.io/permanent-id": {},
                  "f:resourcebinding.karmada.io/permanent-id": {},
                  "f:work.karmada.io/permanent-id": {}
                }
              },
              "f:spec": {
                "f:progressDeadlineSeconds": {},
                "f:replicas": {},
                "f:revisionHistoryLimit": {},
                "f:selector": {},
                "f:strategy": {
                  "f:rollingUpdate": {
                    ".": {},
                    "f:maxSurge": {},
                    "f:maxUnavailable": {}
                  },
                  "f:type": {}
                },
                "f:template": {
                  "f:metadata": {
                    "f:labels": {
                      ".": {},
                      "f:app": {}
                    }
                  },
                  "f:spec": {
                    "f:containers": {
                      "k:{\"name\":\"nginx\"}": {
                        ".": {},
                        "f:image": {},
                        "f:imagePullPolicy": {},
                        "f:name": {},
                        "f:resources": {},
                        "f:terminationMessagePath": {},
                        "f:terminationMessagePolicy": {}
                      }
                    },
                    "f:dnsPolicy": {},
                    "f:restartPolicy": {},
                    "f:schedulerName": {},
                    "f:securityContext": {},
                    "f:terminationGracePeriodSeconds": {}
                  }
                }
              }
            },
            "manager": "karmada-controller-manager",
            "operation": "Update",
            "time": "2024-10-27T20:52:11Z"
          },
          {
            "apiVersion": "apps/v1",
            "fieldsType": "FieldsV1",
            "fieldsV1": {
              "f:metadata": {
                "f:annotations": {
                  "f:deployment.kubernetes.io/revision": {}
                }
              },
              "f:status": {
                "f:availableReplicas": {},
                "f:conditions": {
                  ".": {},
                  "k:{\"type\":\"Available\"}": {
                    ".": {},
                    "f:lastTransitionTime": {},
                    "f:lastUpdateTime": {},
                    "f:message": {},
                    "f:reason": {},
                    "f:status": {},
                    "f:type": {}
                  },
                  "k:{\"type\":\"Progressing\"}": {
                    ".": {},
                    "f:lastTransitionTime": {},
                    "f:lastUpdateTime": {},
                    "f:message": {},
                    "f:reason": {},
                    "f:status": {},
                    "f:type": {}
                  }
                },
                "f:observedGeneration": {},
                "f:readyReplicas": {},
                "f:replicas": {},
                "f:updatedReplicas": {}
              }
            },
            "manager": "kube-controller-manager",
            "operation": "Update",
            "subresource": "status",
            "time": "2024-10-27T20:52:12Z"
          }
        ],
        "name": "nginx",
        "namespace": "default",
        "resourceVersion": "45337",
        "uid": "e27ceb5a-a093-422c-91fc-2f5c77d1b151"
      },
      "spec": {
        "progressDeadlineSeconds": 600,
        "replicas": 1,
        "revisionHistoryLimit": 10,
        "selector": {
          "matchLabels": {
            "app": "nginx"
          }
        },
        "strategy": {
          "rollingUpdate": {
            "maxSurge": "25%",
            "maxUnavailable": "25%"
          },
          "type": "RollingUpdate"
        },
        "template": {
          "metadata": {
            "creationTimestamp": null,
            "labels": {
              "app": "nginx"
            }
          },
          "spec": {
            "containers": [
              {
                "image": "nginx",
                "imagePullPolicy": "Always",
                "name": "nginx",
                "resources": {},
                "terminationMessagePath": "/dev/termination-log",
                "terminationMessagePolicy": "File"
              }
            ],
            "dnsPolicy": "ClusterFirst",
            "restartPolicy": "Always",
            "schedulerName": "default-scheduler",
            "securityContext": {},
            "terminationGracePeriodSeconds": 30
          }
        }
      },
      "status": {
        "availableReplicas": 1,
        "conditions": [
          {
            "lastTransitionTime": "2024-10-27T20:52:12Z",
            "lastUpdateTime": "2024-10-27T20:52:12Z",
            "message": "Deployment has minimum availability.",
            "reason": "MinimumReplicasAvailable",
            "status": "True",
            "type": "Available"
          },
          {
            "lastTransitionTime": "2024-10-27T20:52:11Z",
            "lastUpdateTime": "2024-10-27T20:52:12Z",
            "message": "ReplicaSet \"nginx-676b6c5bbc\" has successfully progressed.",
            "reason": "NewReplicaSetAvailable",
            "status": "True",
            "type": "Progressing"
          }
        ],
        "observedGeneration": 1,
        "readyReplicas": 1,
        "replicas": 1,
        "updatedReplicas": 1
      }
    },
  ],
  "kind": "DeploymentList",
  "metadata": {}
}

What do you think about this question?:

I'm expecting data from member1 and member2 clusters to automatically upload to OpenSearch, as shown in the following image part of the doc mentioned above. Is there anything I'm missing?
opensearch-65752d9964b48355abfccd2f619963d0

@mohamedawnallah mohamedawnallah added the kind/question Indicates an issue that is a support question. label Oct 28, 2024
@mohamedawnallah
Copy link
Contributor Author

I would appreciate any thoughts on this @zhzhuang-zju, @XiShanYongYe-Chang! 🙏

@mohamedawnallah
Copy link
Contributor Author

I'm delayed on Milestone 7 because I haven't been able to figure this out. I've followed the Karmada search document on multi-cloud search but still can't reproduce the intended results of cached data to be deployed automatically to the backend store.

Steps I’ve Taken:

  1. Created a deployment and propagation policy to apply across member1 and member2 clusters.
  2. Installed the OpenSearch backend and dashboard.
  3. Created a resource registry with the OpenSearch backend to cache apps/v1 deployments across the member1 and member2 target clusters.

The logs for the Karmada search deployment appear the same or unchanged:

I1104 01:12:01.007154       1 multi_cluster_cache.go:100] Add cache for cluster member1
I1104 01:12:01.007611       1 cluster_cache.go:86] Add cache for member1 apps/v1, Resource=deployments
I1104 01:12:01.008089       1 multi_cluster_cache.go:100] Add cache for cluster member2
I1104 01:12:01.008434       1 cluster_cache.go:86] Add cache for member2 apps/v1, Resource=deployments
I1104 01:12:01.007167       1 controller.go:373] Create new informer for cluster member1
I1104 01:12:01.008776       1 controller.go:388] Try to build informer manager for cluster member1
I1104 01:12:01.023715       1 controller.go:414] Add informer for member1, apps/v1, Resource=deployments
I1104 01:12:01.023776       1 controller.go:417] Start informer for member1
I1104 01:12:01.124307       1 controller.go:420] Start informer for member1 done
I1104 01:12:01.124409       1 controller.go:373] Create new informer for cluster member2
I1104 01:12:01.124457       1 controller.go:388] Try to build informer manager for cluster member2
I1104 01:12:01.135465       1 controller.go:414] Add informer for member2, apps/v1, Resource=deployments
I1104 01:12:01.135515       1 controller.go:417] Start informer for member2
I1104 01:12:01.235660       1 controller.go:420] Start informer for member2 done

Let me know if this helps clarify! 🙏

cc: @XiShanYongYe-Chang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

1 participant