0

I'm new to AWS EKS (Elastic Kubernetes Service). I'm trying to run SonarQube on EKS using Fargate profile (serverless).

Following are my Kubernetes manifests files:-

Deployment:-

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: sonarqube
  name: sonarqube
  namespace: cicd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sonarqube
  template:
    metadata:
      labels:
        app: sonarqube
    spec:
      containers:
        - name: sonarqube
          image: sonarqube:8.6.1-community
          resources:
            requests:
              cpu: 500m
              memory: 1024Mi
            limits:
              cpu: 2000m
              memory: 2048Mi
          volumeMounts:
          - mountPath: "/opt/sonarqube/data/"
            name: sonar-data
          - mountPath: "/opt/sonarqube/extensions/"
            name: sonar-extensions
          env:
          - name: "SONARQUBE_JDBC_USERNAME"
            valueFrom:
             configMapKeyRef:
               name: configuration
               key: USERNAME
          - name: "SONARQUBE_JDBC_URL"
            valueFrom:
             configMapKeyRef:
               name: configuration
               key: URL
          - name: "SONARQUBE_JDBC_PASSWORD"
            valueFrom:
              secretKeyRef:
                name: db-password
                key: password
          ports:
          - containerPort: 9000
            protocol: TCP
      volumes:
      - name: sonar-data
        persistentVolumeClaim:
          claimName: ebs-claim-sonar-data
      - name: sonar-extensions
        persistentVolumeClaim:
          claimName: ebs-claim-sonar-extensions

Storage Classes for Sonar data and Sonar extensions:-

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: ebs-sc-sonar-data
  namespace: cicd
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: ebs-sc-sonar-extensions
  namespace: cicd
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer

My Persistent Volume Claims (PVC):-

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim-sonar-data
  namespace: cicd
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc-sonar-data
  resources:
    requests:
      storage: 100Gi

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ebs-claim-sonar-extensions
  namespace: cicd
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc-sonar-extensions
  resources:
    requests:
      storage: 50Gi

Please ignore the config maps and secrets. The problem is PVC is not getting bound with the Storage Class hence the deployment is failing with the below error:-

Pod not supported on Fargate: volumes not supported: sonar-data not supported because PVC ebs-claim-sonar-data not bound, sonar-extensions not supported because: PVC ebs-claim-sonar-extensions not bound

I tried to debug a lot but not able to understand the root cause. I would really appreciate it if someone can help me with this.

Also just want to check if run just my storage class object using the kubectl create -f <sc file> then I guess I should be able to see any EBS volumes getting provisioned on the AWS console, right?

Please assist, thanks

vinod827
  • 1,123
  • 1
  • 21
  • 45
  • 1
    Does EKS provide a default storage class for you? If you delete the `StorageClass` objects and manual `storageClassName:` bindings, does it come up? – David Maze Feb 26 '21 at 16:45
  • The error message seems to be complaining specifically about Fargate; if you create a more traditional Node pool, does it still whine in the same way? – mdaniel Feb 26 '21 at 16:59
  • 4
    (The [documentation for the EBS CSI driver](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html) has a specific note that it's not supported on Fargate.) – David Maze Feb 26 '21 at 18:17
  • 1
    @DavidMaze, I think you should post it as an answer as it clearly explains the issue. – mario Mar 01 '21 at 19:56
  • @mdaniel, with a traditional node group, sonarqube is up and running fine however the problem is while running with Fargate profile...... – vinod827 Mar 03 '21 at 05:23
  • @DavidMaze, I guess Fargate supports EFS CSI driver but the problem remains same – vinod827 Mar 03 '21 at 06:20

0 Answers0