Skip to content

milton-ballon-incontact/kubernetes-workshop-flux

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-workshop-flux

This repo contains a basic example of how flux can be used to deploy kubernetes workloads.

Setup your minikube instance with flux

  1. Fork this repo into your own github (click the fork button at the top right of this page)
  2. Clone this repo on to your workstation (replace jwenz723 with your username): git clone https://github.com/jwenz723/kubernetes-workshop-flux.git
  3. cd into scripts
  4. Install tiller into your cluster by running helm init --wait. Tiller is the server-side component that helm interacts with.
  5. execute the script for your OS
  6. Copy the ssh public key that is printed when the script finishes (should start with ssh-rsa)
  7. Browse to (replace jwenz723 with your username) https://github.com/jwenz723/kubernetes-workshop-flux/settings/keys/new to create a new deploy key
  8. Set the title to 'kubernetes-workshop'
  9. Set the key value to the ssh key you copied earlier
  10. Check the box 'Allow write access' to allow flux to commit back to the repo
  11. Click Add Key
  12. Watch the flux logs to see if it is working using the command: kubectl logs -n flux -l app=flux -f

Modify the deployment

Assuming that you made some changes to the apps, you should make changes in this repo to make use of your newly created docker images.

  1. Modify backend-dep.yaml to point at your docker image (change this line: image: jwenz723/demohttp-backend:flux-sync-3-gd84c559-dirty)

  2. Modify frontend-dep.yaml to point at your docker image (change this line: image: jwenz723/demohttp-frontend:flux-sync-3-gd84c559-dirty)

  3. Make a new git commit and push your changes up to github:

    git add .
    git commit -m "updated docker image path"
    git push origin master 
  4. Now watch your minikube cluster to see your new image deployed: kubectl get pods -w (you should see the AGE value in the right column drop to a value less than 10s when your new pod is created)

Feeling adventurous?

Try adding a deployment of your application of choice into the repo and have it deployed through flux. You can define yaml files for your deployment within the k8s directory following the pattern of what is already defined there.

About

A flux config repo used in a kubernetes workshop

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 66.4%
  • Batchfile 33.6%