It's been a couple of years, but this is still unsolved afaik. After AWS announced their partnership with kubecost we attempted to deploy kubecost to EKS Fargate. It failed out around the EBS-CSI driver, which we weren't using as we don't allow EBS volumes, only EFS volumes in our clusters for architectural reasons.
kubecost uses prometheus under the covers, which causes the EBS requirement:
`CAUTION: Non-POSIX compliant filesystems are not supported for Prometheus' local storage as unrecoverable corruptions may happen. NFS filesystems (including AWS's EFS) are not supported. NFS could be POSIX-compliant, but most implementations are not. It is strongly recommended to use a local filesystem for reliability.`
Even when we installed it, storage errors continued:
`Pod not supported on Fargate: volumes not supported: persistent-configs not supported because: PVC kubecost-cost-analyzer not bound`
`Pod not supported on Fargate: volumes not supported: storage-volume not supported because: PVC kubecost-prometheus-server not bound`
We opened a case with AWS Enterprise Support just to be told:
`Keep in mind that 3rd party add-ons are not supported by AWS, it is necessary that you validate if they meet your business requirements. Only to set expectations we treated this case as best-effort basis`
`The cluster must have Amazon EC2 nodes because you can't run Kubecost on Fargate nodes`
`Therefore, the response for your case is you need run EC2 nodes in your cluster to kubecost work properly. I double check the guide you sent us and don't mentioned explicit you need EC2 nodes. My apologies for the inconvenient and delayed caused by this topic.`
We left off with this issue: https://github.com/kubecost/kubecost/issues/2092
The linked Google doc no longer exists but one person says "works now, thanks" so maybe they've improved kubecost since then?
kubecost also has a CNCF competitor https://opencost.io/ that could be explored. I don't know if it supports Fargate any better.