diff --git a/pkg/argocd/app-controller.go b/pkg/argocd/app-controller.go index 3e95938..f5def20 100644 --- a/pkg/argocd/app-controller.go +++ b/pkg/argocd/app-controller.go @@ -22,11 +22,13 @@ func createApplicationControllerStatefulSet(ctx context.Context, clientset *kube for k, v := range argoLabels { labels[k] = v } + annotations := argoAnnotations statefulset := &appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, Labels: labels, + Annotations: annotations, }, Spec: appsv1.StatefulSetSpec{ Selector: &metav1.LabelSelector{ diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index c82a7ac..402d8c4 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -21,6 +21,10 @@ var ( argoLabels = map[string]string{ "app.kubernetes.io/part-of": "argocd", "argocd.argoproj.io/instance": "argocd", + "steward.syn.tools/bootstrap": "true", + } + argoAnnotations = map[string]string{ + "argocd.argoproj.io/sync-options": "Prune=false", } argoSSHSecretName = "argo-ssh-key" argoSSHPublicKey = "sshPublicKey" diff --git a/pkg/argocd/redis.go b/pkg/argocd/redis.go index 2d33575..3434b97 100644 --- a/pkg/argocd/redis.go +++ b/pkg/argocd/redis.go @@ -22,11 +22,13 @@ func createRedisDeployment(ctx context.Context, clientset *kubernetes.Clientset, for k, v := range argoLabels { labels[k] = v } + annotations := argoAnnotations service := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, Labels: labels, + Annotations: annotations, }, Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeClusterIP, @@ -48,6 +50,7 @@ func createRedisDeployment(ctx context.Context, clientset *kubernetes.Clientset, Name: name, Namespace: namespace, Labels: labels, + Annotations: annotations, }, Spec: appsv1.DeploymentSpec{ Selector: &metav1.LabelSelector{ diff --git a/pkg/argocd/repo-server.go b/pkg/argocd/repo-server.go index b62c920..f3cd475 100644 --- a/pkg/argocd/repo-server.go +++ b/pkg/argocd/repo-server.go @@ -22,11 +22,13 @@ func createRepoServerDeployment(ctx context.Context, clientset *kubernetes.Clien for k, v := range argoLabels { labels[k] = v } + annotations := argoAnnotations service := &corev1.Service{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, Labels: labels, + Annotations: argoAnnotations, }, Spec: corev1.ServiceSpec{ Type: corev1.ServiceTypeClusterIP, @@ -47,6 +49,7 @@ func createRepoServerDeployment(ctx context.Context, clientset *kubernetes.Clien Name: name, Namespace: namespace, Labels: labels, + Annotations: annotations, }, Spec: appsv1.DeploymentSpec{ Selector: &metav1.LabelSelector{ diff --git a/pkg/argocd/server.go b/pkg/argocd/server.go index b6cd9c9..4ba00d3 100644 --- a/pkg/argocd/server.go +++ b/pkg/argocd/server.go @@ -22,11 +22,13 @@ func createServerDeployment(ctx context.Context, clientset *kubernetes.Clientset for k, v := range argoLabels { labels[k] = v } + annotations := argoAnnotations deployment := &appsv1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, Labels: labels, + Annotations: annotations, }, Spec: appsv1.DeploymentSpec{ Selector: &metav1.LabelSelector{