ARTIFACTORY: How To Fix "Failed Quota" and "Exceeded Quota" While Deploying Artifactory-HA in Helm

AuthorFullName__c
James Daniel
articleNumber
000006091
FirstPublishedDate
2024-05-05T07:48:47Z
lastModifiedDate
2025-05-21

ARTIFACTORY: How To Fix "Failed Quota" and "Exceeded Quota" While Deploying Artifactory-HA in Helm

The purpose of this article is to overcome the "failed quota" and "exceeded quota" warnings that appear in the statefulset and/or replicaset descriptions when deploying the Artifactory-HA Helm chart. In addition to this, other problematic symptoms include missing pods, PVs and PVCs.

I have seen the issue where no Kubernetes (K8s) pods are created in the Helm deployment of Artifactory-HA. When we run "kubectl get all" in the namespace, we see the deployment, replicaset, statefulset, and services are created:

NAME                                            TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
service/artifactory-ha-postgresql-headless      ClusterIP      xxxxxxx            <none>        5432/TCP                     11m
service/artifactory-ha-postgresql               ClusterIP      xxxxxxx    <none>        5432/TCP                     11m
service/artifactory-ha                          ClusterIP      xxxxxxx    <none>        8082/TCP,8025/TCP,8081/TCP   11m
service/artifactory-ha-artifactory-ha-primary   ClusterIP      xxxxxxx   <none>        8082/TCP,8081/TCP            11m
service/artifactory-ha-nginx                    LoadBalancer   xxxxxxx    <pending>     80:30294/TCP,443:31409/TCP   11m

NAME                                   READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/artifactory-ha-nginx   0/1     0            0           11m

NAME                                              DESIRED   CURRENT   READY   AGE
replicaset.apps/artifactory-ha-nginx-59dc69b597   1         0         0       11m

NAME                                                     READY   AGE
statefulset.apps/artifactory-ha-postgresql               0/1     11m
statefulset.apps/artifactory-ha-artifactory-ha-primary   0/3     11m

However, we're missing the pods!

"Failed Quota"

When we get the description of the statefulset and replicaset, we see a similar event message that points to the source of the issue being related to a "failed quota".

ReplicaSet:

Events:
  Type     Reason        Age                  From                   Message
  ----     ------        ----                 ----                   -------
  Warning  FailedCreate  7m29s (x9 
 18m)  replicaset-controller  (combined from similar events): Error creating: pods "artifactory-ha-nginx-59dc69b597-6srtm" is forbidden: failed quota: resource-quotas: must specify limits.cpu for: nginx; limits.memory for: nginx; requests.cpu for: nginx; requests.memory for: nginx


PSQL StatefulSet:

Events:
  Type     Reason            Age                 From                    Message
  ----     ------            ----                ----                    -------
  Normal   SuccessfulCreate  22m                 statefulset-controller  create Claim data-artifactory-ha-postgresql-0 Pod artifactory-ha-postgresql-0 in StatefulSet artifactory-ha-postgresql success
  Warning  FailedCreate      62s (x19 over 22m)  statefulset-controller  create Pod artifactory-ha-postgresql-0 in StatefulSet artifactory-ha-postgresql failed error: pods "artifactory-ha-postgresql-0" is forbidden: failed quota: resource-quotas: must specify limits.cpu for: artifactory-ha-postgresql; limits.memory for: artifactory-ha-postgresql


Artifactory StatefulSet:

Events:
Type     Reason            Age                 From                    Message
  ----     ------            ----                ----                    -------
  Warning  FailedCreate      24m (x15 over 25m)  statefulset-controller  create Pod artifactory-ha-artifactory-ha-primary-0 in StatefulSet artifactory-ha-artifactory-ha-primary failed error: pods "artifactory-ha-artifactory-ha-primary-0" is forbidden: failed quota: resource-quotas: must specify limits.cpu for: artifactory-ha,event,frontend,jfconnect,metadata,migration-artifactory-ha,observability,router; limits.memory for: artifactory-ha,event,frontend,jfconnect,metadata,migration-artifactory-ha,observability,router; requests.cpu for: artifactory-ha,event,frontend,jfconnect,metadata,migration-artifactory-ha,observability,router; requests.memory for: artifactory-ha,event,frontend,jfconnect,metadata,migration-artifactory-ha,observability,router


This error can occur when we have defined resource quotas on the namespace but are missing limits for one or more resources. 

Let's check the resourceQuotas in the namespace:

kubectl get resourcequotas -n resources

NAME              AGE   REQUEST                                                LIMIT
resource-quotas   42m   pods: 0/2, requests.cpu: 0/2, requests.memory: 0/4Gi   limits.cpu: 0/4, limits.memory: 0/6Gi


Sure enough, we can see that we have a resourceQuota named "resource-quotas" and the related resource requests and limits.

If we check the descriptions of the statefulsets and replicasets, we can verify what we are setting for each of these resources. We can see in each description that we are failing to set limits for the following services:

  • Postgresql
  • Nginx
  • Artifactory-ha (artifactory)
  • Event
  • Frontend
  • JFConnect
  • Metadata
  • Migration-artifactory-ha
  • Observability
  • Router

Let's go ahead and use one of the sizing.yaml files to set requests and limits for the Artifactory resources to attempt to overcome this issue. As we're using the default values.yaml file, we know these limits aren't being set. The sizing yaml file should take care of much of these but we can see that the following limits are missing from the file:

  • Nginx
  • Postgresql
  • Migration-artifactory-ha

If you notice, there is a "migration-artifactory-ha" service that isn't included in either the default values.yaml or the sizing yaml files. What is this? If we check the "artifactory-primary-statefulset.yaml" file in the Helm Chart repository in GitHub, we will see that it is pulling resources from "Values.artifactory.primary.resources", the same resource settings for the "artifactory" (artifactory-ha) service. Since the sizing yaml files add the limits for "artifactory" we don't need to make any changes to meet the limit requirements for "migration-artifactory-ha".

Let's add the missing limits to the artifactory-small.yaml file (size as necessary):

postgresql:
  resources:
    limits:
      memory: "256Mi"
      cpu: "250m"
nginx:
  resources:
    limits:
      memory: "256Mi"
      cpu: "250m"


After saving the file, let's apply it to the cluster:

helm upgrade --install artifactory-ha jfrog/artifactory-ha -f artifactory-small.yaml -n <namespace>


Checking now, we can see that our PSQL pod is getting created! But we're still missing our Artifactory pods.

kubectl get pods -n resources
NAME                          READY   STATUS    RESTARTS   AGE
artifactory-ha-postgresql-0   1/1     Running   0          2m
artifactory-ha-nginx-77d44487c4-xhz6z   0/1     Running   0          2m
"Exceeded Quota" 

We can see that the Artifactory statefulset is still throwing an error:

Artifactory StatefuSet:

Events:
  Type     Reason        Age                From                    Message
  ----     ------        ----               ----                    -------
   Warning  FailedCreate  3m9s (x2 over 3m9s)  statefulset-controller  create Pod artifactory-ha-artifactory-ha-primary-0 in StatefulSet artifactory-ha-artifactory-ha-primary failed error: pods "artifactory-ha-artifactory-ha-primary-0" is forbidden: exceeded quota: resource-quotas, requested: limits.cpu=7,limits.memory=7Gi,pods=1, used: limits.cpu=500m,limits.memory=512Mi,pods=2, limited: limits.cpu=4,limits.memory=6Gi,pods=2


Here we're seeing a different error: "Exceeded Quota". We can see that the requested limits are higher than the hard ("limited") limits. If the environment allows, we can simply edit the resourceQuota to increase the hard limits. If not, we may be able to reduce the request limits for the cluster services. We may also need to adjust replicas as well.

To adjust the resourceQuota, let's run the following command and edit as necessary and redeploy the cluster:

kubectl edit resourcequota <resource quota name>


To adjust the resource allocations of individual services, we can use the sizing yaml files in the Helm Chart or specify the resource limitations to meet the limits of the resourceQuota. As the machine I'm working on has enough resources, I'll increase the hard limits in the resourceQuota as shown below:

Name:            resource-quotas
Namespace:       resources
Resource         Used    Hard
--------         ----    ----
limits.cpu       7500m   8
limits.memory    7680Mi  10Gi
pods             3       5
requests.cpu     1600m   7
requests.memory  2136Mi  8Gi


After making these adjustments and redeploying the cluster we see the Artifactory pods initializing.

NAME                                      READY   STATUS            RESTARTS        AGE
artifactory-ha-postgresql-0               1/1     Running           0               5h34m
artifactory-ha-nginx-77d44487c4-xhz6z     0/1     Running           13 (3m2s ago)   3h19m
artifactory-ha-artifactory-ha-primary-0   0/7     PodInitializing   0               6s


In this article, we reviewed how to overcome errors in the StatefulSets and ReplicatSet related to resouceQuotas configured in the namespace that prevented the creation of pods in the Artifactory-HA Helm installation. I hope this guide helped understand how this error and how resourceQuotas can impact the health of the Artifactory cluster.