In our previous posts, we have explored various aspects of HTTPS certificate issues in your SAS Viya platform, including Expired Certificates, Mismatched Domain Names, and Incomplete Certificate Chain. In this final post of the series, we will focus on troubleshooting logs, specifically those from the sas-certframe init container and the Ingress controller. These logs provide essential insights into SSL-related issues, helping you diagnose and resolve problems such as missing certificates, truststore errors, and Ingress misconfigurations.
Note: The $viya environment variable is used on kubectl
commands that require the --namespace
flag. Make sure that the environment variable is created before you use these kubectl
commands.
The sas-certframe init container is responsible for managing "internal" SSL certificates in SAS Viya. If this container fails, pods may get stuck in an Init or CrashLoopBackOff state. Checking its logs can help diagnose issues such as missing certificates, failed updates, or truststore errors.
To retrieve the logs, run:
POD_NAME=$(kubectl -n $viya get pods -l app=sas-logon-app -o jsonpath='{.items[0].metadata.name}')
kubectl -n $viya logs $POD_NAME -c sas-certframe
A successful execution of the container typically follows these steps:
If the logs contain messages like:
error parsing certificate: x509: failed to parse crypto resource fullFileName:/customer-provided-ca-certificates/additional_ca.pem
This indicates a formatting issue with the additionnal, customer provided CA certificate. To resolve:
openssl x509 -in additional_ca.pem -text -noout
If you see:
failed to get secret: secrets "sas-ingress-certificate" not found
It means the Ingress certificate secret is missing, preventing the truststore from updating. Check if the secret exists using:
kubectl -n $viya get secret sas-ingress-certificate
If it's missing, review your TLS configuration and regenerate the secret if necessary.
If you see:
CA certificate Secret in CaCertSecretName does not exist. Ensure cert-manager Issuer and CA Certificate resources have been created. [CaCertSecretName:sas-viya-ca-certificate-secret]
It means the SAS Viya CA certificate secret (sas-viya-ca-certificate-secret) is missing, implying the cert-manager component has not been able to create it. Check if the secret exists using:
kubectl -n $viya get secret sas-viya-ca-certificate-secret
kubectl -n $viya get issuers -o wide
By examining the logs and understanding whether SAS Viya is using cert-manager or OpenSSL, you can efficiently troubleshoot SSL certificate issues and ensure a smooth certificate management process.
The Ingress controller manages external traffic to your SAS Viya platform and handles SSL termination. If there are issues with TLS certificates, you may encounter SSL handshake failures, expired or incorrect certificates, or misconfigured Ingress rules. Analyzing the Ingress controller logs can help identify and resolve these problems.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
To inspect the logs of the Ingress controller and check for SSL-related errors, use the following commands:
POD_NAME=$(kubectl -n $ingress get pods -l app.kubernetes.io/instance=ingress-nginx -o jsonpath='{.items[0].metadata.name}')
kubectl -n $ingress logs $POD_NAME --tail=-1
Look for log messages that indicate problems with certificate validation, secret loading, or Ingress configuration. Common log entries include:
kubectl -n $viya get secret $(kubectl -n $viya get ingress -o jsonpath="{.spec.tls[*].secretName}")
Note: You can use sas-logon-app (as an example) for your ingress name
kubectl -n $viya describe secret $(kubectl -n $viya get ingress -o jsonpath="{.spec.tls[*].secretName}")
kubectl -n $viya get secret $(kubectl -n get ingress -o jsonpath="{.spec.tls[*].secretName}") -o jsonpath='{.data.tls\.crt}' | base64 -d | openssl x509 -text
kubectl -n $ingress rollout restart deployment nginx-ingress-controller
By following these steps, you can ensure that your Ingress controller loads and applies the correct TLS certificates, preventing SSL handshake and routing issues.
In this post, we examined how to troubleshoot SSL-related issues by analyzing the logs of the sas-certframe init container and the Ingress controller. We covered common errors, diagnostic steps, and resolutions to ensure proper certificate management and secure communication within your SAS Viya platform.
This concludes our series on troubleshooting HTTPS certificate issues. We hope this guide has provided valuable insights and practical solutions for managing SSL configurations effectively.
For a deeper understanding, I highly recommend the comprehensive 'Advanced Topics in Encryption on SAS Viya' training. This course provides a thorough exploration of encryption, covering everything from core concepts to advanced techniques. It also includes hands-on exercises and an associated lab environment, allowing you to apply what you've learned in real-world scenarios and further strengthen your knowledge of secure communication within SAS Viya.
Be sure to check out the complete series on Troubleshooting HTTPS Certificate Issues for your SAS Viya platform to guide you through various common challenges and their resolutions.
Find more articles from SAS Global Enablement and Learning here.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.