apiVersion: v1
kind: Namespace
metadata:
  name: "{{ .namespace }}"
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: k3s-cluster-sa
  namespace: "{{ .namespace }}"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: k3s-cluster-admin
rules:
  - apiGroups: [""]
    resources: ["*"]
    verbs: ["*"]
  - apiGroups: ["apps"]
    resources: ["*"]
    verbs: ["*"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: k3s-cluster-admin-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: k3s-cluster-admin
subjects:
  - kind: ServiceAccount
    name: k3s-cluster-sa
    namespace: "{{ .namespace }}"
---
# This is a template for creating a k3s cluster via Crossplane
# The actual implementation would use a Crossplane provider
# to provision VMs and install k3s on them

