Coder Social home page Coder Social logo

patricklaabs / frigg Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 6.16 MB

'Frigg'tionless Craft GitOps-Enabled Kubernetes Clusters on Any Cloud

Home Page: https://patricklaabs.github.io/frigg/

License: MIT License

Go 100.00%
argocd cluster-api gitops kubernetes automation devops go golang k8s

frigg's Introduction

Frigg

Go Reference Go Report Card License: MIT

What is Frigg

Meaning of Frigg: Goddess of wisdom and crafts

Frigg

TL;DR:

With Frigg, you provision N-Kubernets Clusters, which are GitOps-enabled and have batteries included.

Frigg is a cli project, to easily create one to one hundred of Kubernetes clusters on different hyperscalers.

Since we relay heavenly on Cluster-API, we could implement any supported provider to Frigg
Check the supported Hyperscalers

No matter which hyperscaler you choose, your kubernetes clusters will be attached to one another, and are also GitOps enabled.

At the end, you will have N-amount of clusters, with a Github repository for each of them, where you are able to add more applications deployments.

Quick overview of Frigg()

Friggs Overview

Usage

Requirements:

  • Docker Desktop / Engine
    (Podman (is currently not yet fully supported))

Get the frigg cli:

Get the binary using go:

go install github.com/PatrickLaabs/[email protected]
curl -L -o frigg.tar.gz https://github.com/PatrickLaabs/frigg/releases/download/1.1.2/frigg_1.1.2_darwin_arm64.tar.gz
tar -xf frigg.tar.gz
chmod +x frigg
./frigg version

or download the binary at the releasepage:
Frigg - Github Release Page

Homebrew is on the way.

Start the deployment:

While everything gets bootstrapped and provisioned, the Frigg CLI
also creates a working directory inside your home directory at $HOME/.frigg

Inside this directory we will store every generated file, such as
the private and public ssh keypairs, various manifests, etc.

Set the environment variables:

export GITHUB_TOKEN=
export GITHUB_USERNAME=
export GITHUB_MAIL=

Running Frigg:

frigg provisions kubernetes cluster with capi and gitops in no-time

Usage:
  frigg [command]

Available Commands:
  bootstrap   bootstrap various clusters on different providers
  completion  Generate the autocompletion script for the specified shell
  delete      Deletes one of [cluster]
  help        Help about any command
  version     Prints the frigg CLI version

Provision your first management cluster:

frigg bootstrap capd cluster

or - to use the ClusterAPI Controllers - run:

frigg bootstrap capd-controller cluster

This might take a while, since we are doing some heavy lifting.

Provision your workload cluster ontop:

frigg bootstrap capd workloadcluster

or

frigg bootstrap capd-controller workloadcluster

After the provisioning of your management cluster is ready,
you can port-forward the argocd-server pod and login with:

User: admin
Password: frigg

Features

Supported Providers

  • vCluster
  • CAPD (Docker)

Providers under development

  • vSphere
  • Azure
  • Google
  • Harvester
  • Proxmox

Documentation

Further documentation is available in the /docs directory.

Relevant Repositories

Friggs Management-Cluster GitOps Repository Template

This Repository will the beating-heart for your management-cluster.
friggs-mgmt-repo-template

Friggs Workload-Clusters GitOps Repository Template

This Repository is used to provide a good foundation for your workload clusters with various deployments.
friggs-workload-repo-template

Frigg-Builder

This simple Tool will be used by ArgoCD Workflows to operate various things inside the pipeline.
Frigg-Builder

Sample-Application

An example application deployment for your workload clusters.
sample-application

Support

You like the project, and want to support further development? Glad to hear!

Buy Me A Coffee

Thank you very much, for supporting me ๐Ÿš€

frigg's People

Contributors

dependabot[bot] avatar patricklaabs avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

frigg's Issues

Moving consts into their own package

/kind feature

Describe the solution you'd like
Currently the consts are also defined in the vars.go package.
For better readability and clarity, i'd like to move them into their own package
called "consts.go"

// FriggVersion and VersionPreRelease constants are used to define the Version the Frigg CLI outputs on ./frigg version
const FriggVersion = "1.0.2"
const VersionPreRelease = ""

Anything else you would like to add:
Another side-effect, we could archive:
We can modify this package on release-creation, just to automatically bump the version as needed from the git.

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

๐Ÿ”จ enh: Checking, if gitops repo (argo-hub) already exists

/kind feature

Creating Argohub Repo out of Template Repo
GraphQL: Could not clone: Name already exists on this account (cloneTemplateRepository)

Cloning the new repository to the local working directory
Error cloning your Argohub Repo: repository already exists

Describe the solution you'd like
Implement a feature to check, if the repo already exists and skipping the clone process.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

:bug: Wrong Error Messaging, which might be misleading

/kind bug

What steps did you take and what happened:

Rendering the gitops template repo
Loggin in to Github with your provided Github Token
Error: exit status 1
The value of the GITHUB_TOKEN environment variable is being used for authentication.
To have GitHub CLI store credentials instead, first clear the value from the environment.

Creating Argohub Repo out of Template Repo
https://github.com/PatrickLaabs/argo-hub-test

Cloning the new repository to the local working directory
Enumerating objects: 67, done.
Counting objects: 100% (67/67), done.
Compressing objects: 100% (43/43), done.
Total 67 (delta 28), reused 52 (delta 22), pack-reused 0
Info: <nil>

Error on Reading the file: read /Users/patricklaabs/.frigg/argo-hub-test: is a directory

Error on opening the file: open /Users/patricklaabs/.frigg/argo-hub-test: is a directory

Error on writing the file: invalid argument

Error on closing file: invalid argument

We recieve some errors from the CLI even if the process was successfully.

What did you expect to happen:
To not have any errors returned.

ArgoHub Template Repo Renderer: GITHUB_USER_EMAIL is correctly replaces inside the function

/kind bug

What steps did you take and what happened:

git config user.name "GITHUB_USER"
git config user.email "GITHUB_USER_EMAIL"
git config user.name "PatrickLaabs"
git config user.email "PatrickLaabs_EMAIL"

Function:

	reGhUser := regexp.MustCompile(`GITHUB_USER`)
		reGhMail := regexp.MustCompile(`GITHUB_USER_EMAIL`)

		// Replace GITHUB_USER and GITHUB_USER_EMAIL
		newdata := replaceInString(data, reGhUser, username)
		newdata = replaceInString(newdata, reGhMail, usermail)

Adding a more generic way to interact with github

/kind feature

Describe the solution you'd like
Currently, at some point in the code, we relay on the github cli usage.
I'd like to more generic at this point, so we might be able to support other scm's easier.

feat: Implement a Test-Suite for Pull-Requests

/kind feature

Describe the solution you'd like
The current changes that will be merged with a PR are not being tested.
This should be improved.

Anything else you would like to add:
Maybe something like using Taskfile and Github Actions which will prov. a KinD cluster and bootstrap everything with frigg bootstrap capd cluster

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

enhancement: Move toolsdir creation to its own package, like we did with workdir

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Create a mgmt cluster on capd

in order to create the helmchartproxy installation in the right way and use labels for selection, we need to create a mgmt cluster after the initial bootstrap step.

This is a little bit overkill, but thats currently the only way to reach to the goal needed.

feat: re-work how we delete already provisioned clusters on local development

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Rework path definitions on various packages

/kind feature

Describe the solution you'd like
currently we define the paths like this

outputPath := homedir + "/" + vars.FriggDirName + "/" + vars.WorkloadManifest

but we could instead use filepath.Join

like

friggDir = filepath.Join(homedir, vars.FriggDirName, vars.FriggTools)

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

ArgoCD Workflow on MGMT - Template Repo Names in Script

/kind feature

Describe the solution you'd like
Currently, the Repo Names that are being created are hard-coded with the username and there is currently no solution to make this template-able.

We need to pass the Username as an Env to the container, so that we can replace the strings inside the script.

Anything else you would like to add:
No

feat: Rework Tools usage, from PATH to friggs toolsdir

/kind feature

Describe the solution you'd like
Since we introduced the prepare function, we should switch from using the installed tools from the users PATH to the pre-downloaded toolsdir of frigg.

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

feat: introduce capi controllers

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

Improve console output & logging

/kind feature

Describe the solution you'd like
The Logging output is currently kinda wild and needs some love.
Also, I'd love to add some colorised outputs to the terminal.

Anything else you would like to add:
Just need to go through each file ๐Ÿ˜„

Performance increasements for local development platform

/kind feature

Describe the solution you'd like
Running the frigg platform on your laptop, might take some time, till everything is up and running.
We should investigate and look for a solution to improve the time that is needed, to get everything up and running.

๐Ÿ”จ enh: capd workloadcluster prov. with argocd workflow trigger

/kind feature

Describe the solution you'd like
When we create a workload cluster ontop of the mgmt cluster, the workload cluster has to pull a lot of things in order to get fully ready.
As soon, as the control plane is ready - on mgmt-clusters perspective - the argocd workflow kicks in, and tries to run every thing.
The Script will fail, since the worker nodes and everything else is not yet fully ready and the part "Adding the workload cluster to argohub" will not work.

As a workaround, i set a high timer, so that the script will wait till everything will - eventually - be up and running.

Best solution would be:
Checking, that everything is up and running on the workload cluster. Maybe we should think about an event type, or using cloud events.

Anything else you would like to add:
This might be only an issue on local development, and might depend on your actual download speed from your internet provider.

โœจ feat: Release Issue Template

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

feature: Controller outside of kubernetes, to observe and maintain the root-mgmt cluster and his lifecycle

/kind feature

Describe the solution you'd like
Currently, we lack the feature of having the ability to maintain and observe the very first mgmt-cluster.
Everything attached ontop the first mgmt-cluster is managed by the root-mgmt.

Anything else you would like to add:
Maybe some ideas to that:

  • Having a Service, that runs with systemd (or something else, since mac is not systemd based)
  • starting the service on nohup
  • Some other way, to keep this process running, and maintain the mgmt-cluster.

โœจ documentation: Adding new docs for using the clusterapi controller

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

feat: Move tmpl-packages to the pkg directory

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

๐Ÿ› CAPD on CAPD with ClusterAPI Controllers fails

When we deploy the CAPD Provider for the ClusterAPI Controller, the deployment will fail because of the security context.

As a workaround, i added back the clusterctl installation of the capd provider:

//clusterapi.ApplyDockerInfraProvMgmt()
clusterapi.ClusterAPIMgmt()
statuscheck.ConditionsCapdControllersMgmt()

Mayb we should introduce the helm installation of the ClusterAPI Controllers with HelmChartProxies.

For this, we should need:

  • New Generators for the HelmChartProxy Manifests
  • Labels on the mgmt-cluster to start the installation
  • Apply the new created HelmChartProxy Manifests on the mgmt cluster
  • Check, if the prov. state is ready

introduce kubevirt for local cluster deployments using CAPIs Operator

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

feat: move packages from common dir directly to the pkg dir

/kind feature

Describe the solution you'd like
[A clear and concise description of what you want to happen.]

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Cluster-api-provider-vsphere version:
  • Cluster-api-provider-azure version:
  • Cluster-api-provider-docker version:
  • Cluster-api-provider-harvester version:
  • Cluster-api-provider-proxmox version:
  • cluster-api-provider-vcluster version:
  • Kubernetes version: (use kubectl version):
  • OS (e.g. from /etc/os-release):

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.