Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 29 additions & 22 deletions component/argocd.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -231,27 +231,6 @@ local argocd(name) =
version: params.images.argocd.tag,
applicationInstanceLabelKey: 'argocd.argoproj.io/instance',
controller: applicationController,
initialRepositories: '- url: ' + inv.parameters.cluster.catalog_url,
repositoryCredentials: if useHttpsCatalog then
|||
- url: %(catalog_url)s
usernameSecret:
name: %(secret)s
key: username
passwordSecret:
name: %(secret)s
key: password
||| % {
catalog_url: inv.parameters.cluster.catalog_url,
secret: params.http_credentials_secret_name,
}
else
|||
- url: ssh://git@
sshPrivateKeySecret:
name: argo-ssh-key
key: sshPrivateKey
|||,
initialSSHKnownHosts: {
keys: |||
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -395,8 +374,35 @@ local argocd(name) =

local ssh_secret = kube._Object('v1', 'Secret', 'argo-ssh-key') {
type: 'Opaque',
};
} + if !useHttpsCatalog then {
metadata+: {
labels+: {
'argocd.argoproj.io/secret-type': 'repo-creds',
},
},
stringData: {
// sshPrivateKey set by Steward -- should be safe with SSA for the ArgoCD
// app. For full safety we should update Steward to use SSA for this
// secret.
url: inv.parameters.cluster.catalog_url,
},
} else {};

local repo_secret = kube._Object('v1', 'Secret', 'cluster-catalog') {
type: 'Opaque',
metadata+: {
labels+: {
'argocd.argoproj.io/secret-type': 'repository',
},
},
stringData: {
type: 'git',
url: inv.parameters.cluster.catalog_url,
// creds always provided in a `repo-creds` secret. Externally managed
// https secrets must be updated to have label
// `argocd.argoproj.io/secret-type=repo-creds`
},
};

// Manually adding certificate for conversion webhook
// as the upstream kustomize is broken.
Expand Down Expand Up @@ -511,6 +517,7 @@ local tls_refresh = [
'00_vault_agent_config': vault_agent_config,
'00_kapitan_plugin_config': kapitan_plugin_config,
'00_ssh_secret': ssh_secret,
'00_repo_secret': repo_secret,
'10_argocd': argocd('syn-argocd'),
[if params.network_policies.enabled then '20_networkpolicy']: std.map(function(p) com.namespaced(params.namespace, p), import 'networkpolicy.libsonnet'),
// Manually adding certificate for conversion webhook
Expand Down
12 changes: 12 additions & 0 deletions tests/golden/defaults/argocd/argocd/30_argocd/00_repo_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repository
name: cluster-catalog
name: cluster-catalog
stringData:
type: git
url: ssh://[email protected]/org/repo.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repo-creds
name: argo-ssh-key
name: argo-ssh-key
stringData:
url: ssh://[email protected]/org/repo.git
type: Opaque
6 changes: 0 additions & 6 deletions tests/golden/defaults/argocd/argocd/30_argocd/10_argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
"operators.coreos.com/Subscription":
"health.lua.useOpenLibs": true
image: quay.io/argoproj/argocd
initialRepositories: '- url: ssh://[email protected]/org/repo.git'
initialSSHKnownHosts:
keys: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -138,11 +137,6 @@ spec:
- configMap:
name: kapitan-plugin-config
name: kapitan-plugin-config
repositoryCredentials: |
- url: ssh://git@
sshPrivateKeySecret:
name: argo-ssh-key
key: sshPrivateKey
resourceExclusions: |-
- "apiGroups":
- "cilium.io"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repository
name: cluster-catalog
name: cluster-catalog
stringData:
type: git
url: https://git.example.com/cluster-catalog.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
"operators.coreos.com/Subscription":
"health.lua.useOpenLibs": true
image: quay.io/argoproj/argocd
initialRepositories: '- url: https://git.example.com/cluster-catalog.git'
initialSSHKnownHosts:
keys: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -138,14 +137,6 @@ spec:
- configMap:
name: kapitan-plugin-config
name: kapitan-plugin-config
repositoryCredentials: |
- url: https://git.example.com/cluster-catalog.git
usernameSecret:
name: catalog-http-credentials
key: username
passwordSecret:
name: catalog-http-credentials
key: password
resourceExclusions: |-
- "apiGroups":
- "cilium.io"
Expand Down
12 changes: 12 additions & 0 deletions tests/golden/openshift/argocd/argocd/30_argocd/00_repo_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repository
name: cluster-catalog
name: cluster-catalog
stringData:
type: git
url: ssh://[email protected]/org/repo.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repo-creds
name: argo-ssh-key
name: argo-ssh-key
stringData:
url: ssh://[email protected]/org/repo.git
type: Opaque
6 changes: 0 additions & 6 deletions tests/golden/openshift/argocd/argocd/30_argocd/10_argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
"operators.coreos.com/Subscription":
"health.lua.useOpenLibs": true
image: quay.io/argoproj/argocd
initialRepositories: '- url: ssh://[email protected]/org/repo.git'
initialSSHKnownHosts:
keys: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -141,11 +140,6 @@ spec:
- configMap:
name: kapitan-plugin-config
name: kapitan-plugin-config
repositoryCredentials: |
- url: ssh://git@
sshPrivateKeySecret:
name: argo-ssh-key
key: sshPrivateKey
resourceExclusions: |-
- "apiGroups":
- "cilium.io"
Expand Down
12 changes: 12 additions & 0 deletions tests/golden/params/argocd/argocd/30_argocd/00_repo_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repository
name: cluster-catalog
name: cluster-catalog
stringData:
type: git
url: ssh://[email protected]/org/repo.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repo-creds
name: argo-ssh-key
name: argo-ssh-key
stringData:
url: ssh://[email protected]/org/repo.git
type: Opaque
6 changes: 0 additions & 6 deletions tests/golden/params/argocd/argocd/30_argocd/10_argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec:
"operators.coreos.com/Subscription":
"health.lua.useOpenLibs": true
image: quay.io/argoproj/argocd
initialRepositories: '- url: ssh://[email protected]/org/repo.git'
initialSSHKnownHosts:
keys: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -117,11 +116,6 @@ spec:
- configMap:
name: kapitan-plugin-config
name: kapitan-plugin-config
repositoryCredentials: |
- url: ssh://git@
sshPrivateKeySecret:
name: argo-ssh-key
key: sshPrivateKey
resourceExclusions: |-
- "apiGroups":
- "cilium.io"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repository
name: cluster-catalog
name: cluster-catalog
stringData:
type: git
url: ssh://[email protected]/org/repo.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repo-creds
name: argo-ssh-key
name: argo-ssh-key
stringData:
url: ssh://[email protected]/org/repo.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
"operators.coreos.com/Subscription":
"health.lua.useOpenLibs": true
image: quay.io/argoproj/argocd
initialRepositories: '- url: ssh://[email protected]/org/repo.git'
initialSSHKnownHosts:
keys: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -138,11 +137,6 @@ spec:
- configMap:
name: kapitan-plugin-config
name: kapitan-plugin-config
repositoryCredentials: |
- url: ssh://git@
sshPrivateKeySecret:
name: argo-ssh-key
key: sshPrivateKey
resourceExclusions: |-
- "apiGroups":
- "cilium.io"
Expand Down
12 changes: 12 additions & 0 deletions tests/golden/syn-teams/argocd/argocd/30_argocd/00_repo_secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repository
name: cluster-catalog
name: cluster-catalog
stringData:
type: git
url: ssh://[email protected]/org/repo.git
type: Opaque
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ kind: Secret
metadata:
annotations: {}
labels:
argocd.argoproj.io/secret-type: repo-creds
name: argo-ssh-key
name: argo-ssh-key
stringData:
url: ssh://[email protected]/org/repo.git
type: Opaque
6 changes: 0 additions & 6 deletions tests/golden/syn-teams/argocd/argocd/30_argocd/10_argocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ spec:
"operators.coreos.com/Subscription":
"health.lua.useOpenLibs": true
image: quay.io/argoproj/argocd
initialRepositories: '- url: ssh://[email protected]/org/repo.git'
initialSSHKnownHosts:
keys: |
bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw==
Expand Down Expand Up @@ -138,11 +137,6 @@ spec:
- configMap:
name: kapitan-plugin-config
name: kapitan-plugin-config
repositoryCredentials: |
- url: ssh://git@
sshPrivateKeySecret:
name: argo-ssh-key
key: sshPrivateKey
resourceExclusions: |-
- "apiGroups":
- "cilium.io"
Expand Down