Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy_k8s_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python-version: '3.11'

- name: Setup ansible
run: pip install ansible && export PATH="$HOME/.local/bin:$PATH" && ansible-galaxy collection install cloud.terraform && ansible-galaxy collection install git+https://github.com/k3s-io/k3s-ansible.git,3e0c982a95717b76b90a405d53a68a5a6a95d316
run: pip install ansible passlib==1.7.4 && export PATH="$HOME/.local/bin:$PATH" && ansible-galaxy collection install cloud.terraform && ansible-galaxy collection install git+https://github.com/k3s-io/k3s-ansible.git,3e0c982a95717b76b90a405d53a68a5a6a95d316

- name: Setup Terraform with specified version on the runner
uses: hashicorp/setup-terraform@651471c36a6092792c552e8b1bef71e592b462d8 # @v3
Expand Down
3 changes: 3 additions & 0 deletions ansible/k8s_infra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- role: k3s.orchestration.prereq # k3s-ansible
- role: k3s.orchestration.k3s_server # k3s-ansible
- role: k8s-cluster-helm
- role: support-account
vars:
k3s_version: v1.30.2+k3s2
api_endpoint: "{{ K3S_API_ENDPOINT }}"
Expand All @@ -20,6 +21,7 @@
- role: mesh-k8s-node
- role: k3s.orchestration.prereq # k3s-ansible
- role: k3s.orchestration.k3s_agent # k3s-ansible
- role: support-account
vars:
k3s_version: v1.30.2+k3s2
api_endpoint: "{{ K3S_API_ENDPOINT }}"
Expand All @@ -31,3 +33,4 @@
become: true
roles:
- role: k8s-lb
- role: support-account
6 changes: 6 additions & 0 deletions ansible/roles/support-account/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: Add the user 'support'
ansible.builtin.user:
name: support
uid: 1001
password: "{{ LOCAL_PASSWORD | password_hash('sha512') }}"
groups: sudo
3 changes: 3 additions & 0 deletions terraform/mesh_cluster/ansible.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ resource "ansible_group" "mgrs" {
K3S_TOKEN = var.k3s_token
DATADOG_API_KEY = var.DATADOG_API_KEY
ENV_NAME = var.mesh_env_name
LOCAL_PASSWORD = var.mesh_local_password
LONGHORN_PASSPHRASE = var.longhorn_passphrase
}
}
Expand All @@ -19,6 +20,7 @@ resource "ansible_group" "workers" {
ansible_ssh_private_key_file = "../terraform/${path.module}/mesh${var.mesh_env_name}"
ansible_ssh_common_args = "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
K3S_TOKEN = var.k3s_token
LOCAL_PASSWORD = var.mesh_local_password
}
}

Expand All @@ -36,6 +38,7 @@ resource "ansible_group" "lb" {
NODE_PORT = "30303"
MESHDB_FQDN = var.meshdb_fqdn
MESH_DG = var.mesh_gateway
LOCAL_PASSWORD = var.mesh_local_password
}
}

Expand Down