Install and use rancher helm-controller
K3S comes with a Helm operator called Helm Controller. Helm Controller defines a new HelmChart custom resource definition, or CRD, for managing Helm charts.
Parts of the K3S series
- Part1a: Install K3S with k3sup and kube-vip
- Part1b: Install K3S with CRI-O
- Part1c: Install K3S on Fedora CoreOS
- Part2b: Install K3S with k3sup and Calico
- Part2c: Install K3S with k3sup and Cilium
- Part3: K3S helm CR
- Part5: Secure k3s with gVisor
- Part6: Kubernetes Certificate Rotation
Install helm-controller K8S
Thanks to Francisco Bobadilla who created RBAC for Rancher’s helm-controller we can deploy this solution to a stander K8S cluster.
kubectl apply -f https://raw.githubusercontent.com/iotops/helm-controller/master/manifests/deploy-namespaced.yaml
kubectl api-resources --api-group=helm.cattle.io
NAME SHORTNAMES APIGROUP NAMESPACED KIND
helmcharts helm.cattle.io true HelmChart
Deploy Nginx ingress Controller
nano ginx-ingress.yaml
---
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: nginx-ingress
namespace: helm-controller
spec:
chart: stable/nginx-ingress
targetNamespace: nginx-ingress
valuesContent: |-
rbac:
create: "true"
controller:
kind: DaemonSet
hostNetwork: "true"
daemonset:
useHostPort: "true"
service:
type: "NodePort"
On a K3S cluster the namespace:
must be kube-system
because k3S deploys the helm-controller to that namespace.
Auto-Deploying Manifests
Any file found in /var/lib/rancher/k3s/server/manifests
will automatically be deployed to Kubernetes in a manner similar to kubectl apply
.
cp nginx-ingress.yaml /var/lib/rancher/k3s/server/manifests/