-
Notifications
You must be signed in to change notification settings - Fork 722
Namespaced Apprepository: cronjobs not displayed in ArgoCD UI when repo deployed in namespace other than the kubeapps namespace #5633
Description
Describe the bug
We deployed GCP Artifact Registry (oci) Apprepos in separate namespaces using ArgoCD. The repos can be seen under each of the required namespace in kubeapps package administration and functionality works
The cronjobs for these Apprepos get deployed in kubeapps namespace along with the jobs created by the cronjobs run.
But the cronjobs are not seen from Argocd.
To Reproduce
Steps to reproduce the behavior:
- Deploy GCP artifact repository (OCI) as namedspace Apprepo.
- Verify the app repos in Kubeapps package administration in the expected namespace.
- Verify the functionality using a helm chart
- Verify the contents of cronjob for that Apprepo. If the cronjob is in different namespace then the Apprepo the it will have missing
ownerReferences:
when checked the cronjob
for e.g one of my cronjobs.
kubectl get cronjobs apprepo-ecpipeline-sync-gcp-ecpipeline -o yaml
apiVersion: batch/v1
kind: CronJob
metadata:
creationTimestamp: "2022-11-14T09:33:34Z"
generation: 1
labels:
apprepositories.kubeapps.com/repo-name: gcp-ecpipeline
apprepositories.kubeapps.com/repo-namespace: ecpipeline
name: apprepo-ecpipeline-sync-gcp-ecpipeline
namespace: apps
resourceVersion: "29377232"
uid: 62e3cb9b-762e-42e1-b7ea-760a86aea3c6
spec:
concurrencyPolicy: Replace
failedJobsHistoryLimit: 1
jobTemplate:
metadata:
creationTimestamp: null
spec:
template:
metadata:
creationTimestamp: null
labels:
apprepositories.kubeapps.com/repo-name: gcp-ecpipeline
apprepositories.kubeapps.com/repo-namespace: ecpipeline
spec:
containers:
- args:
- sync
- --database-url=apps-postgresql:5432
- --database-user=postgres
- --database-name=assets
- --user-agent-comment=kubeapps/2.5.0
- --global-repos-namespace=apps
- --namespace=ecpipeline
- gcp-ecpipeline
- https://europe-west4-docker.pkg.dev/sap-cx-pipeline-test/
- oci
- --oci-repositories
- k8s-ec-pipeline/jenkins-ecpipeline
command:
- /asset-syncer
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
key: postgres-password
name: kubeapps-postgresql
- name: AUTHORIZATION_HEADER
valueFrom:
secretKeyRef:
key: authorizationHeader
name: ecpipeline-apprepo-gcp-ecpipeline
image: eu.gcr.io/sap-cx-pipeline-prod/k8s-apps/kubeapps-asset-syncer:2.5.0-scratch-r0
imagePullPolicy: IfNotPresent
name: sync
resources:
limits:
cpu: 500m
memory: 100M
requests:
cpu: 100m
memory: 50M
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: OnFailure
schedulerName: default-scheduler
securityContext:
runAsUser: 1001
terminationGracePeriodSeconds: 30
ttlSecondsAfterFinished: 3600
schedule: '*/10 * * * *'
successfulJobsHistoryLimit: 3
suspend: false
status:
lastScheduleTime: "2022-11-14T10:20:00Z"
lastSuccessfulTime: "2022-11-14T10:20:05Z"
Expected behavior
I expected the cronjobs to be deployed in same namespace as the Apprepos so the the cronjobs ownerReferences gets defined in the cronjob
Part screenshot of argocd deployment showing the Apprepositories.
In this screenshot i have three repos gcp-test-ecpipeline , gcp-test-modelt-sre and gcp-test-modelt
cronjob displayed for gcp-test-ecpipeline which is in same namespace as kubeapps.
gcp-test-modelt-sre and gcp-test-modelt are in different namespaces and cronjobs not seen in the scrrenshot.
Desktop (please complete the following information):
- Version [2.5.0]
- Kubernetes version [v1.23.11]
- Package version []
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status