botWebWars/helm-chart/INSTALL.md

4.5 KiB

botWebWars Helm Chart

This Helm chart provides a Kubernetes deployment for botWebWars, an autonomous tactical bot arena.

Prerequisites

  • A running Kubernetes cluster (v1.19+ recommended).
  • Helm v3+ installed.
  • (Optional) Metrics Server installed in your cluster for detailed container CPU & memory usage.

Optional Kubeconfig & Secret Setup

The application does not require Kubernetes API access by default. Leave kubeconfig.enabled and rbac.create disabled unless you have added a feature that needs cluster access.

You can configure and set up the kubeconfig secret using one of the following methods:

  1. Create a secret containing your .kube/config file:

    kubectl create secret generic botWebWars-kubeconfig --from-file=config=$HOME/.kube/config
    
  2. Install or upgrade the Helm chart specifying the existing secret:

    helm install botWebWars ./helm-chart \
      --set kubeconfig.enabled=true \
      --set kubeconfig.secretName=botWebWars-kubeconfig
    

Method 2: Create the Secret via Helm using --set-file

You can have Helm create the Secret resource directly from your local kubeconfig file during installation:

helm install botWebWars ./helm-chart \
  --set kubeconfig.enabled=true \
  --set kubeconfig.createSecret=true \
  --set-file kubeconfig.content=$HOME/.kube/config

Method 3: Use a custom values.yaml file

Create a custom values file (e.g. my-values.yaml):

kubeconfig:
  enabled: true
  createSecret: true
  secretName: "botWebWars-kubeconfig"
  secretKey: "config"
  mountPath: "/root/.kube/config"
  content: |
    apiVersion: v1
    clusters:
    - cluster:
        server: https://127.0.0.1:6443
      name: my-cluster
    ...    

Then install the chart using:

helm install botWebWars ./helm-chart -f my-values.yaml

Quick Start

1. Install the Chart

Default installation:

helm install botwebwars ./helm-chart

2. Custom Configuration

You can override default settings by passing a custom values.yaml file or using --set:

helm install botWebWars ./helm-chart -f custom-values.yaml

Example: Enable Ingress and change image tag:

helm install botWebWars ./helm-chart \
  --set image.tag="1.0.0" \
  --set ingress.enabled=true \
  --set ingress.hosts[0].host="botWebWars.example.com"

3. Upgrade the Release

helm upgrade botwebwars ./helm-chart

4. Uninstall

helm uninstall botwebwars

Configuration Parameters

Parameter Description Default
replicaCount Number of application replicas 1
image.repository Docker image repository botWebWars
image.tag Docker image tag latest
image.pullPolicy Image pull policy IfNotPresent
kubeconfig.enabled Enable mounting kubeconfig Secret and KUBECONFIG env var true
kubeconfig.secretName Name of existing Secret containing kubeconfig file "" (defaults to <release-fullname>-kubeconfig)
kubeconfig.createSecret Create Secret resource via Helm from kubeconfig.content false
kubeconfig.content Raw kubeconfig content when createSecret is true ""
kubeconfig.secretKey Secret data key containing kubeconfig file content "config"
kubeconfig.mountPath Container path to mount kubeconfig file and set KUBECONFIG env "/root/.kube/config"
service.type Kubernetes service type ClusterIP
service.port Service port exposed 80
service.targetPort Container application port 8000
rbac.create Create ClusterRole & ClusterRoleBinding for K8s API access false
serviceAccount.create Create ServiceAccount for the deployment true
serviceAccount.name Explicit ServiceAccount name ""
ingress.enabled Enable Ingress resource false
resources Pod CPU/Memory resource limits & requests { limits: { cpu: 200m, memory: 256Mi }, requests: { cpu: 100m, memory: 128Mi } }
persistence.enabled Enable optional PersistentVolumeClaim false

Optional RBAC

If cluster access is later required, set rbac.create: true and configure the optional kubeconfig Secret. The default game server does not require either.

Verification

Check the deployment status:

kubectl get pods -l app.kubernetes.io/name=botWebWars
kubectl get svc -l app.kubernetes.io/name=botWebWars