These are steps as shown in my Kubernetes demo. Clone this repo and use it for your own testing.
These steps assume you have a Route 53 domain and hosted zone already. If not, see the AWS Documentation here
This also assumes you have a public SSL certificate in ACM that covers your domain name and wildcard domain name (such as example.com and *.example.com). These steps are documented here. Note the certificate must be in the same region as your planned EKS cluster deployment. Make note of the ARN for your certificate as it is needed later.
This is covered in AWS documentation here.
- On Linux
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
eksctl version
- On Mac
brew tap weaveworks/tap
brew install weaveworks/tap/eksctl
eksctl version
brew upgrade eksctl && brew link --overwrite eksctl
vi manifests/kube-system/external-dns.yaml
--domain-filter=Your-Domain.com
There is already a cluster.yaml template in this directory you can use.
eksctl create cluster -f cluster.yaml
kubectl get nodes
Weave Flux runs in a Kubernetes cluster and monitors your git repos for changes. It will apply manifests as they change. It can also monitor your Docker registry and deploy any image changes.
Update te git-url and git-email below to reflect your environment before running.
# Create a deploy key (used by Flux) and upload to your cluster
ssh-keygen -q -N "" -f weave-flux-deploy-key
kubectl create ns flux
kubectl create secret generic flux-git-deploy --from-file=identity=weave-flux-deploy-key -n flux
# Install Flux (from eksctl)
EKSCTL_EXPERIMENTAL=true \
eksctl enable repo \
--git-url [email protected]:jonjozwiak/k8s-demo \
--git-email [email protected] \
--git-paths=manifests \
--cluster eks1 \
--region us-west-2
In GitHub, go to your repo and add a deploy key as follows:
- In GitHub go to 'Settings' for the repo (NOT YOUR OVERALL PROFILE)
- Click 'Deploy Keys' and 'Add deploy key'
- Title: Weave Flux Deploy Key
- Key: Paste your weave-flux-deploy-key.pub
- Click the 'Allow Write Access' and click 'Add Key'
Within 5 minutes this will deploy your base manifests.
See the steps in my hello-python repo
My web server is already deployed as it is defined in the manifests here. Update the source code at hello-nginx repo and you will see the new version deployed within 5 minutes.
Monitor by looking at the following:
kubectl get pods # Look for new deployment time in seconds
kubectl get pods -n flux
kubectl logs flux-######-##### -n flux
1568 kubectl get pods
1569 git pull
1570 git log --oneline
1571 git revert HEAD
1572 git log --oneline
1573 git push
Roll back to the previous version using Git in your hello-nginx repo
# In your hello-nginx directory
kubectl get pods
git pull
git log --oneline
git revert HEAD
git log --oneline
git push
# Wait up to 5 minutes
kubectl get pods
# Connect in https://nginx.redhatapps.com
eksctl delete cluster -f cluster.yaml