k8s-resources

by rlex

Helm chartv0.1.0

Helm chart to create any type of k8s resource

About this chart

k8s-resources

Helm chart to create any type of k8s resource

This is a very simple chart to create any type of kubernetes resources with helm. Since not every chart offers something like extraResources parameter, i use this chart to deploy some stuff along with application - for example, VerticalPodAutoscaler CRs. Example usage with all supported parameters:

resources:
  - name: vpa-loki-ingester
    # override generated resource name
    fullnameOverride: "vpa-loki-ingester"
    # add annotations
    annotations:
      annotation: value
    # add annotations
    labels:
      some-label: value
    # apiVersion of resource
    apiVersion: autoscaling.k8s.io/v1
    # kind of resource
    kind: VerticalPodAutoscaler
    # resource spec
    spec:
      targetRef:
        apiVersion: "apps/v1"
        kind: Deployment
        name: loki-ingester
      updatePolicy:
        updateMode: "Off"

Values

KeyTypeDefaultDescription
fullnameOverridestring""Overrides helm-generated chart fullname
nameOverridestring""overrides chart name
resourcesobject{}dict with user-provided resources

Upgrading

A major chart version change indicates that there is an incompatible breaking change needing manual actions.

Deploy k8s-resources with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has k8s-resources 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartk8s-resources is pinned at v0.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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