GithubHelp home page GithubHelp logo

ansible-role-k3s-charts's Introduction

ansible-role-k3s-charts

This role installs lab Helm charts on K3s.

Requirements

None.

Role Variables

All default variables are set in defaults/main.yml. To change K3s manifest directory use following variable:

k3s:
  manifest_dir: /var/lib/rancher/k3s/server/manifests

To define Helm charts to be installed, add an item under charts list:

charts:
  - name: traefik
    namespace: kube-system

Most charts use ingress with TLS. Cert-manager is installed to provide valid certificates. To generate certificates, cert-manager requires dns_zone, api_token and email:

charts:
  - name: cert-manager
    namespace: cert-manager
    repo: https://charts.jetstack.io
    secret_name: cloudflare-api-token-secret
    dns_zone: "{{ dns_zone }}"
    api_token: "{{ api_token }}"
    email: "{{ email }}"
    nameserver: '1.1.1.1'

Prometheus requires list of endpoints for exporters. This can be passed by playbook (see example). Also, Grafana has default credentials defined which can be overridden with grafana_user and grafana_password:

charts:
  - name: kube-prometheus-stack
    namespace: monitoring
    repo: https://prometheus-community.github.io/helm-charts
    dns_zone: "{{ dns_zone }}"
    endpoints: "{{ endpoints }}"
    grafana:
      user: "{{ grafana_user | default('admin', true) | b64encode }}"
      password: "{{ grafana_password | default('admin@grafana', true) | b64encode }}"

Unifi chart requires list of Master node IPs passed from playbook as external_ips:

charts:
  - name: unifi
    namespace: unifi
    repo: https://raw.githubusercontent.com/frennky/lab/charts
    version: '0.3.2'
    dns_zone: "{{ dns_zone }}"
    cluster_issuer: "{{ cluster_issuer }}"
    external_ips: "{{ external_ips }}"

Dependencies

None.

Example Playbook

Here is an example playbook that includes required variables by role:

---

- name: Install Helm Charts on K3s cluster
  hosts: red
  become: true
  remote_user: pi
  vars:
    external_ips: "{{ groups['server'] | map('extract', hostvars, 'ansible_host') | list }}"
    endpoints: "{{ groups['all'] | map('extract', hostvars, 'ansible_host') | list }}"
    dns_zone: my.net
    api_token: xxxxxxxxxxxxxxxxx
    email: [email protected]
    grafana_user: admin
    grafana_password: admin@grafana
  roles:
    - role: ansible-role-k3s-charts

License

MIT

Author Information

Created by frennky.

ansible-role-k3s-charts's People

Contributors

frennky avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.