Okey some insight:
You should do this, before installing k8s:
Code:
alias kubectl="k3s kubectl"
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
Setuping up k8s on a certain pool is super simple (tm):
Code:
midclt call -job kubernetes.update '{"pool": "pool_name_here"}'
Removing it again, is NOT as simple and just shouldn't be done generally speaking.
- It's advicable to move the TrueNAS SCALE gui to a different port. Because some helm charts expect to be able to use the host port 80 or 443.
- Helm charts also almost ALWAYS need you to download values.yaml and add your own config, it's not just adding a link and go (that might work, but often doesn't)
Installing a helm chart, using a custom values.yaml file goes as follows: (unifi controller as an example)
Code:
helm upgrade --install --values unifi/values.yaml unifi ./unifi/chart/
- Some helm charts needs you to add secrets, you can create a secrets.yaml file with secrets like this:
Code:
apiVersion: v1
kind: Secret
metadata:
name: mariadbsecret
type: Opaque
stringData:
rootUser.password: MariaDBTest
galera.mariabackup.password: BackupTest
---
apiVersion: v1
kind: Secret
metadata:
name: nextcloud-db-pass
type: Opaque
stringData:
username: nextcloud
password: NextcloudTest
Installing such a secret.yaml is rather easy:
Code:
kubectl apply -f tautulli/ingress.yaml
If you want to add the stock k8s dashboard for testing purposes:
Code:
kubectl apply -f https://vividcode.io/content/insecure-kubernetes-dashboard.yml
cat <<EOF | kubectl create -f -
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kubernetes-dashboard2
labels:
k8s-app: kubernetes-dashboard
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kubernetes-dashboard
EOF
Keep in mind you still need to add ingress or proxy to above little script
TLDR:
Helm and k8s is not "super easy" and if you have not spend some time exploring k8s outside of SCALE, it might be wise to await the GUI.