Basic Troubleshooting for Artifactory in HELM Based Installation

ARTIFACTORY: Debugging Artifactory issues in HELM based installation

AuthorFullName__c
Harsh Veliyat
articleNumber
000005923
FirstPublishedDate
2023-12-14T20:53:50Z
lastModifiedDate
2025-05-23
Artifactory issues in a Kubernetes (K8S) environment can be complex, but there are several steps we can follow to identify and resolve problems effectively. Here's a step-by-step guide to troubleshooting Artifactory issues in a K8S environment:

Note: Replace <artifactory-pod-name> and <namespace> with the actual names of the Artifactory pod and namespace.

1. Check Artifactory Pod Status:Verify if the Artifactory pod is running or is in ready state.
kubectl get pods -n <namespace>

If the pod is in a non-running or non-ready state, we can use kubectl describe pod to get more details about what might be causing the issue.
kubectl describe pod <artifactory-pod-name> -n <namespace>

2. Check Artifactory Logs:Start by examining Artifactory's logs to identify any error messages or warning signs. We can access these logs through Kubernetes commands (kubectl logs). Search for any specific error messages or exceptions that can give us a clue about what might be wrong.
kubectl logs <artifactory-pod-name> -n <namespace> -c <container-name>

Use the following command to get the list of containers in a pod.
kubectl get pod <artifactory-pod-name> -n <namespace> -o jsonpath='{.spec.containers[*].name}'
OR
kubectl get pod <artifactory-pod-name> -n <namespace> -o json | jq '.spec.containers[] | .name' 

3. Resource Utilization:
We can check the resource utilization of the Artifactory pod. We can use kubectl top pod command to check the CPU and memory utilization of the pod. Resource constraints can lead to performance issues and failures.
kubectl top pod <artifactory-pod-name> -n <namespace>

4. Check Connectivity:
We need to ensure that Artifactory can connect to the required external resources. This includes external databases, storage backends, and network resources. We also need to check for any firewall rules or network policies that might be blocking connections.
4a. Storage Issues:
Artifactory relies on kubernetes storage to store the configuration file and mount the cache-fs. We need to check if the persistent volume (PV) and persistent volume claim (PVC) associated with Artifactory are in a healthy state, we can use kubectl get pv and kubectl get pvc to verify. Ensure that the PVC associated with Artifactory POD is bounded and available. Make sure the STATUS is "Bound" for the Artifactory PVC.

kubectl get pv -n <namespace>
kubectl get pvc -n <namespace>

For more information on the PVC we can use the description command.

kubectl describe pv <pv-name> -n <namespace>
kubectl describe pvc <pvc-name> -n <namespace>
4b. Database Connectivity:
In case of using an external database with Artifactory, we need to ensure that the database is accessible and that the connection details (e.g., host, port, credentials) are correct.
kubectl exec -it <artifactory-pod-name> -n <namespace> -- /bin/bash
timeout 5 bash -c "</dev/tcp/<database-server-host-name>/<database-server-port>"

Note: Above command only test if the target server is reachable or not, will not perform actual Database test connectivity like we do using DB clients(psql, mssql, etc)

4c. Network Policies:
We need to make sure that the pods with the Artifactory namespace can communicate with each other as well as to the External client like security realms(LDAP, SAML, etc), filestore(S3, GCS, etc).

5. Check for Resource Requests and Limits:
Verify that the resource requests and limits are set correctly in the Artifactory statefulset YAML:
kubectl get statefulset <artifactory-deployment-name> -n <namespace> -o jsonpath='{.spec.template.spec.containers[0].resources}'

6. Pod Events:
We can check if there are any pod events that might provide insights into what's going wrong:
kubectl describe pod <artifactory-pod-name> -n <namespace>

7. Check Kubernetes Events:
We can check Kubernetes events for any issues related to resource allocation, scheduling, or networking:
kubectl get events -n <namespace>

8. Monitoring and Alerts:
We can implement monitoring and alerting solutions (e.g., Prometheus and Grafana ) to proactively detect and respond to Artifactory issues. Set up alerts for resource utilization, error rates, and other critical metrics.

9. Backup and Restore:
We need to ensure that we have a reliable backup and restore strategy in place for Artifactory to recover from any critical data loss or corruption issues.

Conclusion:
Troubleshooting Artifactory issues in a Kubernetes environment involves a systematic approach to identify and resolve problems. By following these steps and using the provided examples, we can effectively diagnose and address common issues to ensure the reliability and availability of Artifactory.