But I have an Auth error when I run my lifecycle cron job (qoveryrd/create-sa:1.0) and I don’t know where I’m doing wrong:
-> Ensuring required environment variables are present
-> Downloading kubectl version 1.26.0
-> Generated service account:
apiVersion: v1
kind: ServiceAccount
metadata:
name: Qovery-User-Role
namespace: xxxxxxxxx-kubernetes-metrics
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::xxxxxxxxxxxx:role/Qovery-User-Role
-> Getting kubeconfig
Added new context arn:aws:eks:eu-west-1:xxxxxxxxxxxx:cluster/qovery-xxxxxxxxx to /root/.kube/config
-> Deploying service account
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "/v1, Resource=serviceaccounts", GroupVersionKind: "/v1, Kind=ServiceAccount"
Name: "Qovery-User-Role", Namespace: "xxxxxxxxx-kubernetes-metrics"
from server for: "sa.yaml": serviceaccounts "Qovery-User-Role" is forbidden: User "system:node:ip-10-0-xx-xxx.eu-west-1.compute.internal" cannot get resource "serviceaccounts" in API group "" in the namespace "xxxxxxxxx-kubernetes-metrics": can only create tokens for individual service accounts
the name of the service created by the official Kubecost helm chart is something like <Helm_release_name>-cost-analyzer and not just “cost-analyzer”. (tpl function here)
The Helm release name is managed by Qovery and it is usually built as “helm-z<short_service_id>-<service_name>” but you can find it back by:
connecting with K9s on your cluster
have a look at the deployment logs, you can find the rendered templates and thus the service name
So in your case, you should set the service name to be “helm-zb731baef-kubecost-cost-analyzer” and then redeploy it.