Git Product home page Git Product logo

kubic's Introduction

Kubic - Kubernetes Infrastructure as Code

Kubernetes NGINX ArgoCD Vault Terraform

Available on:

Scaleway OVH

Overview

Kubic is a cutting edge, ready for production and multi cloud provider Kubernetes infrastructure as code. It integates an ingress controller, a certificate manager, a monitoring stack, a GitOps tool with complete secret management and a backup tool.

This Terraform aims at creating a managed k8s cluster setup with :

  • NGINX Ingress Controller
  • Cert-manager
  • Prometheus / Grafana
  • ArgoCD
  • Hashicorp Vault if needed
  • ArgoCD Vault Plugin if Vault is deployed
  • Velero for backuping the cluster

The cluster can be deployed either on OVHCloud or on Scaleway. New provider can be added by creating a new folder in the root of the repository, and by following the same architecture as the existing providers.

Repository architecture

.
├── docs                  # Folder containing the documentation
├── state_bucket          # Folder containing the Terraform to create a S3 bucket for the Terraform state
├── vault                 # Folder containing the Terraform to configure Hashicorp Vault
├── common                # Folder containing the Terraform which is common to all the providers
├── ovh                   # Folder declaring Terraform to deploy a cluster on OVHCloud
├── scaleway              # Folder declaring Terraform to deploy a cluster on Scaleway
├── examples              # Folder containing examples of applications to deploy with ArgoCD
├── .gitignore
├── LICENSE
└── README.md

All files contained in the folder common are symbolicaly linked in the folders ovh and scaleway to avoid code duplication.

Getting started

Contributing

Currently, only OVH and Scaleway are supported as providers. Here are the guidelines to add a new provider:

  • Create a new folder in the root of the repository, with the name of the provider;
  • Create a symlink for all files in common to your new folder;
  • Create a terraform.tf file containing:
    • Terraform configuration with a s3 backend;
    • The helm, kubernetes and kubectl providers along with the provider(s) you need, correctly configured;
  • A kubernetes.tf file creating the cluster, with an output named kubeconfig that contains the actual kubeconfig for the cluster;
  • A ingress-nginx.tf file, deploying the ingress-nginx ingress controller and configuring it with an external IP (you may need to create a load balancer on your provider). The ingress IP should be a Terraform output named ingress_ip;
    • This must also create a null_resource named ingress-nginx that will depends_on on the node pool of your cluster (this is to get a consistent dependency chain for Terraform)
    • The controller must have at least the following configuration:
controller:
  metrics:
    enabled: true
    serviceMonitor:
      additionalLabels:
        release: prometheus
      enabled: true
  extraArgs:
    enable-ssl-passthrough: true
  admissionWebhooks:
    timeoutSeconds: 30
  • Edit the docker-compose.yaml and create a service (adapt merely the code) for your provider.

kubic's People

Contributors

bilelelelelelel avatar eliecaratge avatar marcantoinegodde avatar p-bizouard avatar quentique avatar renovate[bot] avatar sampaccoud 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

p-bizouard zorky

kubic's Issues

ArgoCD and Vault Integration Issue: Unresolved Error in Admin Interface

I've been trying to understand why ArgoCD is not working with Vault for the second day already. I followed all the instructions. On the last step, I set up the infrastructure using bin/terraform-apply.sh scaleway. I successfully obtained the load balancer's IP and linked it to the domains. Next, I followed the Vault setup instructions. I generated cluster-keys.json and was able to access the Vault admin interface using the root_token from this file. However, I still see an error on the ArgoCD admin page:

rpc error: code = Unknown desc = Manifest generation error (cached): plugin sidecar failed. error generating manifests in cmp: rpc error: code = Unknown desc = error generating manifests: sh -c "helm template $ARGOCD_APP_NAME -n $ARGOCD_APP_NAMESPACE ${ARGOCD_ENV_HELM_ARGS} --include-crds . |\nargocd-vault-plugin generate - -s ${ARGOCD_ENV_AVP_SECRET}\n" failed exit status 1: Error: Error making API request. URL: PUT https://vault-st.my_site.io/v1/auth/kubernetes/login Code: 403. Errors: * service account name not authorized Usage: argocd-vault-plugin generate [flags] Flags: -c, --config-path string path to a file containing Vault configuration (YAML, JSON, envfile) to use -h, --help help for generate -s, --secret-name string name of a Kubernetes Secret in the argocd namespace containing Vault configuration data in the argocd namespace of your ArgoCD host (Only available when used in ArgoCD). The namespace can be overridden by using the format : --verbose-sensitive-output enable verbose mode for detailed info to help with debugging. Includes sensitive data (credentials), logged to stderr

I tried reinstalling ArgoCD with Vault already configured (commented out the contents of argocd.tf, did a plan and apply, and then uncommented and did a plan and apply), but it didn't help. I keep seeing this error. What am I doing wrong? Are there any additional steps that may be required?

Scaleway require a private network

Scaleway will deprecate the full public cluster and require to put K8S cluster in a private network. This will remove the public IP attached to the node to access to internet. See more information here

This will required to add the attribute private_network_id in the Scaleway's resource scaleway_k8s_cluster We use this resource here.

Private network are created in a VPC (Virtual private Cloud) by Scaleway.

resource "scaleway_vpc_private_network" "kapsule" {
  name = "pn_kapsule"
}

resource "scaleway_k8s_cluster" "k8s_cluster" {
  private_network_id = scaleway_vpc_private_network.kapsule.id
}

Before to change this in Kubic will need to answer to this questions:

  • Do we need to create a Gateway to access to Internet ?
  • Do we need to create the load balancer to be accessible by Internet ?
  • What are the procedure for running cluster ?

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

docker-compose
docker-compose.yaml
  • hashicorp/terraform 1.5.7
  • hashicorp/terraform 1.5.7
  • hashicorp/terraform 1.5.7
  • hashicorp/terraform 1.5.7
  • argoproj/argocd v2.6.15
  • bitnami/kubectl 1.29.2
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-python v5
  • actions/cache v4
terraform
common/argocd.tf
common/cert-manager.tf
  • cert-manager v1.14.2
common/hashicorp-vault.tf
common/prometheus-grafana.tf
common/velero.tf
ovh/ingress-nginx.tf
ovh/terraform.tf
  • helm ~> 2.12.0
  • kubectl ~> 1.14.0
  • kubernetes ~> 2.26.0
  • ovh ~> 0.37.0
scaleway/ingress-nginx.tf
scaleway/terraform.tf
  • helm ~> 2.12.0
  • kubectl ~> 1.14.0
  • kubernetes ~> 2.26.0
  • scaleway ~> 2.37.0
standalone/terraform.tf
  • helm ~> 2.12.0
  • kubectl ~> 1.14.0
  • kubernetes ~> 2.26.0
state_bucket/terraform.tf
  • aws ~> 5.0
  • ovh ~> 0.37.0
vault/terraform.tf
  • vault 3.25.0

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

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.