Move ArgoCD back to infra bootstrap

Avoid ArgoCD server issue when applying Argo apps to quickly
This commit is contained in:
Khue Doan 2021-06-09 01:03:40 +07:00
parent bf8ea27bc0
commit 3516b2cb29
6 changed files with 24 additions and 13 deletions

View File

@ -49,7 +49,7 @@
- DHCP server point it to the TFTP server to get boot files and boot config - DHCP server point it to the TFTP server to get boot files and boot config
- The boot config contains parameter to get [automated OS installation config file](./metal/roles/pxe-boot/templates/http/kickstart/fedora.ks.j2) - The boot config contains parameter to get [automated OS installation config file](./metal/roles/pxe-boot/templates/http/kickstart/fedora.ks.j2)
- The OS get installed and the machine reboots to the new operating system - The OS get installed and the machine reboots to the new operating system
- Terraform will create a Kubernetes [cluster](./infra/main.tf) - Terraform will create a Kubernetes [cluster](./infra/cluster.tf) and some install some [Helm chart for bootstrap](./infra/bootstrap.tf)
- ArgoCD will install the [applications](./apps/resources) - ArgoCD will install the [applications](./apps/resources)
### Layers ### Layers
@ -58,7 +58,7 @@
|-------|------------------------|---------------------------------------------------------|---------------------| |-------|------------------------|---------------------------------------------------------|---------------------|
| 0 | [metal](./metal) | Bare metal OS installation, Terraform state backend,... | Ansible, PXE server | | 0 | [metal](./metal) | Bare metal OS installation, Terraform state backend,... | Ansible, PXE server |
| 1 | [infra](./infra) | Kubernetes clusters | Terraform, Helm | | 1 | [infra](./infra) | Kubernetes clusters | Terraform, Helm |
| 2 | [apps](./apps) | Gitea, Vault and more in the future | Argo | | 2 | [apps](./apps) | Gitea, Vault and more in the future | ArgoCD |
## Get Started ## Get Started

View File

@ -2,9 +2,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
# Prerequisites
- resources/namespace.yaml
- github.com/argoproj/argo-cd//manifests/cluster-install?ref=v2.0.2
# System # System
- resources/cert-manager.yaml - resources/cert-manager.yaml
- resources/longhorn.yaml - resources/longhorn.yaml

View File

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: argocd

18
infra/bootstrap.tf Normal file
View File

@ -0,0 +1,18 @@
provider "helm" {
kubernetes {
host = rke_cluster.cluster.api_server_url
client_certificate = rke_cluster.cluster.client_cert
client_key = rke_cluster.cluster.client_key
cluster_ca_certificate = rke_cluster.cluster.ca_crt
}
}
resource "helm_release" "argocd" {
name = "argocd"
repository = "https://argoproj.github.io/argo-helm"
chart = "argo-cd"
version = "3.1.2"
namespace = "argocd"
create_namespace = true
}

View File

@ -1,3 +1,7 @@
provider "rke" {
debug = true
}
locals { locals {
hosts = yamldecode(file("../metal/hosts.yml")) hosts = yamldecode(file("../metal/hosts.yml"))
user = local.hosts.metal.vars.ansible_user user = local.hosts.metal.vars.ansible_user

View File

@ -14,7 +14,3 @@ terraform {
} }
} }
} }
provider "rke" {
debug = true
}