common
by homelab-ci
Function library for homelab-ci charts
About this chart
common
Function library for homelab-ci charts
Since a lot of the homelab-ci charts follow a similar pattern, this library was built to reduce maintenance cost between the charts that use it and try achieve a goal of being DRY.
Requirements
Kubernetes: >=1.16.0-0
Dependencies
| Repository | Name | Version |
|---|
Installing the Chart
This is a Helm Library Chart.
WARNING: THIS CHART IS NOT MEANT TO BE INSTALLED DIRECTLY
Using this library
Include this chart as a dependency in your Chart.yaml e.g.
# Chart.yaml
dependencies:
- name: common
version: 4.5.1
repository: https://github.com/homelab-ci/ezUxewsl/
For more information, take a look at the Docs.
Configuration
Read through the values.yaml file. It has several commented out suggested values.
Custom configuration
N/A
Values
Important: When deploying an application Helm chart you can add more values from our common library chart here
| Key | Type | Default | Description |
|---|---|---|---|
| additionalContainers | object | {} | Specify any additional containers here as dictionary items. Each additional container should have its own key. Helm templates can be used. |
| addons | object | See below | The common chart supports several add-ons. These can be configured under this key. |
| addons.codeserver | object | See values.yaml | The common library supports adding a code-server add-on to access files. It can be configured under this key. For more info, check out our docs |
| addons.codeserver.args | list | ["--auth","none"] | Set codeserver command line arguments. Consider setting --user-data-dir to a persistent location to preserve code-server setting changes |
| addons.codeserver.enabled | bool | false | Enable running a code-server container in the pod |
| addons.codeserver.env | object | {} | Set any environment variables for code-server here |
| addons.codeserver.git | object | See below | Optionally allow access a Git repository by passing in a private SSH key |
| addons.codeserver.git.deployKey | string | "" | Raw SSH private key |
| addons.codeserver.git.deployKeyBase64 | string | "" | Base64-encoded SSH private key. When both variables are set, the raw SSH key takes precedence. |
| addons.codeserver.git.deployKeySecret | string | "" | Existing secret containing SSH private key The chart expects it to be present under the id_rsa key. |
| addons.codeserver.image.pullPolicy | string | "IfNotPresent" | Specify the code-server image pull policy |
| addons.codeserver.image.repository | string | "ghcr.io/coder/code-server" | Specify the code-server image |
| addons.codeserver.image.tag | string | "4.5.1" | Specify the code-server image tag |
| addons.codeserver.ingress.enabled | bool | false | Enable an ingress for the code-server add-on. |
| addons.codeserver.ingress.ingressClassName | string | nil | Set the ingressClass that is used for this ingress. Requires Kubernetes >=1.19 |
| addons.codeserver.service.enabled | bool | true | Enable a service for the code-server add-on. |
| addons.codeserver.volumeMounts | list | [] | Specify a list of volumes that get mounted in the code-server container. At least 1 volumeMount is required! |
| addons.codeserver.workingDir | string | "" | Specify the working dir that will be opened when code-server starts If not given, the app will default to the mountpah of the first specified volumeMount |
| addons.netshoot | object | See values.yaml | The common library supports adding a netshoot add-on to troubleshoot network issues within a Pod. It can be configured under this key. |
| addons.netshoot.enabled | bool | false | Enable running a netshoot container in the pod |
| addons.netshoot.env | object | {} | Set any environment variables for netshoot here |
| addons.netshoot.image.pullPolicy | string | "IfNotPresent" | Specify the netshoot image pull policy |
| addons.netshoot.image.repository | string | "ghcr.io/nicolaka/netshoot" | Specify the netshoot image |
| addons.netshoot.image.tag | string | "v0.7" | Specify the netshoot image tag |
| addons.promtail | object | See values.yaml | The common library supports adding a promtail add-on to to access logs and ship them to loki. It can be configured under this key. |
| addons.promtail.args | list | [] | Set promtail command line arguments |
| addons.promtail.enabled | bool | false | Enable running a promtail container in the pod |
| addons.promtail.env | object | {} | Set any environment variables for promtail here |
| addons.promtail.image.pullPolicy | string | "IfNotPresent" | Specify the promtail image pull policy |
| addons.promtail.image.repository | string | "docker.io/grafana/promtail" | Specify the promtail image |
| addons.promtail.image.tag | string | "2.6.1" | Specify the promtail image tag |
| addons.promtail.logs | list | [] | The paths to logs on the volume |
| addons.promtail.loki | string | "" | The URL to Loki |
| addons.promtail.volumeMounts | list | [] | Specify a list of volumes that get mounted in the promtail container. At least 1 volumeMount is required! |
| addons.vpn | object | See values.yaml | The common chart supports adding a VPN add-on. It can be configured under this key. For more info, check out our docs |
| addons.vpn.args | list | [] | Override the args for the vpn sidecar container |
| addons.vpn.configFile | string | nil | Provide a customized vpn configuration file to be used by the VPN. |
| addons.vpn.configFileSecret | string | nil | Reference an existing secret that contains the VPN configuration file The chart expects it to be present under the vpnConfigfile key. |
| addons.vpn.enabled | bool | false | Enable running a VPN in the pod to route traffic through a VPN |
| addons.vpn.env | object | {} | All variables specified here will be added to the vpn sidecar container See the documentation of the VPN image for all config values |
| addons.vpn.gluetun | object | See below | Gluetun specific configuration -- Make sure to read the documentation to see how to configure this addon! |
| addons.vpn.gluetun.image.pullPolicy | string | "IfNotPresent" | Specify the Gluetun image pull policy |
| addons.vpn.gluetun.image.repository | string | "docker.io/qmcgaw/gluetun" | Specify the Gluetun image |
| addons.vpn.gluetun.image.tag | string | "v3.30.0" | Specify the Gluetun image tag |
| addons.vpn.livenessProbe | object | {} | Optionally specify a livenessProbe, e.g. to check if the connection is still being protected by the VPN |
| addons.vpn.networkPolicy.annotations | object | {} | Provide additional annotations which may be required. |
| addons.vpn.networkPolicy.egress | string | nil | The egress configuration for your network policy, All outbound traffic from the pod will be blocked unless specified here. [ref] [recipes] |
| addons.vpn.networkPolicy.enabled | bool | false | If set to true, will deploy a network policy that blocks all outbound traffic except traffic specified as allowed |
| addons.vpn.networkPolicy.labels | object | {} | Provide additional labels which may be required. |
| addons.vpn.networkPolicy.podSelectorLabels | object | {} | Provide additional podSelector labels which may be required. |
| addons.vpn.openvpn | object | See below | OpenVPN specific configuration |
| addons.vpn.openvpn.auth | string | nil | Credentials to connect to the VPN Service (used with -a) |
| addons.vpn.openvpn.authSecret | string | nil | Optionally specify an existing secret that contains the credentials. Credentials should be stored under the VPN_AUTH key |
| addons.vpn.openvpn.image.pullPolicy | string | "IfNotPresent" | Specify the openvpn client image pull policy |
| addons.vpn.openvpn.image.repository | string | "dperson/openvpn-client" | Specify the openvpn client image |
| addons.vpn.openvpn.image.tag | string | "latest" | Specify the openvpn client image tag |
| addons.vpn.scripts | object | See values.yaml | Provide custom up/down scripts that can be used by the vpn configuration. |
| addons.vpn.securityContext | object | See values.yaml | Set the VPN container securityContext |
| addons.vpn.type | string | "openvpn" | Specify the VPN type. Valid options are openvpn, wireguard and gluetun. |
| addons.vpn.wireguard | object | See below | WireGuard specific configuration |
| addons.vpn.wireguard.image.pullPolicy | string | "IfNotPresent" | Specify the WireGuard image pull policy |
| addons.vpn.wireguard.image.repository | string | "ghcr.io/homelab-ci/wireguard" | Specify the WireGuard image |
| addons.vpn.wireguard.image.tag | string | "v1.0.20210914" | Specify the WireGuard image tag |
| affinity | object | {} | Defines affinity constraint rules. [ref] |
| args | list | [] | Override the args for the default container |
| automountServiceAccountToken | bool | true | Specifies whether a service account token should be automatically mounted. |
| autoscaling | object | Add a Horizontal Pod Autoscaler | |
| command | list | [] | Override the command(s) for the default container |
| configmap | object | See below | Configure configMaps for the chart here. Additional configMaps can be added by adding a dictionary key similar to the 'config' object. |
| configmap.config.annotations | object | {} | Annotations to add to the configMap |
| configmap.config.data | object | {} | configMap data content. Helm template enabled. |
| configmap.config.enabled | bool | false | Enables or disables the configMap |
| configmap.config.labels | object | {} | Labels to add to the configMap |
| controller.annotations | object | {} | Set annotations on the deployment/statefulset/daemonset |
| controller.enabled | bool | true | enable the controller. |
| controller.labels | object | {} | Set labels on the deployment/statefulset/daemonset |
| controller.podManagementPolicy | string | nil | Set statefulset podManagementPolicy, valid values are Parallel and OrderedReady (default). |
| controller.replicas | int | 1 | Number of desired pods |
| controller.revisionHistoryLimit | int | 3 | ReplicaSet revision history limit |
| controller.rollingUpdate.partition | string | nil | Set statefulset RollingUpdate partition |
| controller.rollingUpdate.surge | string | nil | Set deployment RollingUpdate max surge |
| controller.rollingUpdate.unavailable | string | nil | Set deployment RollingUpdate max unavailable |
| controller.strategy | string | nil | Set the controller upgrade strategy For Deployments, valid values are Recreate (default) and RollingUpdate. For StatefulSets, valid values are OnDelete and RollingUpdate (default). DaemonSets ignore this. |
| controller.type | string | "deployment" | Set the controller type. Valid options are deployment, daemonset or statefulset |
| dnsConfig | object | {} | Optional DNS settings, configuring the ndots option may resolve nslookup issues on some Kubernetes setups. |
| dnsPolicy | string | nil | Defaults to "ClusterFirst" if hostNetwork is false and "ClusterFirstWithHostNet" if hostNetwork is true. |
| enableServiceLinks | bool | true | Enable/disable the generation of environment variables for services. [ref] |
| env | string | nil | Main environment variables. Template enabled. Syntax options: A) TZ: UTC B) PASSWD: '{{ .Release.Name }}' C) PASSWD: configMapKeyRef: name: config-map-name key: key-name D) PASSWD: valueFrom: secretKeyRef: name: secret-name key: key-name ... E) - name: TZ value: UTC F) - name: TZ value: '{{ .Release.Name }}' |
| envFrom | list | [] | Secrets and/or ConfigMaps that will be loaded as environment variables. [ref] |
| global.annotations | object | {} | Set additional global annotations. Helm templates can be used. |
| global.fullnameOverride | string | nil | Set the entire name definition |
| global.labels | object | {} | Set additional global labels. Helm templates can be used. |
| global.nameOverride | string | nil | Set an override for the prefix of the fullname |
| hostAliases | list | [] | Use hostAliases to add custom entries to /etc/hosts - mapping IP addresses to hostnames. [ref] |
| hostNetwork | bool | false | When using hostNetwork make sure you set dnsPolicy to ClusterFirstWithHostNet |
| hostname | string | nil | Allows specifying explicit hostname setting |
| image.pullPolicy | string | nil | image pull policy |
| image.repository | string | nil | image repository |
| image.tag | string | nil | image tag |
| imagePullSecrets | list | [] | Set image pull secrets |
| ingress | object | See below | Configure the ingresses for the chart here. Additional ingre |
Deploy common with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has common on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcommon is pinned at v4.5.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply