GithubHelp home page GithubHelp logo

isabella232 / fluxctl-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluxcd/fluxctl-action

0.0 0.0 0.0 14 KB

A GitHub Action to run fluxctl commands

Home Page: https://docs.fluxcd.io/en/latest/references/fluxctl/

License: Apache License 2.0

Dockerfile 36.01% Shell 63.99%

fluxctl-action's Introduction

fluxctl-action

e2e

A GitHub Action to run fluxctl commands.

Usage

In order to use fluxctl in GitHub Actions you have to install kubectl on the GitHub Action runner and setup the current context to a Kubernetes cluster where Flux is running.

name: Synchronize cluster

on: push

jobs:
  fluxctl:
    runs-on: ubuntu-latest
    steps:
      - uses: azure/setup-kubectl@v1
      - uses: azure/k8s-set-context@v1
        with:
          method: kubeconfig
          kubeconfig: <your kubeconfig>
      - name: Setup fluxctl
        uses: fluxcd/fluxctl-action@master
      - name: Synchronize cluster
        env:
          FLUX_FORWARD_NAMESPACE: flux
        run: fluxctl sync

Kubernetes Kind

You can use the fluxctl GitHub Action together with Kubernetes Kind to build an end-to-end testing pipeline for the git repository that defines your cluster desired state.

name: e2e

on: push

jobs:
  fluxctl:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup Kubernetes
        uses: engineerd/[email protected]
      - name: Setup fluxctl
        uses: fluxcd/fluxctl-action@master
      - name: Install Flux
        run: |
          kubectl create ns flux
          fluxctl install \
          --git-path=test \
          --git-branch=${GITHUB_REF#refs/heads/} \
          --git-readonly=true \
          --registry-disable-scanning=true \
          [email protected] \
          --git-url=https://github.com/fluxcd/fluxctl-action.git \
          --namespace=flux | kubectl apply -f -
      - name: Verify install
        run: kubectl -n flux rollout status deploy/flux --timeout=1m
      - name: Sync git with cluster
        env:
          FLUX_FORWARD_NAMESPACE: flux
        run: fluxctl sync
      - name: Verify sync
        run: kubectl get ns | grep test

Note that we set --git-branch=${GITHUB_REF#refs/heads/} so that Flux will sync the current branch.

If the git repository is not public, then you have to configure Flux with a personal access token so that it can synchronize the repo over HTTPS.

fluxctl-action's People

Contributors

stefanprodan 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.