Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to initialize plugins server: unable to parse additional clusters config #8198

Open
bobdivx opened this issue Jan 10, 2025 · 0 comments
Labels
kind/question An issue that reports a question about the project

Comments

@bobdivx
Copy link

bobdivx commented Jan 10, 2025

Summary
Issue with Kubeapps APIs deployment: "failed to initialize plugins server: unable to parse additional clusters config".

Background and rationale
I am attempting to deploy Kubeapps within the monitoring namespace of my Kubernetes cluster. My use case involves enabling multi-cluster support and utilizing Kubeapps for managing Helm charts and other Kubernetes resources. Despite configuring the necessary deployments, services, and ConfigMaps, the kubeapps-apis pod fails to initialize properly, which is critical for interacting with Kubernetes clusters through Kubeapps.

Description
The kubeapps-apis pod enters a CrashLoopBackOff state. The logs provide the following error:

Error: failed to initialize plugins server: unable to parse additional clusters config: invalid character 'c' looking for beginning of value

The clusters-config.yaml ConfigMap contains the following configuration:

clusters:
  - name: default
    apiServiceURL: https://kubernetes.default.svc
    serviceToken: /var/run/secrets/kubernetes.io/serviceaccount/token
    caCert: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt

I have attached my YAML configuration below:

Deployments

# Deployment for kubeapps
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubeapps
  namespace: monitoring
  labels:
    app: kubeapps
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kubeapps
  template:
    metadata:
      labels:
        app: kubeapps
    spec:
      containers:
        - name: kubeapps
          image: bitnami/kubeapps-dashboard:latest
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
          env:
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          volumeMounts:
            - mountPath: /data
              name: kubeapps-data
      volumes:
        - name: kubeapps-data
          persistentVolumeClaim:
            claimName: kubeapps-data
# Deployment for kubeapps-apis
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubeapps-apis
  namespace: monitoring
  labels:
    app: kubeapps-apis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: kubeapps-apis
  template:
    metadata:
      labels:
        app: kubeapps-apis
    spec:
      containers:
        - name: kubeapps-apis
          image: bitnami/kubeapps-apis:latest
          args:
            - "--clusters-config-path=/etc/kubeapps/clusters-config.yaml"
            - "--plugin-config-path=/etc/kubeapps/plugin-config.yaml"
          volumeMounts:
            - name: clusters-config
              mountPath: /etc/kubeapps/clusters-config.yaml
              subPath: clusters-config.yaml
            - name: plugins-config
              mountPath: /etc/kubeapps/plugin-config.yaml
              subPath: plugin-config.yaml
      volumes:
        - name: clusters-config
          configMap:
            name: kubeapps-clusters-config
        - name: plugins-config
          configMap:
            name: kubeapps-plugins-config

Services

# Service for kubeapps
apiVersion: v1
kind: Service
metadata:
  name: kubeapps
  namespace: monitoring
spec:
  selector:
    app: kubeapps
  ports:
    - port: 80
      targetPort: 8080
# Service for kubeapps-apis
apiVersion: v1
kind: Service
metadata:
  name: kubeapps-apis
  namespace: monitoring
spec:
  selector:
    app: kubeapps-apis
  ports:
    - port: 50051
      targetPort: 50051

ConfigMaps

# ConfigMap for clusters-config
apiVersion: v1
kind: ConfigMap
metadata:
  name: kubeapps-clusters-config
  namespace: monitoring
data:
  clusters-config.yaml: |
    clusters:
      - name: default
        apiServiceURL: https://kubernetes.default.svc
        serviceToken: /var/run/secrets/kubernetes.io/serviceaccount/token
        caCert: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
# ConfigMap for plugins-config
apiVersion: v1
kind: ConfigMap
metadata:
  name: kubeapps-plugins-config
  namespace: monitoring
data:
  plugin-config.yaml: |
    plugins:
      - name: helm
        version: v1alpha1

Despite this setup, I encounter persistent issues with the kubeapps-apis pod initialization.

Additional context
I suspect the issue may relate to the parsing of the clusters-config.yaml file, given the logs mention an "invalid character 'c'". Any guidance on resolving this error or insights into potential misconfigurations in my YAML files would be greatly appreciated.

Thank you for your assistance!

@bobdivx bobdivx added the kind/question An issue that reports a question about the project label Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question An issue that reports a question about the project
Projects
None yet
Development

No branches or pull requests

1 participant