-
Notifications
You must be signed in to change notification settings - Fork 106
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
Showing
9 changed files
with
365 additions
and
28 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 |
---|---|---|
|
@@ -48,3 +48,5 @@ docs/_build | |
|
||
# development files | ||
/tmp | ||
|
||
/k3s-ansible |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
k3s-ansible/ | ||
inventory.yml |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/python3 | ||
|
||
# This python script is to fix ansible error in CI test. It's not a bug of ansible, but a side-effect of a different change | ||
# Will remove it later if we do not see ansible error in CI | ||
|
||
import os | ||
import sys | ||
|
||
for handle in (sys.stdin, sys.stdout, sys.stderr): | ||
try: | ||
fd = handle.fileno() | ||
except Exception as e: | ||
print(f"Error: {e}") | ||
continue | ||
|
||
os.set_blocking(fd, True) | ||
|
||
print("Blocking I/O is set for all file descriptors") |
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
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
k3s_cluster: | ||
children: | ||
server: | ||
hosts: | ||
${CONTROL_PLANE_IP}: | ||
agent: | ||
hosts: | ||
${WORKER_1_IP}: | ||
${WORKER_2_IP}: | ||
|
||
# Required Vars | ||
vars: | ||
ansible_port: 22 | ||
ansible_user: ubuntu | ||
k3s_version: ${K8S_VERSION}+k3s1 | ||
# The token should be a random string of reasonable length. You can generate | ||
# one with the following commands: | ||
# - openssl rand -base64 64 | ||
# - pwgen -s 64 1 | ||
# You can use ansible-vault to encrypt this value / keep it secret. | ||
token: "changeme!" | ||
api_endpoint: "{{ hostvars[groups['server'][0]]['ansible_host'] | default(groups['server'][0]) }}" | ||
extra_server_args: "--cluster-cidr=${POD_CIDR} --service-cidr=${SERVICE_CIDR}" | ||
extra_agent_args: "" | ||
|
||
# Optional vars | ||
|
||
# cluster_context: k3s-ansible | ||
# api_port: 6443 | ||
# k3s_server_location: /var/lib/rancher/k3s | ||
# systemd_dir: /etc/systemd/system | ||
# extra_service_envs: [ 'ENV_VAR1=VALUE1', 'ENV_VAR2=VALUE2' ] | ||
# user_kubectl: true, by default kubectl is symlinked and configured for use by ansible_user. Set to false to only kubectl via root user. | ||
|
||
# Manifests or Airgap should be either full paths or relative to the playbook directory. | ||
# List of locally available manifests to apply to the cluster, useful for PVCs or Traefik modifications. | ||
# extra_manifests: [ '/path/to/manifest1.yaml', '/path/to/manifest2.yaml' ] | ||
# airgap_dir: /tmp/k3s-airgap-images | ||
|
||
# server_config_yaml: | | ||
# This is now an inner yaml file. Maintain the indentation. | ||
# YAML here will be placed as the content of /etc/rancher/k3s/config.yaml | ||
# See https://docs.k3s.io/installation/configuration#configuration-file | ||
# registries_config_yaml: | | ||
# Containerd can be configured to connect to private registries and use them to pull images as needed by the kubelet. | ||
# YAML here will be placed as the content of /etc/rancher/k3s/registries.yaml | ||
# See https://docs.k3s.io/installation/private-registry |
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
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
Oops, something went wrong.