+ - 0:00:00
Notes for current slide
Notes for next slide

Using Github action with ArgoCD

anarcher@gmail.com

2019-10-05

1 / 19

Github action

https://github.com/features/actions

Pros:

  • Github native CI (Don't need CI setup)
  • Reusable job step pacakge (github action)

Cons:

2 / 19

3 / 19

.github/workflows/build.yml

name: skaffold-build
on:
push:
branches:
- '**'
tags-ignore:
- 'v*'
paths-ignore:
- 'k8s/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: skaffold build
uses: anarcher/skaffold-action@master
with:
skaffold: build -p test
4 / 19

workflows

A configurable automated process that you can set up in your repository to build,test,package,relase, or deploy any project on GitHub. Workflows are made up of one or more kjobs and can be scheduled or activated by an event.

jobs

A defined task made up of steps. Each job is run in a fresh instance of the virtual environment. You can define the dependency rules for how jobs run in a workflow file. Jobs can run at the same time in parallel or be dependent on the status of a previous job and run sequenially.

steps

A Step is a set of tasks performed by a job. Each step in a job executes in the same virtual environment,allowing the actions in that job to share information using the filesystem. Steps can run commands or actions.

5 / 19

Actions

Actions are ther smallest portable building block of a workflow.

How do make github action?

6 / 19

Separate of concerns

7 / 19
- name: skaffold build & publish - ${{ github.ref }}
uses: anarcher/skaffold-action@master
with:
skaffold: build -p publish
kustomize: edit set image anarcher/hello-ghact-argocd:${IMAGE_TAG}
kustomize_path: ./k8s/prod/
docker_username: ${{ secrets.DOCKER_GITHUB_USERNAME }}
docker_password: ${{ secrets.DOCKER_GITHUB_PASSWORD }}
anarch@vacuum-2 ~/git/anarcher/skaffold-action (master)
Dockerfile LICENSE README.md action.yml entrypoint.sh
#!/bin/sh -l
if [ -n "${INPUT_DOCKER_PASSWORD}" ]; then
echo "[DOCKER_LOGIN]"
sh -c "echo ${INPUT_DOCKER_PASSWORD} | docker login -u ${INPUT_DOCKER_USERNAME} --password-stdin ${INPUT_DOCKER_REGISTRY}"
fi
8 / 19

Skaffold

https://skaffold.dev/

Skaffold is a command line tool that facilitates continuous development for Kubernetes applications.

You can iterate on your application source code locally then deploy to local or remote Kubernetes clusters. Skaffold handles the workflow for building, pushing and deploying your application. It also provides building blocks and describe customizations for a CI/CD pipeline.

https://asciinema.org/a/DQXtaDVquXmg6jdCxuLfodSJ4

9 / 19

10 / 19

11 / 19

ArgoCD

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes.

12 / 19

13 / 19

Architecture

14 / 19

15 / 19

16 / 19

17 / 19

Demo

18 / 19

19 / 19

Github action

https://github.com/features/actions

Pros:

  • Github native CI (Don't need CI setup)
  • Reusable job step pacakge (github action)

Cons:

2 / 19
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow