Giter VIP home page Giter VIP logo

cluster-bootstrap-controller's Introduction

cluster-bootstrap-controller

This is a controller that tracks [GitopsCluster] objects.

It provides the following CRs:

ClusterBootstrapConfig

ClusterBootstrapConfig CR provides a Job template.

When a GitopsCluster is "Ready" a Job is created from the template, the template can access multiple fields.

apiVersion: capi.weave.works/v1alpha1
kind: ClusterBootstrapConfig
metadata:
  name: clusterbootstrapconfig-sample
  namespace: default
spec:
  clusterSelector:
    matchLabels:
      demo: "true"
  jobTemplate:
    generateName: 'run-wego-{{ .ObjectMeta.Name }}'
    spec:
      containers:
      - image: alpine:latest
        name: cat-kubeconfig
        volumeMounts:
        - name: kubeconfig
          mountPath: "/etc/wego"
          readOnly: true
        command: ["cat", "/etc/wego/value"]
      restartPolicy: Never
      volumes:
      - name: kubeconfig
        secret:
          secretName: '{{ .ObjectMeta.Name }}-kubeconfig'

This is using Go templating and the GitopsCluster object is provided as the context, this means that expressions like {{ .ObjectMeta.Name }} will get the name of the GitopsCluster that has transitioned to "Ready".

Annotations

Go templating doesn't easily support access to strings that have "/" in them, which is a common annotation naming strategy.

The templating provides a function called "annotation", this can accept a string annotation which can access an annotation.

e.g.

      volumes:
      - name: kubeconfig
        secret:
          secretName: '{{ annotation "example.com/secret-name }}'

SecretSync

SecretSync provides a way to sync secrets from management cluster to leaf cluster.

The CR references the secret on management cluster to be synced to matched leaf clusters.

SecretSync has a selector to select group of clusters based on their labels

Secrets will be re-synced to leaf clusters when updated

Example

apiVersion: capi.weave.works/v1alpha1
kind: SecretSync
metadata:
  name: my-dev-secret-syncer
  namespace: default
spec:
  clusterSelector:
    matchLabels:
      environment: dev
  secretRef:
    name: my-dev-secret
  targetNamespace: my-namespace

Installation

Release files are available https://github.com/weaveworks/cluster-bootstrap-controller/releases

You can install these e.g.

$ kubectl apply -f https://github.com/weaveworks/cluster-bootstrap-controller/releases/download/v0.0.5/cluster-bootstrap-controller-v0.0.5.yaml

cluster-bootstrap-controller's People

Contributors

bigkevmcd avatar yiannistri avatar foot avatar ahsayde avatar enekofb avatar monadic avatar sarataha avatar weaveworks-admin-bot avatar

Stargazers

 avatar Jean-François Roy avatar Koichi Shiraishi avatar Zyb Jared Valdez avatar

Watchers

 avatar  avatar  avatar Ahmed Faris avatar a.shabaan avatar Chetan Patwal avatar Ahmed Magdy  avatar  avatar  avatar

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.