88 lines
2.4 KiB
Markdown
88 lines
2.4 KiB
Markdown
# Deploying Admiralty on a Open Cloud cluster
|
||
|
||
We have written two playbooks available on a private [GitHub repo](https://github.com/pi-B/ansible-oc/tree/384a5acc0713a0fa013a82f71fbe2338bf6c80c1/Admiralty)
|
||
|
||
- `deploy_admiralty.yml` installs Helm and necessary charts in order to run Admiralty on the cluster
|
||
|
||
# Ansible playbook
|
||
|
||
ansible-playbook deploy_admiralty.yml -i <REMOTE_HOST_IP>, --extra-vars "user_prompt=<YOUR_USER>" --ask-pass
|
||
|
||
```yaml
|
||
- name: Install Helm
|
||
hosts: all:!localhost
|
||
user: "{{ user_prompt }}"
|
||
become: true
|
||
# become_method: su
|
||
vars:
|
||
arch_mapping: # Map ansible architecture {{ ansible_architecture }} names to Docker's architecture names
|
||
x86_64: amd64
|
||
aarch64: arm64
|
||
|
||
|
||
tasks:
|
||
- name: Check if Helm does exist
|
||
ansible.builtin.command:
|
||
cmd: which helm
|
||
register: result_which
|
||
failed_when: result_which.rc not in [ 0, 1 ]
|
||
|
||
- name: Install helm
|
||
when: result_which.rc == 1
|
||
block:
|
||
- name: download helm from source
|
||
ansible.builtin.get_url:
|
||
url: https://get.helm.sh/helm-v3.15.0-linux-amd64.tar.gz
|
||
dest: ./
|
||
|
||
- name: unpack helm
|
||
ansible.builtin.unarchive:
|
||
remote_src: true
|
||
src: helm-v3.15.0-linux-amd64.tar.gz
|
||
dest: ./
|
||
|
||
- name: copy helm to path
|
||
ansible.builtin.command:
|
||
cmd: mv linux-amd64/helm /usr/local/bin/helm
|
||
|
||
- name: Install admiralty
|
||
hosts: all:!localhost
|
||
user: "{{ user_prompt }}"
|
||
|
||
tasks:
|
||
- name: Install required python libraries
|
||
become: true
|
||
# become_method: su
|
||
package:
|
||
name:
|
||
- python3
|
||
- python3-yaml
|
||
state: present
|
||
|
||
- name: Add jetstack repo
|
||
ansible.builtin.shell:
|
||
cmd: |
|
||
helm repo add jetstack https://charts.jetstack.io && \
|
||
helm repo update
|
||
|
||
- name: Install cert-manager
|
||
kubernetes.core.helm:
|
||
chart_ref: jetstack/cert-manager
|
||
release_name: cert-manager
|
||
context: default
|
||
namespace: cert-manager
|
||
create_namespace: true
|
||
wait: true
|
||
set_values:
|
||
- value: installCRDs=true
|
||
|
||
- name: Install admiralty
|
||
kubernetes.core.helm:
|
||
name: admiralty
|
||
chart_ref: oci://public.ecr.aws/admiralty/admiralty
|
||
namespace: admiralty
|
||
create_namespace: true
|
||
chart_version: 0.16.0
|
||
wait: true
|
||
```
|