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:
PSQL StatefulSet:
Artifactory StatefulSet:
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:
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:
Let's add the missing limits to the artifactory-small.yaml file (size as necessary):
After saving the file, let's apply it to the cluster:
Checking now, we can see that our PSQL pod is getting created! But we're still missing our Artifactory pods.
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
- Nginx
- Postgresql
- 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