Skip to content

Commit

Permalink
Merge pull request #85 from projectsyn/make-argocd-renovatable
Browse files Browse the repository at this point in the history
Make ArgoCD version renovatable
  • Loading branch information
bastjan authored Jun 8, 2022
2 parents 7179531 + 3d5c52f commit 6cd625c
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 79 deletions.
94 changes: 47 additions & 47 deletions class/argocd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,79 +3,79 @@ parameters:
dependencies:
# CRDs
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/crds/application-crd.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/crds/application-crd.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/crds/application-crd.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/crds/application-crd.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/crds/appproject-crd.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/crds/appproject-crd.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/crds/appproject-crd.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/crds/appproject-crd.yaml
# application-controller
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/application-controller/argocd-application-controller-statefulset.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/application-controller/argocd-application-controller-statefulset.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/application-controller/argocd-application-controller-statefulset.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/application-controller/argocd-application-controller-statefulset.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/application-controller/argocd-application-controller-role.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/application-controller/argocd-application-controller-role.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/application-controller/argocd-application-controller-role.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/application-controller/argocd-application-controller-role.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/application-controller/argocd-application-controller-rolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/application-controller/argocd-application-controller-rolebinding.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/application-controller/argocd-application-controller-rolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/application-controller/argocd-application-controller-rolebinding.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/application-controller/argocd-application-controller-sa.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/application-controller/argocd-application-controller-sa.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/application-controller/argocd-application-controller-sa.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/application-controller/argocd-application-controller-sa.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/application-controller/argocd-metrics.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/application-controller/argocd-metrics.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/application-controller/argocd-metrics.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/application-controller/argocd-metrics.yaml
# repo-server
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/repo-server/argocd-repo-server-deployment.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/repo-server/argocd-repo-server-deployment.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/repo-server/argocd-repo-server-deployment.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/repo-server/argocd-repo-server-deployment.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/repo-server/argocd-repo-server-service.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/repo-server/argocd-repo-server-service.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/repo-server/argocd-repo-server-service.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/repo-server/argocd-repo-server-service.yaml
# server
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/server/argocd-server-deployment.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/server/argocd-server-deployment.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/server/argocd-server-deployment.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/server/argocd-server-deployment.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/server/argocd-server-role.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/server/argocd-server-role.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/server/argocd-server-role.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/server/argocd-server-role.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/server/argocd-server-rolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/server/argocd-server-rolebinding.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/server/argocd-server-rolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/server/argocd-server-rolebinding.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/server/argocd-server-sa.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/server/argocd-server-sa.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/server/argocd-server-sa.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/server/argocd-server-sa.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/server/argocd-server-service.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/server/argocd-server-service.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/server/argocd-server-service.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/server/argocd-server-service.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/server/argocd-server-metrics.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/server/argocd-server-metrics.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/server/argocd-server-metrics.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/server/argocd-server-metrics.yaml
# redis
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/redis/argocd-redis-deployment.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/redis/argocd-redis-deployment.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/redis/argocd-redis-deployment.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/redis/argocd-redis-deployment.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/redis/argocd-redis-rolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/redis/argocd-redis-rolebinding.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/redis/argocd-redis-rolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/redis/argocd-redis-rolebinding.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/redis/argocd-redis-sa.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/redis/argocd-redis-sa.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/redis/argocd-redis-sa.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/redis/argocd-redis-sa.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/base/redis/argocd-redis-service.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/redis/argocd-redis-service.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/base/redis/argocd-redis-service.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/redis/argocd-redis-service.yaml
# RBAC
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/cluster-rbac/argocd-application-controller-clusterrole.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/rbac/argocd-application-controller-clusterrole.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/cluster-rbac/argocd-application-controller-clusterrole.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/rbac/argocd-application-controller-clusterrole.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/cluster-rbac/argocd-application-controller-clusterrolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/rbac/argocd-application-controller-clusterrolebinding.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/cluster-rbac/argocd-application-controller-clusterrolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/rbac/argocd-application-controller-clusterrolebinding.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/cluster-rbac/argocd-server-clusterrole.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/rbac/argocd-server-clusterrole.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/cluster-rbac/argocd-server-clusterrole.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/rbac/argocd-server-clusterrole.yaml
- type: https
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:git_tag}/manifests/cluster-rbac/argocd-server-clusterrolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:git_tag}/rbac/argocd-server-clusterrolebinding.yaml
source: https://raw.githubusercontent.com/argoproj/argo-cd/${argocd:images:argocd:tag}/manifests/cluster-rbac/argocd-server-clusterrolebinding.yaml
output_path: dependencies/argocd/manifests/${argocd:images:argocd:tag}/rbac/argocd-server-clusterrolebinding.yaml

compile:
- input_paths:
Expand All @@ -85,7 +85,7 @@ parameters:
- output_path: argocd/00_crds/
input_type: copy
input_paths:
- argocd/manifests/${argocd:git_tag}/crds/
- argocd/manifests/${argocd:images:argocd:tag}/crds/
- output_path: argocd/01_rbac/
input_type: jsonnet
input_paths:
Expand Down
3 changes: 1 addition & 2 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ parameters:
prometheus: platform
cluster_id: ${cluster:name}
tenant_id: ${cluster:tenant}
git_tag: v2.2.2
resync_seconds: 180

images:
argocd:
image: quay.io/argoproj/argocd
tag: ${argocd:git_tag}
tag: v2.2.2
redis:
image: docker.io/library/redis
tag: '6.2.6'
Expand Down
11 changes: 6 additions & 5 deletions component/application-controller.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ local kube = import 'lib/kube.libjsonnet';
local inv = kap.inventory();
local params = inv.parameters.argocd;
local image = params.images.argocd.image + ':' + params.images.argocd.tag;
local loadManifest = (import 'common.libsonnet').loadManifest;

local statefulset = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/application-controller/argocd-application-controller-statefulset.yaml'));
local role = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/application-controller/argocd-application-controller-role.yaml'));
local role_binding = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/application-controller/argocd-application-controller-rolebinding.yaml'));
local serviceaccount = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/application-controller/argocd-application-controller-sa.yaml'));
local metrics_svc = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/application-controller/argocd-metrics.yaml'));
local statefulset = loadManifest('application-controller/argocd-application-controller-statefulset.yaml');
local role = loadManifest('application-controller/argocd-application-controller-role.yaml');
local role_binding = loadManifest('application-controller/argocd-application-controller-rolebinding.yaml');
local serviceaccount = loadManifest('application-controller/argocd-application-controller-sa.yaml');
local metrics_svc = loadManifest('application-controller/argocd-metrics.yaml');

local objects = [
statefulset {
Expand Down
10 changes: 10 additions & 0 deletions component/common.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
local kap = import 'lib/kapitan.libjsonnet';
local inv = kap.inventory();
local params = inv.parameters.argocd;

local loadManifest = function(path)
std.parseJson(kap.yaml_load('argocd/manifests/' + params.images.argocd.tag + '/' + path));

{
loadManifest: loadManifest,
}
2 changes: 1 addition & 1 deletion component/monitoring.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ local grafana_dashboard =
},
spec: {
name: 'argocd',
url: 'https://raw.githubusercontent.com/argoproj/argo-cd/' + params.git_tag + '/examples/dashboard.json',
url: 'https://raw.githubusercontent.com/argoproj/argo-cd/' + params.images.argocd.tag + '/examples/dashboard.json',
},
};

Expand Down
9 changes: 5 additions & 4 deletions component/rbac.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';
local inv = kap.inventory();
local params = inv.parameters.argocd;
local loadManifest = (import 'common.libsonnet').loadManifest;

local controller_clusterrole = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/rbac/argocd-application-controller-clusterrole.yaml'));
local controller_clusterrolebinding = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/rbac/argocd-application-controller-clusterrolebinding.yaml'));
local server_clusterrole = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/rbac/argocd-server-clusterrole.yaml'));
local server_clusterrolebinding = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/rbac/argocd-server-clusterrolebinding.yaml'));
local controller_clusterrole = loadManifest('rbac/argocd-application-controller-clusterrole.yaml');
local controller_clusterrolebinding = loadManifest('rbac/argocd-application-controller-clusterrolebinding.yaml');
local server_clusterrole = loadManifest('rbac/argocd-server-clusterrole.yaml');
local server_clusterrolebinding = loadManifest('rbac/argocd-server-clusterrolebinding.yaml');

local patch_name(obj) =
obj {
Expand Down
9 changes: 5 additions & 4 deletions component/redis.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ local kube = import 'lib/kube.libjsonnet';
local inv = kap.inventory();
local params = inv.parameters.argocd;
local image = params.images.redis.image + ':' + params.images.redis.tag;
local loadManifest = (import 'common.libsonnet').loadManifest;

local deployment = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/redis/argocd-redis-deployment.yaml'));
local role_binding = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/redis/argocd-redis-rolebinding.yaml'));
local serviceaccount = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/redis/argocd-redis-sa.yaml'));
local service = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/redis/argocd-redis-service.yaml'));
local deployment = loadManifest('redis/argocd-redis-deployment.yaml');
local role_binding = loadManifest('redis/argocd-redis-rolebinding.yaml');
local serviceaccount = loadManifest('redis/argocd-redis-sa.yaml');
local service = loadManifest('redis/argocd-redis-service.yaml');

local isOnOpenshift = std.startsWith(params.distribution, 'openshift');

Expand Down
5 changes: 3 additions & 2 deletions component/repo-server.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ local kube = import 'lib/kube.libjsonnet';
local inv = kap.inventory();
local params = inv.parameters.argocd;
local image = params.images.argocd.image + ':' + params.images.argocd.tag;
local loadManifest = (import 'common.libsonnet').loadManifest;

local isOpenshift = std.startsWith(params.distribution, 'openshift');
local deployment = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/repo-server/argocd-repo-server-deployment.yaml'));
local service = std.parseJson(kap.yaml_load('argocd/manifests/' + params.git_tag + '/repo-server/argocd-repo-server-service.yaml'));
local deployment = loadManifest('repo-server/argocd-repo-server-deployment.yaml');
local service = loadManifest('repo-server/argocd-repo-server-service.yaml');
local vault_agent_config = kube.ConfigMap('vault-agent-config') {
data: {
'vault-agent-config.json': std.manifestJson({
Expand Down
Loading

0 comments on commit 6cd625c

Please sign in to comment.