Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(argo-cd): add terraform #146

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions terraform/github.tf
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ resource "github_actions_secret" "private_repos_aws_secret_key" {
secret_name = "GH_AWS_SECRET_ACCESS_KEY"
plaintext_value = aws_iam_access_key.gh-actions.secret
}

// Ensure a kube-manifests repository exists for Argo deployments
resource "github_repository" "kube_manifests_repository" {
name = "kube-manifests"
description = "Kubernetes manifests for our cluster"
}
20 changes: 20 additions & 0 deletions terraform/helm/argo-cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
server:
additionalApplications:
- name: labs-kube-manifests
namespace: argo-cd
project: default
source:
repoURL: https://github.com/pennlabs/kube-manifests.git
targetRevision: HEAD
path: .
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: default
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
selfHeal: true
14 changes: 14 additions & 0 deletions terraform/modules/base_cluster/argo-cd.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
resource "kubernetes_namespace" "argo-cd" {
metadata {
name = "argo-cd"
}
}

resource "helm_release" "argo-cd" {
name = "argo-cd"
repository = "https://argoproj.github.io/argo-helm"
chart = "argo-cd"
version = "4.3.0"
namespace = kubernetes_namespace.argo-cd.metadata[0].name
values = var.argo-cd_values
}
6 changes: 6 additions & 0 deletions terraform/modules/base_cluster/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ variable "datadog_values" {
description = "Values to provide to the Datadog helm chart"
type = list(string)
}

// Argo-cd values
variable "argo-cd_values" {
description = "Values to provide to the Argo-cd helm chart"
type = list(string)
}
1 change: 1 addition & 0 deletions terraform/production-cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module "production-cluster" {
roleARN = module.iam-cert-manager.role-arn
})]
datadog_values = [file("helm/datadog.yaml")]
argo-cd_values = [file("helm/argo-cd.yaml")]
}


Expand Down