stormshift / support

This repo should serve as a central source for reporting issues with stormshift
GNU General Public License v3.0
3 stars 0 forks source link

Unknown argo applications / applicationset/openshiftvirt #189

Closed rbo closed 2 months ago

rbo commented 2 months ago

@DanielFroehlich is that yours? Can you take a look?

$ oc get applications.argoproj.io
NAME                                     SYNC STATUS   HEALTH STATUS
..
stormshift-ushift10-eus-demo-vm          Unknown       Unknown
stormshift-ushift10-eus-virtualization   Unknown       Unknown

Thanks! Robert

rbo commented 2 months ago
time="2024-07-12T15:37:00Z" level=info msg="Unable to delete application resources: failed to get cluster info for \"\": error synchronizing cache state : Get \"http://localhost/version?timeout=32s\": dial tcp [::1]:80: connect: connection refused" application=stormshift-ushift10-eus-demo-vm dest-namespace=demo-vm dest-server= reason=StatusRefreshed spec="{&ApplicationSource{RepoURL:https://github.com/0xFelix/gitops-demo.git,Path:applicationsets/demo-vm/kustomize/{{metadata.labels.env}},TargetRevision:HEAD,Helm:nil,Kustomize:&ApplicationSourceKustomize{NamePrefix:,NameSuffix:,Images:[],CommonLabels:map[string]string{},Version:,CommonAnnotations:map[string]string{managed-cluster: stormshift-ushift10-eus,},ForceCommonLabels:false,ForceCommonAnnotations:false,Namespace:,CommonAnnotationsEnvsubst:false,Replicas:[]KustomizeReplica{},Patches:[]KustomizePatch{},Components:[],},Directory:nil,Plugin:nil,Chart:,Ref:,} { demo-vm  false} default &SyncPolicy{Automated:&SyncPolicyAutomated{Prune:true,SelfHeal:true,AllowEmpty:false,},SyncOptions:[CreateNamespace=true],Retry:nil,ManagedNamespaceMetadata:nil,} [] [] <nil> []}" type=Warning
time="2024-07-12T15:37:00Z" level=info msg="Unable to delete application resources: failed to get cluster info for \"\": error synchronizing cache state : Get \"http://localhost/version?timeout=32s\": dial tcp [::1]:80: connect: connection refused" application=stormshift-ushift10-eus-virtualization dest-namespace=openshift-cnv dest-server= reason=StatusRefreshed spec="{&ApplicationSource{RepoURL:https://github.com/0xFelix/gitops-demo.git,Path:applicationsets/virtualization/manifests,TargetRevision:HEAD,Helm:nil,Kustomize:nil,Directory:nil,Plugin:nil,Chart:,Ref:,} { openshift-cnv  false} default &SyncPolicy{Automated:&SyncPolicyAutomated{Prune:true,SelfHeal:true,AllowEmpty:false,},SyncOptions:[CreateNamespace=true],Retry:nil,ManagedNamespaceMetadata:nil,} [] [] <nil> []}" type=Warning

Source: https://console-openshift-console.apps.isar.coe.muc.redhat.com/api/kubernetes/api/v1/namespaces/openshift-gitops/pods/openshift-gitops-application-controller-0/log?container=argocd-application-controller

rbo commented 2 months ago

No looks like from a delete applicationset.

rbo commented 2 months ago
 oc get applications.argoproj.io -A -o custom-columns="STATUS:.status.health.status,NAMESPACE:.metadata.namespace,NAME:.metadata.name,OWNER-KIND:.metadata.ownerReferences[0].kind,OWNER-NAME:.metadata.ownerReferences[0].name,SOURCE:.spec.source.repoURL"  
STATUS      NAMESPACE          NAME                                     OWNER-KIND       OWNER-NAME       SOURCE
Healthy     openshift-gitops   cluster-configuration                    <none>           <none>           https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   example-windows-vms                      <none>           <none>           ssh://git@gitlab.consulting.redhat.com:2222/coe-lab/examples-windows-vms.git
Healthy     openshift-gitops   infra                                    <none>           <none>           git@github.com:stormshift/disco.git
Healthy     openshift-gitops   infra-external-dns                       ApplicationSet   isar-apps        https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   keycloak                                 ApplicationSet   isar-apps        https://github.com/stormshift/clusters.git
<none>      openshift-gitops   local-cluster-demo-vm                    ApplicationSet   demo-vm          https://github.com/0xFelix/gitops-demo.git
<none>      openshift-gitops   local-cluster-virtualization             ApplicationSet   virtualization   https://github.com/0xFelix/gitops-demo.git
Healthy     openshift-gitops   operator-acm                             ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-hosted-cluster                  ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-metallb                         ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-mtv                             ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-nmstate                         ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-ocp-v                           ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-openshift-storage               ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
Healthy     openshift-gitops   operator-quay                            ApplicationSet   appset-of-apps   https://github.com/stormshift/clusters.git
<none>      openshift-gitops   sendling-ingress-demo-vm                 ApplicationSet   demo-vm          https://github.com/0xFelix/gitops-demo.git
<none>      openshift-gitops   sendling-ingress-virtualization          ApplicationSet   virtualization   https://github.com/0xFelix/gitops-demo.git
Suspended   openshift-gitops   stormshift-app                           <none>           <none>           https://github.com/stormshift/automation.git
Unknown     openshift-gitops   stormshift-ushift10-eus-demo-vm          ApplicationSet   demo-vm          https://github.com/0xFelix/gitops-demo.git
Unknown     openshift-gitops   stormshift-ushift10-eus-virtualization   ApplicationSet   virtualization   https://github.com/0xFelix/gitops-demo.git
ch-stark commented 2 months ago

I deployed on ApplicationSet, seems although this is deleted some ArgoCD apps remained. Cleaned them

rbo commented 2 months ago
 oc get applications.argoproj.io -A -o custom-columns="STATUS:.status.health.status,NAMESPACE:.metadata.namespace,NAME:.metadata.name,OWNER-KIND:.metadata.ownerReferences[0].kind,OWNER-NAME:.metadata.ownerReferences[0].name,SOURCE:.spec.source.repoURL,DESTIONATION:.spec.destination,FINALIZER:.metadata.finalizers" 
   | grep -vE '^(Healthy|Suspended)'
STATUS      NAMESPACE          NAME                                     OWNER-KIND       OWNER-NAME       SOURCE                                                                         DESTIONATION                                                                   FINALIZER
<none>      openshift-gitops   local-cluster-demo-vm                    ApplicationSet   demo-vm          https://github.com/0xFelix/gitops-demo.git                                     map[namespace:demo-vm server:https://api.isar.coe.muc.redhat.com:6443]         [resources-finalizer.argocd.argoproj.io]
<none>      openshift-gitops   local-cluster-virtualization             ApplicationSet   virtualization   https://github.com/0xFelix/gitops-demo.git                                     map[namespace:openshift-cnv server:https://api.isar.coe.muc.redhat.com:6443]   [resources-finalizer.argocd.argoproj.io]
<none>      openshift-gitops   sendling-ingress-demo-vm                 ApplicationSet   demo-vm          https://github.com/0xFelix/gitops-demo.git                                     map[namespace:demo-vm server:https://10.32.98.156:6443]                        [resources-finalizer.argocd.argoproj.io]
<none>      openshift-gitops   sendling-ingress-virtualization          ApplicationSet   virtualization   https://github.com/0xFelix/gitops-demo.git                                     map[namespace:openshift-cnv server:https://10.32.98.156:6443]                  [resources-finalizer.argocd.argoproj.io]
Unknown     openshift-gitops   stormshift-ushift10-eus-demo-vm          ApplicationSet   demo-vm          https://github.com/0xFelix/gitops-demo.git                                     map[namespace:demo-vm]                                                         [resources-finalizer.argocd.argoproj.io]
Unknown     openshift-gitops   stormshift-ushift10-eus-virtualization   ApplicationSet   virtualization   https://github.com/0xFelix/gitops-demo.git                                     map[namespace:openshift-cnv]                                                   [resources-finalizer.argocd.argoproj.io]
rbo commented 2 months ago

Let's remove the finalizer and delete the applications. I was not able to find any related objects like VM's to all the applications.

rbo commented 2 months ago
$ kubectl patch -n openshift-gitops applications.argoproj.io local-cluster-demo-vm -p '{"metadata":{"finalizers":null}}'  --type=merge
application.argoproj.io/local-cluster-demo-vm patched
....
$oc get applications.argoproj.io -A -o custom-columns="STATUS:.status.health.status,NAMESPACE:.metadata.namespace,NAME:.metadata.name,OWNER-KIND:.metadata.ownerReferences[0].kind,OWNER-NAME:.metadata.ownerReferences[0].name,SOURCE:.spec.source.repoURL,DESTIONATION:.spec.destination,FINALIZER:.metadata.finalizers"    | grep -vE '^(Healthy|Suspended)'
$
rbo commented 2 months ago

done, looks better openshift-gitops-application-controller-0 is not restarting anymore