HiveBrain v1.2.0
Get Started
← Back to all entries
debugkubernetesMinor

Terraform kubernetes_manifest: forbidden: User "system:anonymous" cannot get path "/apis"

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
cannotapispathanonymoususersystemgetkubernetes_manifestforbiddenterraform

Problem

Getting the following error with Terraform

forbidden: User "system:anonymous" cannot get path "/apis"

In context,

│ Error: Invalid configuration for API client
│ 
│   with acme.dev_env_02.kubernetes_manifest.grafana-agent,
│   on modules/acme-02/prometheus.tf line 1, in resource "kubernetes_manifest" "grafana-agent":
│    1: resource "kubernetes_manifest" "grafana-agent" {
│ 
│ forbidden: User "system:anonymous" cannot get path "/apis"


I'm also getting this error with,

resource "kubernetes_manifest" "seccomp" {

Solution

The error means that you are not authenticating to the K8s cluster for some reason.

Take a look here:

https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs#example-usage

For better troubleshooting, I recommend enabling auditing on the K8s cluster, so you can see what went wrong.

https://kubernetes.io/docs/tasks/debug/debug-cluster/audit/

Context

StackExchange DevOps Q#17636, answer score: 1

Revisions (0)

No revisions yet.