How do I upgrade my license file on Kubernetes?

Created by Steve Place, Modified on Wed, 31 Jan 2024 at 11:39 AM by Steve Place

If you're using Stardog's Helm Charts to run your cluster, our helm-charts repo is a good companion to have open while reading this article.


We recommend upgrading your license at least 7 days before it expires. If you are an admin, you should put a simple calendar reminder in place to notify you of the license's expiration.


You'll upgrade your license with a Kubernetes secret.


How to check if the secret already exists


You can check to see if your license already exists with:


kubectl get secret stardog-license -n <your-namespace>


This will return details about the secret if it exists or an error message if it does not. If it already exists, you can delete it with:


kubectl delete secret stardog-license -n <your-namespace>


How to upgrade your license


You can replace your soon-to-expire license file with a fresh one via the following command:


kubectl -n <your-namespace> create secret generic stardog-license --from-file stardog-license-key.bin=/path/to/new/stardog-license-key.bin --dry-run=client -o yaml | kubectl apply -f -


This is the command found in the Installation section of the Helm Charts readme, with two additional bits:

  • --dry-run=client, which means that the command doesn't actually create the secret, but it outputs the configuration that would be used to create the secret. That gets piped into
  • kubectl apply -f -, which applies the configuration to the cluster. This would create the secret if it didn't exist, but because it does, it'll update it.


Validating the license was applied successfully


To validate that the new license was successfully pushed, you can compare the base64 encoding of the license with the base64 encoding of the Kubernetes secret you just generated. To see the base64 encoding of the license on your local machine, run:


base64 /path/to/new/stardog-license-key.bin


To see the base64 encoding of your Kubernetes secret, run:


kubectl -n <your-namespace> get secret stardog-license -o yaml | grep 'stardog-license-key.bin'


If you see the same value from both commands, the license was applied successfully.


How to perform a rolling restart


You can perform a rolling restart with the following command:


kubectl rollout restart deployment <your-deployment-name> -n <your-namespace>


How to verify the pods have restarted


Check the rollout status with:


kubectl rollout status deployment <your-deployment-name> -n <your-namespace>


Then get pod information to confirm the pods have restarted:


kubectl get pods -n <your-namespace> -l app=<your-app-selector>


Your pods should show a recent restart date.





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article