-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingcomponent:hydratorIssue related to the Source Hydrator and commit serverIssue related to the Source Hydrator and commit servertriage/pendingThis issue needs further triage to be correctly classifiedThis issue needs further triage to be correctly classified
Description
Checklist:
- I've searched in the docs and FAQ for my answer: https://bit.ly/argocd-faq.
- I've included steps to reproduce the bug.
- I've pasted the output of
argocd version.
Describe the bug
if source hydrator is enabled, it somehow does not respect the namespace or better said used the argocd namespace
To Reproduce
- create a repo
- add this files
# apps/rancher-ui/chart.yaml
apiVersion: v2
name: rancher
version: 0.1.0
dependencies:
- name: rancher
version: 2.12.1
repository: "https://releases.rancher.com/server-charts/stable"
values:
- values.yaml# apps/rancher-ui/values.yaml
# Default values for rancher-ui.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
rancher:
# # Override names to ensure RBAC resources are named correctly
# # The Rancher chart expects the service account to be named 'rancher'
# fullnameOverride: rancher
# # Override namespace for RBAC subjects - required when using ArgoCD sourceHydrator
# # because .Release.Namespace picks up 'argocd' instead of the destination namespace
# namespaceOverride: cattle-system
hostname: rancher.example.com- use app like this
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: rancher-ui
namespace: argocd
spec:
destination:
namespace: cattle-system
server: https://kubernetes.default.svc
project: default
sourceHydrator:
drySource:
path: apps/rancher-ui
repoURL: https://github.com/<your-repo>.git
targetRevision: main
syncSource:
path: apps/rancher-ui
targetBranch: env/prod
syncPolicy:
automated:
enabled: true
prune: true
selfHeal: true
syncOptions:
createNamespace: true
- This will result in the following
branch: env/prod
file: apps/rancher-ui/manifest.yaml
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: rancher-ui
chart: rancher-2.12.1
heritage: Helm
release: rancher-ui
name: rancher-ui
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: rancher-ui
namespace: argocd # <--------- expected cattle-system
---
...
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: rancher-ui
chart: rancher-2.12.1
heritage: Helm
release: rancher-ui
name: rancher-ui
spec:
replicas: 3
selector:
matchLabels:
app: rancher-ui
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: rancher-ui
release: rancher-ui
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: NotIn
values:
- windows
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- rancher-ui
topologyKey: kubernetes.io/hostname
weight: 100
containers:
- args:
- --http-listen-port=80
- --https-listen-port=443
- --add-local=true
env:
- name: CATTLE_NAMESPACE
value: argocd # <--------- expected cattle-system
...
---
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
helm.sh/hook: pre-upgrade
helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
helm.sh/hook-weight: "-1"
labels:
app: rancher-ui
chart: rancher-2.12.1
heritage: Helm
release: rancher-ui
name: rancher-ui-pre-upgrade
namespace: argocd # <--------- expected cattle-systemExpected behavior
namespace=cattle-system
Screenshots
Version
v3.3.0+0e68458.dirtyReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcomponent:hydratorIssue related to the Source Hydrator and commit serverIssue related to the Source Hydrator and commit servertriage/pendingThis issue needs further triage to be correctly classifiedThis issue needs further triage to be correctly classified