-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
580 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource "helm_release" "argocd-root-app" { | ||
name = "argocd-root-app" | ||
repository = "https://argoproj.github.io/argo-helm" | ||
chart = "argocd-apps" | ||
namespace = "argocd" | ||
create_namespace = true | ||
version = "1.6.2" | ||
values = [file("${path.module}/argocd-root-app.yaml")] | ||
} |
20 changes: 20 additions & 0 deletions
20
kubernetes-terraform/modules/argocd-config/argocd-root-app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
applications: | ||
- name: production-argocd-aoa | ||
namespace: "argocd" | ||
finalizers: | ||
- resources-finalizer.argocd.argoproj.io | ||
destination: | ||
server: https://kubernetes.default.svc | ||
# name: in-cluster | ||
namespace: argocd | ||
project: default | ||
source: | ||
path: kubernetes/apps/production/argocd | ||
repoURL: https://github.com/Haibread/infrastructure.git | ||
targetRevision: "HEAD" | ||
directory: | ||
recurse: true | ||
syncPolicy: | ||
automated: | ||
prune: true | ||
selfHeal: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
terraform { | ||
required_providers { | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = ">=2.23.0" | ||
} | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = "2.11.0" | ||
} | ||
local = { | ||
source = "hashicorp/local" | ||
version = "2.4.0" | ||
} | ||
} | ||
required_version = ">= 1.0.0" | ||
} | ||
|
||
provider "kubernetes" { | ||
host = var.cluster_host | ||
token = var.cluster_token | ||
cluster_ca_certificate = base64decode(var.cluster_ca_certificate) | ||
} | ||
provider "helm" { | ||
kubernetes { | ||
host = var.cluster_host | ||
token = var.cluster_token | ||
cluster_ca_certificate = base64decode(var.cluster_ca_certificate) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
variable "cluster_host" { | ||
type = string | ||
} | ||
|
||
variable "cluster_token" { | ||
type = string | ||
} | ||
|
||
variable "cluster_ca_certificate" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
kubernetes-terraform/modules/external-secrets-argocd/external-secrets-app.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
resource "helm_release" "external-secrets" { | ||
name = "external-secrets" | ||
repository = "https://charts.external-secrets.io" | ||
chart = "external-secrets" | ||
namespace = "external-secrets" | ||
create_namespace = false | ||
version = "0.9.13" | ||
values = [file("${path.module}/external-secrets-values.yaml")] | ||
|
||
depends_on = [kubernetes_namespace.external-secrets] | ||
} | ||
|
||
resource "kubernetes_secret" "scw-secrets-store-secret-key" { | ||
metadata { | ||
name = "scw-secrets-store-secret-key" | ||
namespace = "external-secrets" | ||
} | ||
data = { | ||
secretKey = var.scw_secret_key | ||
} | ||
depends_on = [helm_release.external-secrets] | ||
} | ||
|
||
resource "kubernetes_namespace" "external-secrets" { | ||
metadata { | ||
name = "external-secrets" | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
kubernetes-terraform/modules/external-secrets-argocd/external-secrets-values.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
48 changes: 48 additions & 0 deletions
48
kubernetes-terraform/modules/external-secrets-argocd/providers.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
terraform { | ||
required_providers { | ||
scaleway = { | ||
source = "scaleway/scaleway" | ||
version = ">= 2.28.0" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = ">=2.23.0" | ||
} | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = "2.11.0" | ||
} | ||
local = { | ||
source = "hashicorp/local" | ||
version = "2.4.0" | ||
} | ||
kubectl = { | ||
source = "gavinbunney/kubectl" | ||
version = "1.14.0" | ||
} | ||
} | ||
required_version = ">= 1.0.0" | ||
} | ||
|
||
provider "scaleway" { | ||
region = "fr-par" | ||
} | ||
|
||
provider "kubernetes" { | ||
host = var.cluster_host | ||
token = var.cluster_token | ||
cluster_ca_certificate = base64decode(var.cluster_certificate) | ||
} | ||
provider "kubectl" { | ||
host = var.cluster_host | ||
token = var.cluster_token | ||
cluster_ca_certificate = base64decode(var.cluster_certificate) | ||
load_config_file = false | ||
} | ||
provider "helm" { | ||
kubernetes { | ||
host = var.cluster_host | ||
token = var.cluster_token | ||
cluster_ca_certificate = base64decode(var.cluster_certificate) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
kubernetes-terraform/modules/external-secrets-argocd/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
variable "cluster_host" { | ||
type = string | ||
} | ||
|
||
variable "cluster_token" { | ||
type = string | ||
} | ||
|
||
variable "cluster_certificate" { | ||
type = string | ||
} | ||
|
||
variable "scw_secret_key" { | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
kubernetes/apps/production/argocd/poc-project-observability-argocd-aoa.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: production-argocd-aoa | ||
namespace: argocd | ||
spec: | ||
destination: | ||
namespace: argocd | ||
#name: in-cluster | ||
project: default | ||
source: | ||
repoURL: https://github.com/Haibread/infrastructure.git | ||
path: kubernetes/apps/production/ | ||
targetRevision: "HEAD" | ||
directory: | ||
recurse: true | ||
syncPolicy: | ||
automated: {} |
27 changes: 27 additions & 0 deletions
27
kubernetes/apps/production/argocd/poc-project-observability-argocd-app.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: production-argocd | ||
namespace: argocd | ||
spec: | ||
destination: | ||
namespace: argocd | ||
name: in-cluster | ||
project: default | ||
sources: | ||
- repoURL: https://argoproj.github.io/argo-helm | ||
targetRevision: "6.6.0" | ||
chart: argo-cd | ||
helm: | ||
releaseName: argocd | ||
valueFiles: | ||
- $values/kubernetes/values/production/argocd/values.yaml | ||
- repoURL: https://github.com/Haibread/infrastructure.git | ||
targetRevision: "HEAD" | ||
ref: values | ||
syncPolicy: | ||
automated: | ||
selfHeal: true | ||
prune: true | ||
syncOptions: | ||
- ServerSideApply=true #Needed for CRDs |
19 changes: 19 additions & 0 deletions
19
kubernetes/apps/production/argocd/poc-project-observability-argocd-appproject.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: AppProject | ||
metadata: | ||
name: production-argocd | ||
namespace: argocd | ||
spec: | ||
description: "Production Cluster" | ||
sourceRepos: | ||
- "https://github.com/Haibread/infrastructure.git" | ||
destinations: | ||
- namespace: "argocd" | ||
server: https://kubernetes.default.svc | ||
- namespace: "monitoring" | ||
clusterResourceWhitelist: | ||
- kind: "*" | ||
group: "*" | ||
namespaceResourceWhitelist: | ||
- kind: "*" | ||
group: "*" |
22 changes: 22 additions & 0 deletions
22
kubernetes/apps/production/argocd/poc-project-observability-argocd-manifests.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: production-argocd-common | ||
namespace: argocd | ||
spec: | ||
destination: | ||
namespace: argocd | ||
name: in-cluster | ||
project: production-argocd | ||
source: | ||
repoURL: https://github.com/Haibread/infrastructure.git | ||
path: kubernetes/manifests/production/ | ||
targetRevision: "HEAD" | ||
directory: | ||
recurse: true | ||
syncPolicy: | ||
automated: | ||
selfHeal: true | ||
prune: true | ||
syncOptions: | ||
- ServerSideApply=true #Needed for CRDs |
28 changes: 28 additions & 0 deletions
28
kubernetes/apps/production/monitoring/grafana-loki.yml/grafana-loki.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: grafana-loki | ||
namespace: argocd | ||
annotations: | ||
argocd.argoproj.io/compare-options: ServerSideDiff=true | ||
spec: | ||
project: default | ||
sources: | ||
- repoURL: https://grafana.github.io/helm-charts | ||
targetRevision: "0.78.4" | ||
chart: loki-distributed | ||
helm: | ||
valueFiles: | ||
- $values/kubernetes/values/production/grafana-loki/values.yaml | ||
- repoURL: https://github.com/Haibread/infrastructure.git | ||
targetRevision: "HEAD" | ||
ref: values | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: grafana-loki | ||
syncPolicy: | ||
automated: | ||
selfHeal: true | ||
prune: true | ||
syncOptions: | ||
- ServerSideApply=true #Needed for CRDs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: monitoring | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "-1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: monitoring | ||
annotations: | ||
argocd.argoproj.io/sync-wave: "-1" |
Oops, something went wrong.