setup argocd kustomize

This commit is contained in:
Victor Barba Martin 2021-11-16 19:21:02 +01:00
parent b2da6a35f9
commit 102b29a89b
23 changed files with 89 additions and 27 deletions

View File

View File

@ -8,10 +8,7 @@ spec:
namespace: argocd
server: 'https://kubernetes.default.svc'
source:
helm:
valueFiles:
- values-{{ .Values.environment }}.yaml
path: k8s/argocd
path: k8s/argocd/
repoURL: 'git@bitbucket.org:jamkazam/video-iac.git'
targetRevision: HEAD
project: default

View File

@ -0,0 +1 @@
environment: "staging"

View File

@ -1,6 +0,0 @@
dependencies:
- name: argo-cd
repository: https://argoproj.github.io/argo-helm
version: 3.26.8
digest: sha256:7bc244d0e512a0c8c0d564c8d903b9137c2530ca418532ea171faa6f23bc7694
generated: "2021-11-16T17:46:33.014299+01:00"

View File

@ -1,7 +0,0 @@
apiVersion: v2
name: argocd
version: '1.0'
dependencies:
- name: argo-cd
version: "3.26.8"
repository: "https://argoproj.github.io/argo-helm"

View File

@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: applications
spec:
destination:
name: ''
server: 'https://kubernetes.default.svc'
source:
path: k8s/applications
repoURL: 'git@bitbucket.org:jamkazam/video-iac.git'
targetRevision: HEAD
project: default
syncPolicy:
syncOptions:
- CreateNamespace=true
automated:
prune: true
allowEmpty: false
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m

View File

@ -8,13 +8,10 @@ metadata:
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# If you encounter a redirect loop or are getting a 307 response code
# then you need to force the nginx ingress to connect to the backend using HTTPS.
#
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
rules:
- host: {{ .Values.hostname}}
- host: hostname
http:
paths:
- path: /
@ -26,5 +23,5 @@ spec:
name: https
tls:
- hosts:
- {{ .Values.hostname}}
- hostname
secretName: argocd-secret # do not change, this is provided by Argo CD

View File

@ -0,0 +1,8 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: argocd
resources:
#- https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- ingress.yaml
- applications.yaml

Binary file not shown.

View File

@ -0,0 +1,9 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: applications
spec:
source:
helm:
valueFiles:
- values-staging.yaml

View File

@ -0,0 +1,7 @@
---
- op: replace
path: /spec/rules/0/host
value: &host argocd.staging.video.jamkazam.com
- op: replace
path: /spec/tls/0/hosts/0
value: *host

View File

@ -0,0 +1,17 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patchesStrategicMerge:
- applications.yaml
patchesJson6902:
- path: hostname.yaml
target:
group: networking.k8s.io
kind: Ingress
name: argocd-server-ingress
version: v1

View File

@ -1,2 +0,0 @@
hostname: "argocd.staging.video.jamkazam.com"
environment: "staging"

View File

@ -36,6 +36,24 @@ provider "registry.terraform.io/hashicorp/aws" {
]
}
provider "registry.terraform.io/hashicorp/helm" {
version = "2.4.1"
hashes = [
"h1:CLb4n9f/hLyqqq0zbc+h5SuNOB7KnO65qOOb+ohwsKA=",
"zh:07517b24ea2ce4a1d3be3b88c3efc7fb452cd97aea8fac93ca37a08a8ec06e14",
"zh:11ef6118ed03a1b40ff66adfe21b8707ece0568dae1347ddfbcff8452c0655d5",
"zh:1ae07e9cc6b088a6a68421642c05e2fa7d00ed03e9401e78c258cf22a239f526",
"zh:1c5b4cd44033a0d7bf7546df930c55aa41db27b70b3bca6d145faf9b9a2da772",
"zh:256413132110ddcb0c3ea17c7b01123ad2d5b70565848a77c5ccc22a3f32b0dd",
"zh:4ab46fd9aadddef26604382bc9b49100586647e63ef6384e0c0c3f010ff2f66e",
"zh:5a35d23a9f08c36fceda3cef7ce2c7dc5eca32e5f36494de695e09a5007122f0",
"zh:8e9823a1e5b985b63fe283b755a821e5011a58112447d42fb969c7258ed57ed3",
"zh:8f79722eba9bf77d341edf48a1fd51a52d93ec31d9cac9ba8498a3a061ea4a7f",
"zh:b2ea782848b10a343f586ba8ee0cf4d7ff65aa2d4b144eea5bbd8f9801b54c67",
"zh:e72d1ccf8a75d8e8456c6bb4d843fd4deb0e962ad8f167fa84cf17f12c12304e",
]
}
provider "registry.terraform.io/hashicorp/http" {
version = "2.1.0"
hashes = [

View File

@ -26,9 +26,7 @@ provider "kubernetes" {
config_path = local_file.kubeconfig.filename
}
provider "kustomization" {
kubeconfig_path = local_file.kubeconfig.filename
}
resource "linode_lke_cluster" "prd-video-cluster" {
label = "prd-video-cluster"