forked from marcel-dempers/docker-development-youtube-series
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97535fc
commit 91ea892
Showing
1 changed file
with
23 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,75 +2,50 @@ | |
|
||
# 1 - Kubernetes | ||
|
||
For this tutorial, I use Kuberentes 1.17 | ||
To get 1.17 for Linux\Windows, just use `kind` | ||
Get a Kubernetes Cluster. In this video, I use Docker for Windows. | ||
If you are new to Kubernetes, checkout my videos [here](https://marceldempers.dev/videos/guides/kubernetes-getting-started) | ||
|
||
``` | ||
#Windows | ||
kind create cluster --name flux --image kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62 | ||
#Linux | ||
kind create cluster --name flux --kubeconfig ~/.kube/kind-flux --image kindest/node:v1.17.0@sha256:9512edae126da271b66b990b6fff768fbb7cd786c7d39e86bdf55906352fdf62 | ||
``` | ||
|
||
You can use Kubernetes from Docker for Windows\Mac too! :) | ||
|
||
# 2 - Flux CLI Container | ||
# 2 - Flux CTL | ||
|
||
Let's run a docker container that can access our Kind cluster and run all the dependencies | ||
for Flux. | ||
If you installed Flux CTL & KubeCTL on your machine, go to Part 4 | ||
I used Flux 1.18 which I got from the GitHub [Release Page](https://github.com/fluxcd/flux/releases/tag/1.18.0) | ||
Rename it to `fluxctl.exe` & place it in a folder that is on your `$env:Path` environment variable. | ||
Open a new terminal and try | ||
``` | ||
# Note: make sure we mount the correct network, check the network used (should be bridge) | ||
#grab the ip address | ||
docker inspect flux-control-plane | ||
docker run -it --rm --net bridge -v ${home}/.kube/:/root/.kube/ ubuntu:19.10 bash | ||
apt-get update && apt-get install -y nano curl | ||
# edit kubeconfig, set api address so we can access it from our container | ||
nano ~/.kube/config | ||
# set it to https://flux-control-plane:6443 | ||
fluxctl | ||
``` | ||
|
||
# 3 - Get kubectl and Flux CTL | ||
# 4 - Installing Flux | ||
|
||
Make sure you are pointing to the kubernetes cluster you want to use | ||
``` | ||
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl | ||
chmod +x ./kubectl | ||
mv ./kubectl /usr/local/bin/kubectl | ||
# confirm we can access kind cluster: | ||
kubectl config current-context | ||
kubectl get nodes | ||
curl -o fluxctl -L https://github.com/fluxcd/flux/releases/download/1.19.0/fluxctl_linux_amd64 | ||
chmod +x ./fluxctl | ||
mv ./fluxctl /usr/local/bin/fluxctl | ||
``` | ||
|
||
# 4 - Installing Flux | ||
|
||
``` | ||
kubectl create ns flux | ||
export GHUSER="marcel-dempers" | ||
fluxctl install \ | ||
--git-user=${GHUSER} \ | ||
--git-email=${GHUSER}@users.noreply.github.com \ | ||
[email protected]:${GHUSER}/docker-development-youtube-series \ | ||
--git-path=kubernetes/configmaps,kubernetes/secrets,kubernetes/deployments \ | ||
$GHUSER = "marcel-dempers" | ||
fluxctl install ` | ||
--git-user=${GHUSER} ` | ||
--git-email=${GHUSER}@users.noreply.github.com ` | ||
[email protected]:${GHUSER}/docker-development-youtube-series ` | ||
--git-path=kubernetes/configmaps,kubernetes/secrets,kubernetes/deployments ` | ||
--git-branch=flux-test ` | ||
--namespace=flux | kubectl apply -f - | ||
kubectl -n flux rollout status deployment/flux | ||
export FLUX_FORWARD_NAMESPACE=flux | ||
$env:FLUX_FORWARD_NAMESPACE = "flux" | ||
fluxctl list-workloads | ||
fluxctl identity | ||
https://github.com/marcel-dempers/docker-development-youtube-series/settings/keys/new | ||
fluxctl sync | ||
fluxcd.io/tag.example-app: semver:~1.0 | ||
fluxcd.io/automated: 'true' | ||
fluxctl policy -w default:deployment/example-deploy --tag "example-app=1.0.*" | ||
``` |