Asking for help? Comment out what you need so we can get more information to help you!
Cluster information:
Kubernetes version:
k3s raspberry pi cluster
kubectl get nodes
NAME STATUS ROLES AGE VERSION
xxxx-n1 Ready 4d21h v1.27.6+k3s1
xxxx-n3 Ready 4d20h v1.27.6+k3s1
xxxx-n2 Ready 4d20h v1.27.6+k3s1
xxxx-ctlr Ready control-plane,master 5d21h v1.27.6+k3s1
Cloud being used: (put bare-metal if not on a public cloud)
NA
Installation method:
K3S install
Host OS:
Ubuntu 22.04
CNI and version:
???
CRI and version:
???
You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.
description
I’m able to get it installed using the kubectl manifest
https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml
with additional service user manifests
I’m trying to get the same deployment working with terraform/helm
terraform apply runs succesfully
getting the following error trying to access it via kubectl proxy
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "no endpoints available for service \"https:kubernetes-dashboard:\"",
"reason": "ServiceUnavailable",
"code": 503
}
i have the following main.tf
provider "kubernetes" {
config_path = "~/.kube/config"
}
provider "helm" {
kubernetes {
config_path = "~/.kube/config"
}
}
resource "kubernetes_namespace" "kubernetes_dashboard" {
metadata {
name = "kubernetes-dashboard"
labels = {
name = "kubernetes-dashboard"
}
}
}
resource "helm_release" "kubernetes_dashboard" {
name = "kubernetes-dashboard"
repository = "https://kubernetes.github.io/dashboard/"
chart = "kubernetes-dashboard"
create_namespace = true
namespace = "kubernetes-dashboard"
depends_on = [kubernetes_namespace.kubernetes_dashboard]
}
resource "kubernetes_service_account" "admin_user" {
metadata {
name = "admin-user"
namespace = "kubernetes-dashboard"
}
depends_on = [helm_release.kubernetes_dashboard]
}
resource "kubernetes_cluster_role_binding" "admin_user_binding" {
metadata {
name = "admin_user_binding"
}
subject {
kind = "ServiceAccount"
name = "admin-user"
namespace = "kubernetes-dashboard"
}
role_ref {
api_group = "rbac.authorization.k8s.io"
kind = "ClusterRole"
name = "cluster-admin"
}
depends_on = [kubernetes_service_account.admin_user]
}
resource "kubernetes_secret" "admin-user-token" {
metadata {
name = "admin-user-token"
namespace = "kubernetes-dashboard"
annotations = {
"kubernetes.io/service-account.name" = "admin-user"
}
}
type = "kubernetes.io/service-account-token"
depends_on = [kubernetes_service_account.admin_user]
}