New way provision of provision has been introduced. #32
New way provision of provision has been introduced. #32adskyiproger merged 4 commits intodevelopfrom
Conversation
infrastructure/server-setup/k8s.yml
Outdated
| - name: Setup Kubernetes Cluster | ||
| hosts: all | ||
| gather_facts: yes | ||
| vars: |
There was a problem hiding this comment.
Lets store variables to group_vars
infrastructure/server-setup/k8s.yml
Outdated
|
|
||
| - name: Initialize Kubernetes Master | ||
| hosts: master | ||
| vars: |
| shell: sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg /tmp/kubernetes.key | ||
|
|
||
| - name: Add Kubernetes APT repository | ||
| shell: echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/{{ kubernetes_version }}/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list |
There was a problem hiding this comment.
What if /etc/apt/sources.list.d/kubernetes.list exists?
| @@ -0,0 +1,76 @@ | |||
| --- | |||
| - name: Install Tigera Operator | |||
| shell: kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/{{ calico_version }}/manifests/tigera-operator.yaml | |||
| KUBECONFIG: /home/provision/.kube/config | ||
| register: calico_result | ||
| failed_when: calico_result.rc != 0 and "already exists" not in calico_result.stderr | ||
|
|
There was a problem hiding this comment.
Optional: Add metrics server: https://github.com/kubernetes-sigs/metrics-server
3241eeb to
fee3a8b
Compare
euanmillar
left a comment
There was a problem hiding this comment.
@adskyiproger @rikukissa if I am understanding this correctly, then the previous provision and deploy process is entirely replaced by Kubernetes in this repo. I thought that the strategy for this repo would be to maintain existing Docker Swarm deployment and provisioning whilst providing Kubernetes in parallel. We would maintian both until such time as we were confident that one could be replaced. Therefore I thought that there would be some sub folders and duplication e.g. workflows/k8s_provision.yml infrastructure/swarm, infrastructure/k8s
|
@euanmillar That was the original idea, but we quickly realised templating Docker Swarm isn’t worth it. It’s much less work to keep the current infrastructure setup in the country config and continue developing it there, while developing the Kubernetes setup here and making it configurable from the start. |
|
@euanmillar , Initial goal was to keep both solutions in the same repository. One repository to maintain will also work and there is an example in e2e repository. We have 2 deployment scripts coexisting (swarm, k8s). Countryconfig template has few pitfalls that make moving infrastructure for docker swarm very tricky:
Since we need to refactor all logic for kubernetes, it would be easier to maintain and keep code clean in separate repository. |
Addressed issues:
Implementation checklist:
test-e2essh-keyTest results:
Test on clean environment:
Final notes: