How safe is running doctl inside a kubernetes container?

tl;dr: Is it safe to have a doctl access token in a secret inside kubernetes? What is a good alternative?

I have my domain with mrdomain, I can’t change the dns to use digital ocean’s because to keep using the email from mrdomain they need to manage the domain. I want to use the spaces with CDN and i’m using lets encrypt to generate SSL certs once every 2 months.

I’ve written a container to be run on a CronJob that:

  • Generates an SSL cert manually;
  • Uploads to the space;
  • Validates the cert;
  • Creates the cert on my account;
  • Assign the cert to the corresponding space;
  • Removes the old invalid cert

It works fine, but I need to run doctl compute certificate create, doctl compute cdn update and doctl compute certificate delete. Those 3 commands need a token with write permission.

If anyone get access to this token they will have unlimited access to wreak havoc on our account.

So my question is, is it safe to keep this under a kubernetes secret? Is there a better option?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
January 9, 2023

Hey @nicoskaralis,

I believe that the approach that you’ve taken with a separate cronjob container, the solution should be sufficient. In the long run, it looks like someone has had the same idea before and has posted it on our Product Ideas board. The best thing to do would be to head over and add your vote to it, as well as adding any additional information in the comments for exactly what you’d like to see implemented!


- Bobby.