Giter Site home page Giter Site logo

aks-gitops's Introduction

GitOps

Cluster Level Management

Basic set up

export GHUSER=jasoncabot-ms
export REPO=aks-gitops

We start with a cluster level flux that will manage the creation of cluster level resources, such as RBAC, service meshes, namespaces, ingress controllers, monitoring and observability hooks.

This repository would traditionally be maintained by an operations team

# Create a namespace for the pods that will monitor the Git repository
kubectl create namespace flux-cluster

fluxctl install \
    [email protected]:${GHUSER}/${REPO}.git \
    --git-path=cluster \
    --git-readonly \
    --namespace=flux-cluster | kubectl apply -f -
# Above command is the same as: kubectl apply -f ./bootstrap/01-cluster-flux.yaml

# Find the SSH key generated when starting flux
fluxctl identity --k8s-fwd-ns flux-cluster

# This key needs to be added to your GitHub repository since GitHub doesn't allow anonymous SSH clones, even of public repositories

Application Management

For a cluster administrator, create another flux to monitor and create applications

kubectl create namespace flux-apps

# This generates the manifest to deploy the application level resources
fluxctl install \
    [email protected]:${GHUSER}/${REPO}.git \
    --git-path=apps \
    --git-readonly \
    --namespace=flux-apps > ./bootstrap/02-aps-flux.yaml

# Before applying we must update the ClusterRoleBinding so that the flux-cluster retains access to it's git deploy secret 
+  - kind: ServiceAccount
+    name: flux
+    namespace: flux-cluster

# Find the SSH key generated when starting flux
fluxctl identity --k8s-fwd-ns flux-apps

# Again add this as a readonly deployment key in GitHub

Create a folder underneath apps for example ./apps/podinfo/ that will contain manifests related to the deployment of the app

Create a matching namespace at the cluster level, for example: ./cluster/namespaces/<name>.yaml

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.