Git Product home page Git Product logo

sample-terraform-kubernetes-argocd's Introduction

Manage Kubernetes Cluster with Terraform and Argo CD Twitter

CircleCI

In this project I'm demonstrating you how to use Terraform together with Argo CD to create and manage the Kubernetes cluster on Kind.

Prerequisites

  1. Terraform CLI installed
  2. Docker

Getting Started

You may the detailed explanation of that example repository in the following article: Manage Kubernetes Cluster with Terraform and Argo CD

First, clone that repo:

$ git clone https://github.com/piomin/sample-terraform-kubernetes-argocd.git
$ cd sample-terraform-kubernetes-argocd

Then initialize Terraform config:

terraform init

Review the actions plan:

terraform plan

Run the Terraform actions:

terraform apply

Results

After running the previous command you receive:

  • 3-nodes Kind cluster running locally
  • OLM (Operator Lifecycle Manager) installed on Kind
  • Argo CD installed on Kind
  • Kafka Strimzi operator ready to use
  • 3-node Kafka cluster created on Kind

sample-terraform-kubernetes-argocd's People

Contributors

piomin avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sample-terraform-kubernetes-argocd's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • terraform 3.2.1
terraform
main.tf
  • argo-cd 6.9.3
  • argocd-apps 1.6.2
  • kind 0.4.0
  • kubectl 1.14.0
sealedsecrets/main.tf
sealedsecrets/providers.tf

  • Check this box to trigger a request for Renovate to run again on this repository

Upgrading to newer versions, dependencies - solved

Thanks for your awesome posting on this topic. Today I got it running on Azure Kubernetes and local Minikube.

From argocd helm chart version 5.0.0 onwards the 'values' block does not support 'additionalApplications' any more. There exists now an argocd-apps chart for that. On the other hand I had to fill in some dependencies, because I got errors during olm_apply.

Here are my changes in the tf-file:

data "kubectl_file_documents" "crds" {
  content = file("olm/crds.yaml") 
}

resource "kubectl_manifest" "crds_apply" {
  for_each          = data.kubectl_file_documents.crds.manifests
  yaml_body         = each.value
  wait              = true
  server_side_apply = true
}

data "kubectl_file_documents" "olm" {
  content = file("olm/olm.yaml")
}

resource "kubectl_manifest" "olm_apply" {
  depends_on = [kubectl_manifest.crds_apply]
  for_each   = data.kubectl_file_documents.olm.manifests
  yaml_body  = each.value
  wait       = true
}

resource "helm_release" "argocd" {
  name             = "argocd"
  repository       = "https://argoproj.github.io/argo-helm"
  chart            = "argo-cd"
  namespace        = "argocd"
  version          = "5.5.8"
  create_namespace = true

  depends_on = [kubectl_manifest.olm_apply]
}

resource "helm_release" "argocd_apps" {
  name             = "argocd-apps"
  repository       = "https://argoproj.github.io/argo-helm"
  chart            = "argocd-apps"
  namespace        = "argocd"
  
  values = [
    file("argocd/application.yaml")
  ]

  depends_on = [helm_release.argocd]
}

Also the structure of the application.yaml-content used by the argocd-apps chart has to be slightly changed:

applications: 
  - name: cluster-config
    namespace: argocd
    project: default
    source:
      repoURL: https://github.com/piomin/sample-terraform-kubernetes-argocd.git
      targetRevision: HEAD
      path: manifests/cluster
      directory:
        recurse: true
    destination:
      server: https://kubernetes.default.svc
    syncPolicy:
      automated:
        prune: false
        selfHeal: false

One more hint: when deploying on Azure Kubernetes only four storage disks are allowed using a cheaper one B2s, B2ms (B-series sizing in AKS). So I reduced Kafka to two replicas, Zookeeper to one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.