gitops-toolkit

command module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

gitops-toolkit

Helpful manifests, scripts, and tools for gitops. Currently, the go binary supports creating N of clusters and allowing a GitOps engine to manage them. The first use case was to setup an environment to test Argo CD Application Sets, specifically with cluster generators.

Shell Script

The first version of the toolkit was done via shell scripts.

Getting Started

Build/Install
make build
./bin/gitops-toolkit
go install github.com/rumstead/gitops-toolkit
Configuring

The script reads a json configuration file to create clusters. Order of the clusters matters because of how K3d updates DNS. The bottom most cluster can address all cluster above it.

Schema

A json schema file can be found here with a sample.

Generating a configuration file

You can use the proto structs to write your configuration in code and dump them out as json.

What is happening under the covers?

Creates clusters

K3d is the only supported Kubernetes distribution.

k3d cluster list    
NAME    SERVERS   AGENTS   LOADBALANCER
admin   1/1       0/0      true
dev     1/1       0/0      true
qa      1/1       0/0      true
tst     1/1       0/0      true
Deploys GitOps Engine

Argo CD is deployed to any configured GitOps clusters.

kgd -n argocd     
NAME                               READY   UP-TO-DATE   AVAILABLE   AGE
argocd-redis                       1/1     1            1           129m
argocd-notifications-controller    1/1     1            1           129m
argocd-applicationset-controller   1/1     1            1           130m
argocd-repo-server                 1/1     1            1           129m
argocd-server                      1/1     1            1           129m
argocd-dex-server                  1/1     1            1           130m

Argo CD is the only supported GitOps Engine.

kgsec -n  argocd --show-labels -l argocd.argoproj.io/secret-type=cluster 
NAME                                    TYPE     DATA   AGE    LABELS
cluster-k3d-admin-serverlb-2295321533   Opaque   3      118m   argocd.argoproj.io/secret-type=cluster
cluster-k3d-dev-serverlb-422902893      Opaque   3      119m   argocd.argoproj.io/secret-type=cluster,kubernetes.cnp.io/cluster.jurisdiction=k3d,
kubernetes.cnp.io/cluster.name=dev,kubernetes.cnp.io/cluster.region=muse2,kubernetes.cnp.io/cluster.segment=multitenant,kubernetes.cnp.io/environment=dev
cluster-k3d-tst-serverlb-756887653      Opaque   3      119m   argocd.argoproj.io/secret-type=cluster,kubernetes.cnp.io/cluster.jurisdiction=k3d,
kubernetes.cnp.io/cluster.name=tst,kubernetes.cnp.io/cluster.region=muse2,kubernetes.cnp.io/cluster.segment=multitenant,kubernetes.cnp.io/environment=tst
cluster-k3d-qa-serverlb-3703346418      Opaque   3      119m   argocd.argoproj.io/secret-type=cluster,kubernetes.cnp.io/cluster.jurisdiction=k3d,
kubernetes.cnp.io/cluster.name=qa,kubernetes.cnp.io/cluster.region=musw2,kubernetes.cnp.io/cluster.segment=multitenant,kubernetes.cnp.io/environment=qa

Documentation

Overview

Copyright © 2022 rumstead

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL