Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/shalb/cluster.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
voatsap committed Mar 24, 2020
2 parents 136665e + 2a183ff commit 720df4b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You receive:
1. Dedicate a separate repository for the infrastructure that will be managed by `cluster.dev`. This repo will host code for your clusters, deployments and other resources managed by GitOps.
Next steps should be done in that repo.

2. Obtain access credentials for your cloud account.
2. Obtain access credentials for your cloud account.
For example, in AWS it is called "Programmatic Access user", and looks like:

```yaml
Expand All @@ -53,7 +53,8 @@ cluster:
provider: aws
region: eu-central-1
vpc: default
domain: shalb.net # You need a domain in Route53
# You need a domain in Route53 account
domain: shalb.net
provisioner:
type: minikube
instanceType: m5.large
Expand Down
6 changes: 3 additions & 3 deletions bin/argocd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ source "$PRJ_ROOT"/bin/logging.sh
# Writes progress status
#######################################
function argocd::deploy_apps {
local cluster_apps=$1
local cluster_apps_array=( "${cluster_apps[@]}" )

DEBUG "Deploy ArgoCD apps via kubectl from kubernetes/apps folder"
DEBUG "Current folder $(pwd)"

INFO "Deploy Apps from /kubernetes/apps/<folder> into ArgoCD"

for i in "${cluster_apps[@]}"; do
run_cmd "kubectl apply -f $PRJ_ROOT/kubernetes/apps/$i --recursive";
for ARGO_APP_DIR in "${cluster_apps_array[@]}"; do
run_cmd "kubectl apply -f $PRJ_ROOT/kubernetes/apps/$ARGO_APP_DIR --recursive";
done

#TODO: enable deletion from ArgoCD application that are installed but not mentioned in target folders manifests
Expand Down
2 changes: 1 addition & 1 deletion bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ source "$PRJ_ROOT"/bin/logging.sh
function kube::deploy_apps {
INFO "Setup addons."
DEBUG "Deploy Addons via kubectl"
run_cmd "kubectl apply -f 'https://raw.githubusercontent.com/shalb/terraform-aws-minikube/master/addons/ingress.yaml'"
run_cmd "kubectl apply -f 'https://github.com/jetstack/cert-manager/releases/download/v0.13.0/cert-manager-no-webhook.yaml'"
run_cmd "kubectl apply -f 'https://raw.githubusercontent.com/shalb/terraform-aws-minikube/8a147f7c0044c318ec37990b50f0cabb205e9b44/addons/letsencrypt-prod.yaml'"
run_cmd "kubectl apply -f 'https://raw.githubusercontent.com/shalb/terraform-aws-minikube/master/addons/ingress.yaml'"
}

#######################################
Expand Down
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ for CLUSTER_MANIFEST_FILE in $MANIFESTS; do
NOTICE "Now run: $CLUSTER_MANIFEST_FILE"
DEBUG "Path where start new cycle: $PWD"

# Clean variables from previus cluster yaml parsing
unset cluster_apps

yaml::parse "$CLUSTER_MANIFEST_FILE"
yaml::create_variables "$CLUSTER_MANIFEST_FILE"
yaml::check_that_required_variables_exist "$CLUSTER_MANIFEST_FILE"
Expand Down
4 changes: 2 additions & 2 deletions terraform/aws/argocd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ resource "helm_release" "argo-cd" {
name = "argo-cd"
repository = data.helm_repository.argo.metadata[0].name
chart = "argo-cd"
version = "1.8.7"
version = "2.0.0"
namespace = "argocd"

values = [
Expand All @@ -51,7 +51,7 @@ resource "helm_release" "argo-cd" {
name = "server.certificate.domain"
value = var.argo_domain
}
set {
set {
name = "server.ingress.annotations.\"cluster\\.dev/domain\""
value = var.argo_domain
}
Expand Down
6 changes: 2 additions & 4 deletions terraform/aws/argocd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ server:
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
cluster.dev/domain: domain.shalb.net # passed with terraform
labels: {}
hosts:
- domain.cluster.dev # passed with terraform
paths:
- /
tls:
- secretName: argocd-cert
- secretName: argocd-secret
hosts:
- domain.cluster.dev # passed with terraform
config:
Expand Down

0 comments on commit 720df4b

Please sign in to comment.