Skip to content

Instantly share code, notes, and snippets.

@dictcp
Last active June 23, 2021 02:27
Show Gist options
  • Select an option

  • Save dictcp/b0deb9e4f03e5bbcb337d3a689bb7693 to your computer and use it in GitHub Desktop.

Select an option

Save dictcp/b0deb9e4f03e5bbcb337d3a689bb7693 to your computer and use it in GitHub Desktop.

Revisions

  1. dictcp revised this gist Aug 1, 2020. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,9 @@
    ## About the workshop

    Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-gitops

    Video recording: https://www.youtube.com/watch?v=xykc3AsMQ04

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    ## Context
  2. dictcp revised this gist Aug 1, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    ## About the workshop

    Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-gitops

    Video recording: https://www.youtube.com/watch?v=xykc3AsMQ04
    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    ## Context
  3. dictcp revised this gist Jun 13, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -79,7 +79,7 @@ Normally you can install helm and fluxctl with the following 4 commands:
    sudo snap install kubectl --classic
    sudo snap install helm --classic --channel=3.0/stable
    sudo snap install fluxctl --classic
    rm /usr/local/bin/kubectl
    sudo rm /usr/local/bin/kubectl
    ```

    ### Manual steps (if the above does not work)
  4. dictcp revised this gist Jun 13, 2020. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,11 @@ Memory usage: 1.5G out of 1.9G
    6. Execute `multipass shell fluxcd-workshop` to obtain shell in the VMs

    ### DigitalOcean VM

    1. (If need) Signup DigitalOcean via https://m.do.co/c/3c4b5bb5da42
    2. create a droplet with 2GB and Ubuntu 18.04
    - https://cloud.digitalocean.com/droplets/new?size=s-2vcpu-2gb&region=sgp1&distro=ubuntu&distroImage=ubuntu-18-04-x64
    - You may set up Password Authentication for simpicity
    3. Wait a few minutes, and you can connect to the `ssh root@<<YOUR_DROPLET_IP>>`

    ## Install k3s Kubernetes on your VM

  5. dictcp revised this gist Jun 13, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -70,11 +70,12 @@ $ sudo cat /etc/rancher/k3s/k3s.yaml > .kube/config
    ```

    ## Install Helm & fluxctl
    Normally you can install helm and fluxctl with the following 2 commands:
    Normally you can install helm and fluxctl with the following 4 commands:
    ```
    sudo snap install kubectl --classic
    sudo snap install helm --classic --channel=3.0/stable
    sudo snap install fluxctl --classic
    rm /usr/local/bin/kubectl
    ```

    ### Manual steps (if the above does not work)
  6. dictcp revised this gist Jun 13, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -134,7 +134,10 @@ kubectl get ns
    ```

    ## fluxcd playaround
    1. copy `manifests-sample/podinfo-dep.yaml` and `manifests-sample/podinfo-svc.yaml` to `workloads/` in your `flux-get-started` repos; commit change and push

    2. check deployment progress
    `watch kubectl -n demo get pod`


    ## Install Helm operator
  7. dictcp revised this gist Jun 12, 2020. No changes.
  8. dictcp revised this gist Jun 12, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -25,8 +25,8 @@ Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn
    You need
    - a GitHub account (to access this material and setup gitops flow)
    - a working Kubernetes in the hands-on session (to s)
    - [multipass VM](#local-multipass-VM) (local installation, recommended)
    - [DigitalOcean VM] (remote installation)
    - [multipass VM](#multipass-vm) (local installation, recommended)
    - [DigitalOcean VM](#digitalocean-vm) (remote installation)

    ### multipass VM

    @@ -55,7 +55,7 @@ Memory usage: 1.5G out of 1.9G

    ## Install k3s Kubernetes on your VM

    1.
    1. Connect to the shell of the VM set up
    2. Execute `curl -sfL https://get.k3s.io | sh -` in the VM
    3. Depends on network condition, you need to wait for 5-10 mins.
    4. You should have your local Kubernetes cluster installed. To verify, execute `sudo -i k3s kubectl get nodes`, it should give you something like
  9. dictcp revised this gist Jun 12, 2020. 1 changed file with 7 additions and 2 deletions.
    9 changes: 7 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,8 @@ Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn
    - [fluxcd playaround](#fluxcd-playaround)
    - [Install Helm operator](#install-helm-operator) (bonus)
    - [Helm operator playaround](#helm-operator-playaround) (bonus)
    - [Continuous Delivery]() (bonus)
    - [Set up Lens](set-up-lens) (bonus)
    - [Continuous Delivery](continuous-delivery) (bonus)


    ## Hands-on Preparation
    @@ -206,4 +206,9 @@ EOF

    2. Add clusters with your KUBECONFIG

    3. check it out
    3. check it out

    ## Continuous Delivery

    1. Check into the magic of annotations `fluxcd.io/automated: "true"`
    - https://github.com/dictcp/flux-get-started/blob/master/workloads/podinfo-dep.yaml
  10. dictcp revised this gist Jun 12, 2020. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,7 @@ Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn
    - [Install Helm operator](#install-helm-operator) (bonus)
    - [Helm operator playaround](#helm-operator-playaround) (bonus)
    - [Continuous Delivery]() (bonus)
    - [Set up Lens](set-up-lens) (bonus)


    ## Hands-on Preparation
    @@ -196,4 +197,13 @@ EOF
    3. Port-forward the result
    `kubectl -n demo port-forward --address 0.0.0.0 service/ghost 8080:80`

    4. Open browser and check the result
    4. Open browser and check the result

    ## Set up Lens

    1. install Lens at https://k8slens.dev/
    - Mac OS X (with homebrew installed): `brew cask install lens`

    2. Add clusters with your KUBECONFIG

    3. check it out
  11. dictcp revised this gist Jun 12, 2020. 1 changed file with 56 additions and 1 deletion.
    57 changes: 56 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -36,7 +36,18 @@ You need
    2. Start Command prompt / Terminal
    3. Execute `multipass launch -d 30G -m 2G --name fluxcd-workshop 18.04`
    4. Depends on network condition, you need to wait for 5-20 mins.
    5. Execute `multipass shell fluxcd-workshop` to obtain shell in the VMs
    5. Check the IP of your VM via command `multipass info fluxcd-workshop`
    ```
    Name: fluxcd-workshop
    State: Running
    IPv4: 192.168.64.15
    Release: Ubuntu 18.04.4 LTS
    Image hash: 55646c02a8bc (Ubuntu 18.04 LTS)
    Load: 1.46 5.28 3.97
    Disk usage: 4.5G out of 28.9G
    Memory usage: 1.5G out of 1.9G
    ```
    6. Execute `multipass shell fluxcd-workshop` to obtain shell in the VMs

    ### DigitalOcean VM

    @@ -142,3 +153,47 @@ helm upgrade -i helm-operator fluxcd/helm-operator \

    ## Helm operator playaround

    1. copy `releases/ghost.yaml` as `workloads/ghost.yaml` in your `flux-get-started` repos; commit change and push
    OR running command
    ```
    cat <<EOF | kubectl apply -f -
    ---
    apiVersion: helm.fluxcd.io/v1
    kind: HelmRelease
    metadata:
    name: ghost
    namespace: demo
    annotations:
    fluxcd.io/automated: "false"
    fluxcd.io/tag.chart-image: glob:3.1.1-debian-9-*
    spec:
    releaseName: ghost
    chart:
    git: ssh://git@github.com/fluxcd/flux-get-started
    ref: master
    path: charts/ghost
    values:
    image:
    repository: bitnami/ghost
    tag: 3.1.1-debian-9-r0
    persistence:
    enabled: false
    resources:
    requests:
    memory: 32Mi
    cpu: 10m
    service:
    type: ClusterIP
    mariadb:
    master:
    persistence:
    enabled: false
    EOF
    ```
    2. check Helm install progress
    `watch kubectl -n demo get hr`

    3. Port-forward the result
    `kubectl -n demo port-forward --address 0.0.0.0 service/ghost 8080:80`

    4. Open browser and check the result
  12. dictcp revised this gist Jun 12, 2020. 1 changed file with 7 additions and 4 deletions.
    11 changes: 7 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -108,20 +108,23 @@ $ helm upgrade -i flux fluxcd/flux \
    fluxctl identity --k8s-fwd-ns flux
    ```

    4. Setup in GitHub
    4. Setup the in GitHub (eg. `https://github.com/${GHUSER}/flux-get-started/settings/keys`)
    Remember to enable `Allow write access`

    5. Trigger
    5. Trigger sync
    ```
    fluxctl sync --k8s-fwd-ns flux
    ```

    6. View the applied change
    6. View the applied change (you should see a `demo` namespace
    ```
    kubectl get
    kubectl get ns
    ```

    ## fluxcd playaround



    ## Install Helm operator

    1. Install the CRD for HelmRelease
  13. dictcp revised this gist Jun 12, 2020. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -88,14 +88,16 @@ sudo mv fluxctl /usr/local/bin/
    ## Install fluxcd

    1. Setup the chart repository for flux
    ```
    helm repo add fluxcd https://charts.fluxcd.io
    ```

    2. Install flux on Kubernetes cluster via Helm, with following commands
    ```
    ```shell
    $ export GHUSER="dictcp"

    $ kubectl create ns flux
    $ helm upgrade -i flux fluxcd/flux \
    $ helm upgrade -i flux fluxcd/flux \
    --set git.url=git@github.com:${GHUSER}/flux-get-started \
    --set 'git.path=namespaces\,workloads' \
    --namespace flux
  14. dictcp revised this gist Jun 12, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -30,9 +30,9 @@ You need
    ### multipass VM

    1. Install multipass on https://multipass.run
    - support Windows 10 Pro+, Mac OS X, Linux
    - Mac OS X (with homebrew installed): `brew cask install multipass`
    - Ubuntu (or any Linux distro with snap installed): `sudo snap install multipass --classic`
    - support Windows 10 Pro+, Mac OS X, Linux
    - Mac OS X (with homebrew installed): `brew cask install multipass`
    - Ubuntu (or any Linux distro with snap installed): `sudo snap install multipass --classic`
    2. Start Command prompt / Terminal
    3. Execute `multipass launch -d 30G -m 2G --name fluxcd-workshop 18.04`
    4. Depends on network condition, you need to wait for 5-20 mins.
  15. dictcp revised this gist Jun 12, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -95,10 +95,10 @@ helm repo add fluxcd https://charts.fluxcd.io
    $ export GHUSER="dictcp"
    $ kubectl create ns flux
    $ helm upgrade -i flux fluxcd/flux \
    --git-path=namespaces,workloads \
    --namespace flux \
    --set git.url=git@github.com:${GHUSER}/stackfiles
    $ helm upgrade -i flux fluxcd/flux \
    --set git.url=git@github.com:${GHUSER}/flux-get-started \
    --set 'git.path=namespaces\,workloads' \
    --namespace flux
    ```

    3. Copy the public SSH key
  16. dictcp revised this gist Jun 12, 2020. No changes.
  17. dictcp revised this gist Jun 12, 2020. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -14,8 +14,9 @@ Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn
    - [Prepare the git repository for GitOps](#prepare-the-git-repository-for-gitops)
    - [Install fluxcd](#install-fluxcd)
    - [fluxcd playaround](#fluxcd-playaround)
    - [Install Helm operator](#install-helm-operator)
    - [Helm operator playaround](#helm-operator-playaround)
    - [Install Helm operator](#install-helm-operator) (bonus)
    - [Helm operator playaround](#helm-operator-playaround) (bonus)
    - [Continuous Delivery]() (bonus)


    ## Hands-on Preparation
  18. dictcp revised this gist Jun 12, 2020. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -8,14 +8,14 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g
    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    ## Context
    - [Hands-on Preparation](#Hands-on_Preparation)
    - [Install k3s Kubernetes on your VM](#)
    - [Install Helm & fluxctl](#)
    - [Prepare the git repository for GitOps](#Prepare_the_git_repository-for-GitOps)
    - [Install fluxcd](#Install_fluxcd)
    - [fluxcd playaround](#fluxcd_playaround)
    - [Install Helm operator](#Install_Helm_operator)
    - [Helm operator playaround](#Helm_operator_playaround)
    - [Hands-on Preparation](#hands-on-preparation)
    - [Install k3s Kubernetes on your VM](#install-k3s-kubernetes-on-your-vm)
    - [Install Helm & fluxctl](#install-helm---fluxctl)
    - [Prepare the git repository for GitOps](#prepare-the-git-repository-for-gitops)
    - [Install fluxcd](#install-fluxcd)
    - [fluxcd playaround](#fluxcd-playaround)
    - [Install Helm operator](#install-helm-operator)
    - [Helm operator playaround](#helm-operator-playaround)


    ## Hands-on Preparation
  19. dictcp revised this gist Jun 12, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,17 +7,17 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    ## Context
    - [Hands-on Preparation](#Hands-on_Preparation)
    - [Install k3s Kubernetes on your VM](#)
    - [Install Helm & fluxctl](#)
    - [Prepare the git repository for GitOps](#Prepare the git repository for GitOps)
    - [Prepare the git repository for GitOps](#Prepare_the_git_repository-for-GitOps)
    - [Install fluxcd](#Install_fluxcd)
    - [fluxcd playaround](#fluxcd_playaround)
    - [Install Helm operator](#Install_Helm_operator)
    - [Helm operator playaround](#Helm_operator_playaround)



    ## Hands-on Preparation

    You need
    @@ -84,7 +84,7 @@ sudo mv fluxctl /usr/local/bin/

    1. Fork https://github.com/dictcp/flux-get-started in GitHub to your own account

    ## Install fluxcd via helm3
    ## Install fluxcd

    1. Setup the chart repository for flux
    helm repo add fluxcd https://charts.fluxcd.io
    @@ -117,7 +117,7 @@ fluxctl sync --k8s-fwd-ns flux
    kubectl get
    ```

    ## FluxCD playaround
    ## fluxcd playaround

    ## Install Helm operator

  20. dictcp revised this gist Jun 12, 2020. 1 changed file with 11 additions and 2 deletions.
    13 changes: 11 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,16 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    - [Hands-on Preparation](Hands-on_Preparation)
    - [Hands-on Preparation](#Hands-on_Preparation)
    - [Install k3s Kubernetes on your VM](#)
    - [Install Helm & fluxctl](#)
    - [Prepare the git repository for GitOps](#Prepare the git repository for GitOps)
    - [Install fluxcd](#Install_fluxcd)
    - [fluxcd playaround](#fluxcd_playaround)
    - [Install Helm operator](#Install_Helm_operator)
    - [Helm operator playaround](#Helm_operator_playaround)



    ## Hands-on Preparation

    @@ -125,5 +134,5 @@ helm upgrade -i helm-operator fluxcd/helm-operator \
    --namespace flux
    ```

    ## Helm operator FluxCD playaround
    ## Helm operator playaround

  21. dictcp revised this gist Jun 12, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    - [Hands-on Preparation]
    - [Hands-on Preparation](Hands-on_Preparation)

    ## Hands-on Preparation

  22. dictcp revised this gist Jun 12, 2020. 1 changed file with 1 addition and 7 deletions.
    8 changes: 1 addition & 7 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,13 +7,7 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    Everyone with their clean Ubuntu 18.04 VM in hand (10mins)
    Install k3s, the lightweight Kubernetes distribution from Rancher (10mins)
    Install helm3
    Prepare the git repository for GitOps (10mins)
    Install fluxcd via helm3 and playaround (10mins)
    Playaround Helm operator (bonus)

    - [Hands-on Preparation]

    ## Hands-on Preparation

  23. dictcp revised this gist Jun 12, 2020. 1 changed file with 24 additions and 4 deletions.
    28 changes: 24 additions & 4 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -77,11 +77,11 @@ chmod +x fluxctl
    sudo mv fluxctl /usr/local/bin/
    ```

    ## Setup
    ## Prepare the git repository for GitOps

    ## Install flux
    1. Fork https://github.com/dictcp/flux-get-started in GitHub to your own account

    0. Fork https://github.com/dictcp/flux-get-started in GitHub to your own account
    ## Install fluxcd via helm3

    1. Setup the chart repository for flux
    helm repo add fluxcd https://charts.fluxcd.io
    @@ -112,4 +112,24 @@ fluxctl sync --k8s-fwd-ns flux
    6. View the applied change
    ```
    kubectl get
    ```
    ```

    ## FluxCD playaround

    ## Install Helm operator

    1. Install the CRD for HelmRelease
    ```
    kubectl apply -f https://raw.githubusercontent.com/fluxcd/helm-operator/1.1.0/deploy/crds.yaml
    ```

    2. Install Helm Operator via Helm
    ```
    helm upgrade -i helm-operator fluxcd/helm-operator \
    --set git.ssh.secretName=flux-git-deploy \
    --set helm.versions=v3 \
    --namespace flux
    ```

    ## Helm operator FluxCD playaround

  24. dictcp revised this gist Jun 12, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -81,6 +81,8 @@ sudo mv fluxctl /usr/local/bin/

    ## Install flux

    0. Fork https://github.com/dictcp/flux-get-started in GitHub to your own account

    1. Setup the chart repository for flux
    helm repo add fluxcd https://charts.fluxcd.io

    @@ -90,6 +92,7 @@ $ export GHUSER="dictcp"
    $ kubectl create ns flux
    $ helm upgrade -i flux fluxcd/flux \
    --git-path=namespaces,workloads \
    --namespace flux \
    --set git.url=git@github.com:${GHUSER}/stackfiles
    ```
  25. dictcp revised this gist Jun 12, 2020. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -75,4 +75,38 @@ version.BuildInfo{Version:"v3.2.3", GitCommit:"8f832046e258e2cb800894579b1b3b50c
    wget -O fluxctl https://github.com/fluxcd/flux/releases/download/1.19.0/fluxctl_linux_amd64
    chmod +x fluxctl
    sudo mv fluxctl /usr/local/bin/
    ```

    ## Setup

    ## Install flux

    1. Setup the chart repository for flux
    helm repo add fluxcd https://charts.fluxcd.io

    2. Install flux on Kubernetes cluster via Helm, with following commands
    ```
    $ export GHUSER="dictcp"
    $ kubectl create ns flux
    $ helm upgrade -i flux fluxcd/flux \
    --namespace flux \
    --set git.url=git@github.com:${GHUSER}/stackfiles
    ```

    3. Copy the public SSH key
    ```
    fluxctl identity --k8s-fwd-ns flux
    ```

    4. Setup in GitHub

    5. Trigger
    ```
    fluxctl sync --k8s-fwd-ns flux
    ```

    6. View the applied change
    ```
    kubectl get
    ```
  26. dictcp revised this gist Jun 12, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -56,6 +56,7 @@ $ sudo cat /etc/rancher/k3s/k3s.yaml > .kube/config
    ## Install Helm & fluxctl
    Normally you can install helm and fluxctl with the following 2 commands:
    ```
    sudo snap install kubectl --classic
    sudo snap install helm --classic --channel=3.0/stable
    sudo snap install fluxctl --classic
    ```
  27. dictcp revised this gist Jun 12, 2020. 1 changed file with 38 additions and 1 deletion.
    39 changes: 38 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,14 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    Everyone with their clean Ubuntu 18.04 VM in hand (10mins)
    Install k3s, the lightweight Kubernetes distribution from Rancher (10mins)
    Install helm3
    Prepare the git repository for GitOps (10mins)
    Install fluxcd via helm3 and playaround (10mins)
    Playaround Helm operator (bonus)


    ## Hands-on Preparation

    You need
    @@ -26,15 +34,44 @@ You need
    4. Depends on network condition, you need to wait for 5-20 mins.
    5. Execute `multipass shell fluxcd-workshop` to obtain shell in the VMs

    ### DigitalOcean VM


    ## Install k3s Kubernetes on your VM

    1.
    2. Execute `curl -sfL https://get.k3s.io | sh -` in the VM
    3. Depends on network condition, you need to wait for 5-10 mins.
    4. You should have your local Kubernetes cluster installed. To verify, execute `sudo kubectl get nodes`, it should give you something like
    4. You should have your local Kubernetes cluster installed. To verify, execute `sudo -i k3s kubectl get nodes`, it should give you something like
    ```
    NAME STATUS ROLES AGE VERSION
    fluxcd-workshop Ready master 5m53s v1.18.3+k3s1`
    ```
    5. Make sure the cluster setup is avaiable by the following commands:
    ```
    $ mkdir .kube
    $ sudo cat /etc/rancher/k3s/k3s.yaml > .kube/config
    ```

    ## Install Helm & fluxctl
    Normally you can install helm and fluxctl with the following 2 commands:
    ```
    sudo snap install helm --classic --channel=3.0/stable
    sudo snap install fluxctl --classic
    ```

    ### Manual steps (if the above does not work)
    - Helm
    ```
    $ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
    $ chmod 700 get_helm.sh
    $ ./get_helm.sh
    $ helm version
    version.BuildInfo{Version:"v3.2.3", GitCommit:"8f832046e258e2cb800894579b1b3b50c2d83492", GitTreeState:"clean", GoVersion:"go1.13.12"}
    ```
    - fluxctl
    ```
    wget -O fluxctl https://github.com/fluxcd/flux/releases/download/1.19.0/fluxctl_linux_amd64
    chmod +x fluxctl
    sudo mv fluxctl /usr/local/bin/
    ```
  28. dictcp revised this gist Jun 12, 2020. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -7,18 +7,15 @@ Session at HKOSCon 2020: https://hkoscon.org/2020/topics/automating-kubernetes-g

    Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn63H8dHLP2g

    ## Hands-on sesesion

    ### Preparation
    ## Hands-on Preparation

    You need
    - a GitHub account (to access this material and setup gitops flow)
    - a working Kubernetes in the hands-on session (to s)
    - [multipass VM](#local-multipass-VM) (local installation, recommended)
    - [DigitalOcean VM] (remote installation)


    #### multipass VM
    ### multipass VM

    1. Install multipass on https://multipass.run
    - support Windows 10 Pro+, Mac OS X, Linux
    @@ -30,9 +27,12 @@ You need
    5. Execute `multipass shell fluxcd-workshop` to obtain shell in the VMs


    6. Execute `curl -sfL https://get.k3s.io | sh -` in the VM
    7. Depends on network condition, you need to wait for 5-10 mins.
    8. You should have your local Kubernetes cluster installed. To verify, execute `sudo kubectl get nodes`, it should give you something like
    ## Install k3s Kubernetes on your VM

    1.
    2. Execute `curl -sfL https://get.k3s.io | sh -` in the VM
    3. Depends on network condition, you need to wait for 5-10 mins.
    4. You should have your local Kubernetes cluster installed. To verify, execute `sudo kubectl get nodes`, it should give you something like
    ```
    NAME STATUS ROLES AGE VERSION
    fluxcd-workshop Ready master 5m53s v1.18.3+k3s1`
  29. dictcp revised this gist Jun 12, 2020. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -14,11 +14,11 @@ Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn
    You need
    - a GitHub account (to access this material and setup gitops flow)
    - a working Kubernetes in the hands-on session (to s)
    - [local multipass VM](#local-multipass-VM) (recommended)
    - digitalocean VM
    - [multipass VM](#local-multipass-VM) (local installation, recommended)
    - [DigitalOcean VM] (remote installation)


    ### local multipass VM
    #### multipass VM

    1. Install multipass on https://multipass.run
    - support Windows 10 Pro+, Mac OS X, Linux
    @@ -28,6 +28,8 @@ You need
    3. Execute `multipass launch -d 30G -m 2G --name fluxcd-workshop 18.04`
    4. Depends on network condition, you need to wait for 5-20 mins.
    5. Execute `multipass shell fluxcd-workshop` to obtain shell in the VMs


    6. Execute `curl -sfL https://get.k3s.io | sh -` in the VM
    7. Depends on network condition, you need to wait for 5-10 mins.
    8. You should have your local Kubernetes cluster installed. To verify, execute `sudo kubectl get nodes`, it should give you something like
  30. dictcp revised this gist Jun 12, 2020. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -12,12 +12,13 @@ Slide: https://docs.google.com/presentation/d/1rA6bhCGMydP-NOmFu7fv0zbBSzGvK9GLn
    ### Preparation

    You need
    - a working Kubernetes in the hands-on session (to s)
    - a GitHub account (to access this material and setup gitops flow)
    - a working Kubernetes in the hands-on session (to s)
    - [local multipass VM](#local-multipass-VM) (recommended)
    - digitalocean VM

    https://hkoscon.org/2020/topics/automating-kubernetes-gitops

    ### multipass VM (recommended)
    ### local multipass VM

    1. Install multipass on https://multipass.run
    - support Windows 10 Pro+, Mac OS X, Linux