We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo


In the past, practicing yoga was as simple as rolling out your yoga mat and settling into a practice. Some yogis began noticing, however, that some practitioners weren’t able to sink into certain poses properly and they began developing different tools and accessories that would help struggling yogis achieve difficult poses safely. In the 1960s, the yoga market began seeing an emergence of new and creative items that were totally different from standard mats.
Nowadays there are so many different things on the market that it can be difficult to parse out the good from the bad.
With this guide, we’ll show you the top 5 yoga accessories that will safely enhance your practice by giving you support while encouraging proper practice techniques!
Yoga straps are a great way to ease a little deeper into poses that would otherwise be difficult. Flexibility, like most things in life, is fluid and unique to each of us. I, for example, have the tightest hamstrings in the world and I like to use a strap to work on stretching out those muscles. They’re versatile, too, which means you can use them however you like!
This Tumaz Yoga Strap is great addition to your practice. Here’s why!
Buy the Tumaz Yoga Strap on Amazon.


Yoga blocks are often used as an extension of the arms, which is handy when working into poses that require you to elongate your body. They’re also durable enough to support your weight, which is great when you want to work on the alignment of your body in certain poses.
A long-standing and popular name in the yoga industry, these Gaiam Essentials Yoga Blocks are perfect if you want to enhance your practice.
Buy the Gaiam Essentials Yoga Blocks on Amazon.


Yoga towels are great, not only if you tend to sweat during yoga practices, but they offer a little added cushion. If you practice on hard surfaces, you know what I’m talking about. I’ve practiced on surfaces like hardwood floors and concrete and they’re always hard on my knees! A folded-up yoga towel beneath your knees or wrists can offer some reprieve from such surfaces.
This Pefi Yoga Towel is perfect for dabbing away sweat during a Bikram class while offering just enough cushion without interrupting your practice.
Buy the Pefi Yoga Towel on Amazon.


An uncommon addition to a yoga practice, yoga bolsters are a long and firm pillow that can be used to provide extra comfort and support. They’re mainly used in restorative yoga practices and postures and can help to further open up the diaphragm and encourage deeper breathing.
This Retrospec Sequoia Yoga Bolster offers the right amount of support and comfort for any yogi looking to deepen their breathing.
You can find this Retrospec Sequoia Yoga Bolster on Amazon.


Our fifth and final item on this list is a newer one in the yoga game and is the perfect addition to your practice if you want to work on backbends, heart-opening positions, or if you just want a fun and new way to massage your spine!
This UpCircleSeven Yoga Wheel is the top-of-the-line wheel when it comes to circular objects in your practice.
You can find this UpCircleSeven Yoga Wheel on Amazon.




In the past, practicing yoga was as simple as rolling out your yoga mat and settling into a practice. Some yogis began noticing, however, that some practitioners weren’t able to sink into certain poses properly and they began developing different tools and accessories that would help struggling yogis achieve difficult poses safely. In the 1960s, the yoga market began seeing an emergence of new and creative items that were totally different from standard mats.
Nowadays there are so many different things on the market that it can be difficult to parse out the good from the bad.
With this guide, we’ll show you the top 5 yoga accessories that will safely enhance your practice by giving you support while encouraging proper practice techniques!
Yoga straps are a great way to ease a little deeper into poses that would otherwise be difficult. Flexibility, like most things in life, is fluid and unique to each of us. I, for example, have the tightest hamstrings in the world and I like to use a strap to work on stretching out those muscles. They’re versatile, too, which means you can use them however you like!
This Tumaz Yoga Strap is great addition to your practice. Here’s why!
Buy the Tumaz Yoga Strap on Amazon.


Yoga blocks are often used as an extension of the arms, which is handy when working into poses that require you to elongate your body. They’re also durable enough to support your weight, which is great when you want to work on the alignment of your body in certain poses.
A long-standing and popular name in the yoga industry, these Gaiam Essentials Yoga Blocks are perfect if you want to enhance your practice.
Buy the Gaiam Essentials Yoga Blocks on Amazon.


Yoga towels are great, not only if you tend to sweat during yoga practices, but they offer a little added cushion. If you practice on hard surfaces, you know what I’m talking about. I’ve practiced on surfaces like hardwood floors and concrete and they’re always hard on my knees! A folded-up yoga towel beneath your knees or wrists can offer some reprieve from such surfaces.
This Pefi Yoga Towel is perfect for dabbing away sweat during a Bikram class while offering just enough cushion without interrupting your practice.
Buy the Pefi Yoga Towel on Amazon.


An uncommon addition to a yoga practice, yoga bolsters are a long and firm pillow that can be used to provide extra comfort and support. They’re mainly used in restorative yoga practices and postures and can help to further open up the diaphragm and encourage deeper breathing.
This Retrospec Sequoia Yoga Bolster offers the right amount of support and comfort for any yogi looking to deepen their breathing.
You can find this Retrospec Sequoia Yoga Bolster on Amazon.


Our fifth and final item on this list is a newer one in the yoga game and is the perfect addition to your practice if you want to work on backbends, heart-opening positions, or if you just want a fun and new way to massage your spine!
This UpCircleSeven Yoga Wheel is the top-of-the-line wheel when it comes to circular objects in your practice.
You can find this UpCircleSeven Yoga Wheel on Amazon.




In the past, practicing yoga was as simple as rolling out your yoga mat and settling into a practice. Some yogis began noticing, however, that some practitioners weren’t able to sink into certain poses properly and they began developing different tools and accessories that would help struggling yogis achieve difficult poses safely. In the 1960s, the yoga market began seeing an emergence of new and creative items that were totally different from standard mats.
Nowadays there are so many different things on the market that it can be difficult to parse out the good from the bad.
With this guide, we’ll show you the top 5 yoga accessories that will safely enhance your practice by giving you support while encouraging proper practice techniques!
Yoga straps are a great way to ease a little deeper into poses that would otherwise be difficult. Flexibility, like most things in life, is fluid and unique to each of us. I, for example, have the tightest hamstrings in the world and I like to use a strap to work on stretching out those muscles. They’re versatile, too, which means you can use them however you like!
This Tumaz Yoga Strap is great addition to your practice. Here’s why!
Buy the Tumaz Yoga Strap on Amazon.


Yoga blocks are often used as an extension of the arms, which is handy when working into poses that require you to elongate your body. They’re also durable enough to support your weight, which is great when you want to work on the alignment of your body in certain poses.
A long-standing and popular name in the yoga industry, these Gaiam Essentials Yoga Blocks are perfect if you want to enhance your practice.
Buy the Gaiam Essentials Yoga Blocks on Amazon.


Yoga towels are great, not only if you tend to sweat during yoga practices, but they offer a little added cushion. If you practice on hard surfaces, you know what I’m talking about. I’ve practiced on surfaces like hardwood floors and concrete and they’re always hard on my knees! A folded-up yoga towel beneath your knees or wrists can offer some reprieve from such surfaces.
This Pefi Yoga Towel is perfect for dabbing away sweat during a Bikram class while offering just enough cushion without interrupting your practice.
Buy the Pefi Yoga Towel on Amazon.


An uncommon addition to a yoga practice, yoga bolsters are a long and firm pillow that can be used to provide extra comfort and support. They’re mainly used in restorative yoga practices and postures and can help to further open up the diaphragm and encourage deeper breathing.
This Retrospec Sequoia Yoga Bolster offers the right amount of support and comfort for any yogi looking to deepen their breathing.
You can find this Retrospec Sequoia Yoga Bolster on Amazon.


Our fifth and final item on this list is a newer one in the yoga game and is the perfect addition to your practice if you want to work on backbends, heart-opening positions, or if you just want a fun and new way to massage your spine!
This UpCircleSeven Yoga Wheel is the top-of-the-line wheel when it comes to circular objects in your practice.
You can find this UpCircleSeven Yoga Wheel on Amazon.




In the past, practicing yoga was as simple as rolling out your yoga mat and settling into a practice. Some yogis began noticing, however, that some practitioners weren’t able to sink into certain poses properly and they began developing different tools and accessories that would help struggling yogis achieve difficult poses safely. In the 1960s, the yoga market began seeing an emergence of new and creative items that were totally different from standard mats.
Nowadays there are so many different things on the market that it can be difficult to parse out the good from the bad.
With this guide, we’ll show you the top 5 yoga accessories that will safely enhance your practice by giving you support while encouraging proper practice techniques!
Yoga straps are a great way to ease a little deeper into poses that would otherwise be difficult. Flexibility, like most things in life, is fluid and unique to each of us. I, for example, have the tightest hamstrings in the world and I like to use a strap to work on stretching out those muscles. They’re versatile, too, which means you can use them however you like!
This Tumaz Yoga Strap is great addition to your practice. Here’s why!
Buy the Tumaz Yoga Strap on Amazon.


Yoga blocks are often used as an extension of the arms, which is handy when working into poses that require you to elongate your body. They’re also durable enough to support your weight, which is great when you want to work on the alignment of your body in certain poses.
A long-standing and popular name in the yoga industry, these Gaiam Essentials Yoga Blocks are perfect if you want to enhance your practice.
Buy the Gaiam Essentials Yoga Blocks on Amazon.


Yoga towels are great, not only if you tend to sweat during yoga practices, but they offer a little added cushion. If you practice on hard surfaces, you know what I’m talking about. I’ve practiced on surfaces like hardwood floors and concrete and they’re always hard on my knees! A folded-up yoga towel beneath your knees or wrists can offer some reprieve from such surfaces.
This Pefi Yoga Towel is perfect for dabbing away sweat during a Bikram class while offering just enough cushion without interrupting your practice.
Buy the Pefi Yoga Towel on Amazon.


An uncommon addition to a yoga practice, yoga bolsters are a long and firm pillow that can be used to provide extra comfort and support. They’re mainly used in restorative yoga practices and postures and can help to further open up the diaphragm and encourage deeper breathing.
This Retrospec Sequoia Yoga Bolster offers the right amount of support and comfort for any yogi looking to deepen their breathing.
You can find this Retrospec Sequoia Yoga Bolster on Amazon.


Our fifth and final item on this list is a newer one in the yoga game and is the perfect addition to your practice if you want to work on backbends, heart-opening positions, or if you just want a fun and new way to massage your spine!
This UpCircleSeven Yoga Wheel is the top-of-the-line wheel when it comes to circular objects in your practice.
You can find this UpCircleSeven Yoga Wheel on Amazon.


Yoga straps are a great way to ease a little deeper into poses that would otherwise be difficult. Flexibility, like most things in life, is fluid and unique to each of us. I, for example, have the tightest hamstrings in the world and I like to use a strap to work on stretching out those muscles. They’re versatile, too, which means you can use them however you like!
This Tumaz Yoga Strap is great addition to your practice. Here’s why!
Buy the Tumaz Yoga Strap on Amazon.


Yoga straps are a great way to ease a little deeper into poses that would otherwise be difficult. Flexibility, like most things in life, is fluid and unique to each of us. I, for example, have the tightest hamstrings in the world and I like to use a strap to work on stretching out those muscles. They’re versatile, too, which means you can use them however you like!
This Tumaz Yoga Strap is great addition to your practice. Here’s why!
Buy the Tumaz Yoga Strap on Amazon.


Yoga blocks are often used as an extension of the arms, which is handy when working into poses that require you to elongate your body. They’re also durable enough to support your weight, which is great when you want to work on the alignment of your body in certain poses.
A long-standing and popular name in the yoga industry, these Gaiam Essentials Yoga Blocks are perfect if you want to enhance your practice.
Buy the Gaiam Essentials Yoga Blocks on Amazon.


Yoga blocks are often used as an extension of the arms, which is handy when working into poses that require you to elongate your body. They’re also durable enough to support your weight, which is great when you want to work on the alignment of your body in certain poses.
A long-standing and popular name in the yoga industry, these Gaiam Essentials Yoga Blocks are perfect if you want to enhance your practice.
Buy the Gaiam Essentials Yoga Blocks on Amazon.


Yoga towels are great, not only if you tend to sweat during yoga practices, but they offer a little added cushion. If you practice on hard surfaces, you know what I’m talking about. I’ve practiced on surfaces like hardwood floors and concrete and they’re always hard on my knees! A folded-up yoga towel beneath your knees or wrists can offer some reprieve from such surfaces.
This Pefi Yoga Towel is perfect for dabbing away sweat during a Bikram class while offering just enough cushion without interrupting your practice.
Buy the Pefi Yoga Towel on Amazon.


Yoga towels are great, not only if you tend to sweat during yoga practices, but they offer a little added cushion. If you practice on hard surfaces, you know what I’m talking about. I’ve practiced on surfaces like hardwood floors and concrete and they’re always hard on my knees! A folded-up yoga towel beneath your knees or wrists can offer some reprieve from such surfaces.
This Pefi Yoga Towel is perfect for dabbing away sweat during a Bikram class while offering just enough cushion without interrupting your practice.
Buy the Pefi Yoga Towel on Amazon.


An uncommon addition to a yoga practice, yoga bolsters are a long and firm pillow that can be used to provide extra comfort and support. They’re mainly used in restorative yoga practices and postures and can help to further open up the diaphragm and encourage deeper breathing.
This Retrospec Sequoia Yoga Bolster offers the right amount of support and comfort for any yogi looking to deepen their breathing.
You can find this Retrospec Sequoia Yoga Bolster on Amazon.


An uncommon addition to a yoga practice, yoga bolsters are a long and firm pillow that can be used to provide extra comfort and support. They’re mainly used in restorative yoga practices and postures and can help to further open up the diaphragm and encourage deeper breathing.
This Retrospec Sequoia Yoga Bolster offers the right amount of support and comfort for any yogi looking to deepen their breathing.
You can find this Retrospec Sequoia Yoga Bolster on Amazon.


Our fifth and final item on this list is a newer one in the yoga game and is the perfect addition to your practice if you want to work on backbends, heart-opening positions, or if you just want a fun and new way to massage your spine!
This UpCircleSeven Yoga Wheel is the top-of-the-line wheel when it comes to circular objects in your practice.
You can find this UpCircleSeven Yoga Wheel on Amazon.


Our fifth and final item on this list is a newer one in the yoga game and is the perfect addition to your practice if you want to work on backbends, heart-opening positions, or if you just want a fun and new way to massage your spine!
This UpCircleSeven Yoga Wheel is the top-of-the-line wheel when it comes to circular objects in your practice.
You can find this UpCircleSeven Yoga Wheel on Amazon.


Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.
Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.
Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo


Kubernetes secrets are objects that store and manage sensitive data inside your Kubernetes cluster. One mistake developers often make is storing sensitive information like database passwords, API credentials, etc in a settings file in their codebase. This is very bad practice (hopefully for obvious reasons). Most developers know this, but still choose the option because it’s easy.
Fortunately, if you’re running your application in a Kubernetes cluster, managing that sensitive data the right way is easy. This guide will provide an overview to Kubernetes Secrets, including how to create, store, and use secrets in your applications.
Posted in these interests:
Creating secrets, like most Kubernetes operations, is accomplished using the kubectl command. Fortunately, there are a few ways to create secrets, and each are useful in different circumstances.
Let’s first look at the secret we want to create. Remember that the secret is an object that contains one or more pieces of sensitive data. For our example, let’s imagine we want to create a secret, called database, that contains our database credentials. It will be constructed like this:
database - username - password Suppose you have the following files: username and password. They might have been created like this:
echo -n 'databaseuser' > ./username echo -n '1234567890' > ./password We can use these files to construct our secret:
kubectl create secret generic database --from-file=./username --from-file=./password If you’d prefer, you can skip the files altogether and create the secret from string literals:
kubectl create secret generic database --from-literal=username=databaseuser --from-literal=password=databaseuser Both of the above examples will create identical secrets that look like this:
$ kubectl get secret database NAME TYPE DATA AGE database Opaque 2 1h And let’s example the secret:
$ kubectl describe secret database Name: database Namespace: default Labels: Annotations: Type: Opaque Data ==== username: 12 bytes password: 10 bytes While this is directly applicable, I’ll add this as a note because it could be useful. Sometimes we’ll need to copy secrets from one cluster or namespace to another. Here’s a quick example:
kubectl get secret database --context source_context --export -o yaml | kubectl apply --context destination_context -f - For an explanation and more details, see our guide on copying Kubernetes secrets from one cluster to another.
Secrets aren’t all that helpful until they’re attached to a pod. In order to actually use the secrets they must be configured in the pod definition.
There are two primary ways two use secrets: as files and as environment variables.
See the following pod config:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true volumes: - name: database-volume secret: secretName: database There are two important blocks to take note of. First, let’s look at the volumes block. We set the name of the volume and specify which secret we want to use. Note that this is set at the pod level, so it could be used in multiple containers if the pod were to define them.
volumes: - name: database-volume secret: secretName: database Next we’ll look at how the volume is mounted onto the container using volumeMounts. We’ll specify which volume we want to use, and set the mount path to /etc/secrets/database.
volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true Inside of the container, we can run an ls on /etc/secrets/database and find that both the username and password files exist.
Secrets can also be used inside of containers as environment variables. Check out the same config but with secrets attached as environment variables instead of volumes:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 env: - name: DATABASE_USERNAME valueFrom: secretKeyRef: name: database key: username - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: database key: password Both volumes and environment variables are perfectly acceptable ways to access secrets from inside your containers. The major difference is that environment variables can only hold a single value, while volumes can hold any number of files—even nested directories. So if your application requires access to many secrets, a volume is a better choice for organization and to keep the configs manageable.
I know some readers will not be using Python containers, but the purpose of this step is to provide a conceptual understanding of how secrets can be used from within the container.
Assuming you’ve followed the first two steps, you should now have a database secret that contains a username and password.
If we’ve mounted the secret as a volume, we can read the secret like this:
with open('/etc/secrets/database/password, 'r') as secret_file: database_password = secret_file.read() Grabbing the secret file is as easy reading from a file. Of course, you’d probably abstract this code and add error handling and defaults. After all, this is much more pleasant: get_secret('database/password').
This is even more straight forward, at least in Python. You can read the secret just as you would any other environment variable:
import os database_password = os.environ.get('DATABASE_PASSWORD')I hope this overview of Kubernetes secrets was helpful. By now, you should have a good understand of what Kubernetes secrets are and how to use them. If you have questions, please ask in the comments below or head over to the Kubernetes secrets documentation.


Kubernetes secrets are objects that store and manage sensitive data inside your Kubernetes cluster. One mistake developers often make is storing sensitive information like database passwords, API credentials, etc in a settings file in their codebase. This is very bad practice (hopefully for obvious reasons). Most developers know this, but still choose the option because it’s easy.
Fortunately, if you’re running your application in a Kubernetes cluster, managing that sensitive data the right way is easy. This guide will provide an overview to Kubernetes Secrets, including how to create, store, and use secrets in your applications.
Posted in these interests:
Creating secrets, like most Kubernetes operations, is accomplished using the kubectl command. Fortunately, there are a few ways to create secrets, and each are useful in different circumstances.
Let’s first look at the secret we want to create. Remember that the secret is an object that contains one or more pieces of sensitive data. For our example, let’s imagine we want to create a secret, called database, that contains our database credentials. It will be constructed like this:
database - username - password Suppose you have the following files: username and password. They might have been created like this:
echo -n 'databaseuser' > ./username echo -n '1234567890' > ./password We can use these files to construct our secret:
kubectl create secret generic database --from-file=./username --from-file=./password If you’d prefer, you can skip the files altogether and create the secret from string literals:
kubectl create secret generic database --from-literal=username=databaseuser --from-literal=password=databaseuser Both of the above examples will create identical secrets that look like this:
$ kubectl get secret database NAME TYPE DATA AGE database Opaque 2 1h And let’s example the secret:
$ kubectl describe secret database Name: database Namespace: default Labels: Annotations: Type: Opaque Data ==== username: 12 bytes password: 10 bytes While this is directly applicable, I’ll add this as a note because it could be useful. Sometimes we’ll need to copy secrets from one cluster or namespace to another. Here’s a quick example:
kubectl get secret database --context source_context --export -o yaml | kubectl apply --context destination_context -f - For an explanation and more details, see our guide on copying Kubernetes secrets from one cluster to another.
Secrets aren’t all that helpful until they’re attached to a pod. In order to actually use the secrets they must be configured in the pod definition.
There are two primary ways two use secrets: as files and as environment variables.
See the following pod config:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true volumes: - name: database-volume secret: secretName: database There are two important blocks to take note of. First, let’s look at the volumes block. We set the name of the volume and specify which secret we want to use. Note that this is set at the pod level, so it could be used in multiple containers if the pod were to define them.
volumes: - name: database-volume secret: secretName: database Next we’ll look at how the volume is mounted onto the container using volumeMounts. We’ll specify which volume we want to use, and set the mount path to /etc/secrets/database.
volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true Inside of the container, we can run an ls on /etc/secrets/database and find that both the username and password files exist.
Secrets can also be used inside of containers as environment variables. Check out the same config but with secrets attached as environment variables instead of volumes:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 env: - name: DATABASE_USERNAME valueFrom: secretKeyRef: name: database key: username - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: database key: password Both volumes and environment variables are perfectly acceptable ways to access secrets from inside your containers. The major difference is that environment variables can only hold a single value, while volumes can hold any number of files—even nested directories. So if your application requires access to many secrets, a volume is a better choice for organization and to keep the configs manageable.
I know some readers will not be using Python containers, but the purpose of this step is to provide a conceptual understanding of how secrets can be used from within the container.
Assuming you’ve followed the first two steps, you should now have a database secret that contains a username and password.
If we’ve mounted the secret as a volume, we can read the secret like this:
with open('/etc/secrets/database/password, 'r') as secret_file: database_password = secret_file.read() Grabbing the secret file is as easy reading from a file. Of course, you’d probably abstract this code and add error handling and defaults. After all, this is much more pleasant: get_secret('database/password').
This is even more straight forward, at least in Python. You can read the secret just as you would any other environment variable:
import os database_password = os.environ.get('DATABASE_PASSWORD')I hope this overview of Kubernetes secrets was helpful. By now, you should have a good understand of what Kubernetes secrets are and how to use them. If you have questions, please ask in the comments below or head over to the Kubernetes secrets documentation.


Kubernetes secrets are objects that store and manage sensitive data inside your Kubernetes cluster. One mistake developers often make is storing sensitive information like database passwords, API credentials, etc in a settings file in their codebase. This is very bad practice (hopefully for obvious reasons). Most developers know this, but still choose the option because it’s easy.
Fortunately, if you’re running your application in a Kubernetes cluster, managing that sensitive data the right way is easy. This guide will provide an overview to Kubernetes Secrets, including how to create, store, and use secrets in your applications.
Posted in these interests:
Creating secrets, like most Kubernetes operations, is accomplished using the kubectl command. Fortunately, there are a few ways to create secrets, and each are useful in different circumstances.
Let’s first look at the secret we want to create. Remember that the secret is an object that contains one or more pieces of sensitive data. For our example, let’s imagine we want to create a secret, called database, that contains our database credentials. It will be constructed like this:
database - username - password Suppose you have the following files: username and password. They might have been created like this:
echo -n 'databaseuser' > ./username echo -n '1234567890' > ./password We can use these files to construct our secret:
kubectl create secret generic database --from-file=./username --from-file=./password If you’d prefer, you can skip the files altogether and create the secret from string literals:
kubectl create secret generic database --from-literal=username=databaseuser --from-literal=password=databaseuser Both of the above examples will create identical secrets that look like this:
$ kubectl get secret database NAME TYPE DATA AGE database Opaque 2 1h And let’s example the secret:
$ kubectl describe secret database Name: database Namespace: default Labels: Annotations: Type: Opaque Data ==== username: 12 bytes password: 10 bytes While this is directly applicable, I’ll add this as a note because it could be useful. Sometimes we’ll need to copy secrets from one cluster or namespace to another. Here’s a quick example:
kubectl get secret database --context source_context --export -o yaml | kubectl apply --context destination_context -f - For an explanation and more details, see our guide on copying Kubernetes secrets from one cluster to another.
Secrets aren’t all that helpful until they’re attached to a pod. In order to actually use the secrets they must be configured in the pod definition.
There are two primary ways two use secrets: as files and as environment variables.
See the following pod config:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true volumes: - name: database-volume secret: secretName: database There are two important blocks to take note of. First, let’s look at the volumes block. We set the name of the volume and specify which secret we want to use. Note that this is set at the pod level, so it could be used in multiple containers if the pod were to define them.
volumes: - name: database-volume secret: secretName: database Next we’ll look at how the volume is mounted onto the container using volumeMounts. We’ll specify which volume we want to use, and set the mount path to /etc/secrets/database.
volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true Inside of the container, we can run an ls on /etc/secrets/database and find that both the username and password files exist.
Secrets can also be used inside of containers as environment variables. Check out the same config but with secrets attached as environment variables instead of volumes:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 env: - name: DATABASE_USERNAME valueFrom: secretKeyRef: name: database key: username - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: database key: password Both volumes and environment variables are perfectly acceptable ways to access secrets from inside your containers. The major difference is that environment variables can only hold a single value, while volumes can hold any number of files—even nested directories. So if your application requires access to many secrets, a volume is a better choice for organization and to keep the configs manageable.
I know some readers will not be using Python containers, but the purpose of this step is to provide a conceptual understanding of how secrets can be used from within the container.
Assuming you’ve followed the first two steps, you should now have a database secret that contains a username and password.
If we’ve mounted the secret as a volume, we can read the secret like this:
with open('/etc/secrets/database/password, 'r') as secret_file: database_password = secret_file.read() Grabbing the secret file is as easy reading from a file. Of course, you’d probably abstract this code and add error handling and defaults. After all, this is much more pleasant: get_secret('database/password').
This is even more straight forward, at least in Python. You can read the secret just as you would any other environment variable:
import os database_password = os.environ.get('DATABASE_PASSWORD')I hope this overview of Kubernetes secrets was helpful. By now, you should have a good understand of what Kubernetes secrets are and how to use them. If you have questions, please ask in the comments below or head over to the Kubernetes secrets documentation.


Kubernetes secrets are objects that store and manage sensitive data inside your Kubernetes cluster. One mistake developers often make is storing sensitive information like database passwords, API credentials, etc in a settings file in their codebase. This is very bad practice (hopefully for obvious reasons). Most developers know this, but still choose the option because it’s easy.
Fortunately, if you’re running your application in a Kubernetes cluster, managing that sensitive data the right way is easy. This guide will provide an overview to Kubernetes Secrets, including how to create, store, and use secrets in your applications.
Posted in these interests:
Posted in these interests:
Creating secrets, like most Kubernetes operations, is accomplished using the kubectl command. Fortunately, there are a few ways to create secrets, and each are useful in different circumstances.
Let’s first look at the secret we want to create. Remember that the secret is an object that contains one or more pieces of sensitive data. For our example, let’s imagine we want to create a secret, called database, that contains our database credentials. It will be constructed like this:
database - username - password Suppose you have the following files: username and password. They might have been created like this:
echo -n 'databaseuser' > ./username echo -n '1234567890' > ./password We can use these files to construct our secret:
kubectl create secret generic database --from-file=./username --from-file=./password If you’d prefer, you can skip the files altogether and create the secret from string literals:
kubectl create secret generic database --from-literal=username=databaseuser --from-literal=password=databaseuser Both of the above examples will create identical secrets that look like this:
$ kubectl get secret database NAME TYPE DATA AGE database Opaque 2 1h And let’s example the secret:
$ kubectl describe secret database Name: database Namespace: default Labels: Annotations: Type: Opaque Data ==== username: 12 bytes password: 10 bytes While this is directly applicable, I’ll add this as a note because it could be useful. Sometimes we’ll need to copy secrets from one cluster or namespace to another. Here’s a quick example:
kubectl get secret database --context source_context --export -o yaml | kubectl apply --context destination_context -f - For an explanation and more details, see our guide on copying Kubernetes secrets from one cluster to another.
Secrets aren’t all that helpful until they’re attached to a pod. In order to actually use the secrets they must be configured in the pod definition.
There are two primary ways two use secrets: as files and as environment variables.
See the following pod config:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true volumes: - name: database-volume secret: secretName: database There are two important blocks to take note of. First, let’s look at the volumes block. We set the name of the volume and specify which secret we want to use. Note that this is set at the pod level, so it could be used in multiple containers if the pod were to define them.
volumes: - name: database-volume secret: secretName: database Next we’ll look at how the volume is mounted onto the container using volumeMounts. We’ll specify which volume we want to use, and set the mount path to /etc/secrets/database.
volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true Inside of the container, we can run an ls on /etc/secrets/database and find that both the username and password files exist.
Secrets can also be used inside of containers as environment variables. Check out the same config but with secrets attached as environment variables instead of volumes:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 env: - name: DATABASE_USERNAME valueFrom: secretKeyRef: name: database key: username - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: database key: password Both volumes and environment variables are perfectly acceptable ways to access secrets from inside your containers. The major difference is that environment variables can only hold a single value, while volumes can hold any number of files—even nested directories. So if your application requires access to many secrets, a volume is a better choice for organization and to keep the configs manageable.
I know some readers will not be using Python containers, but the purpose of this step is to provide a conceptual understanding of how secrets can be used from within the container.
Assuming you’ve followed the first two steps, you should now have a database secret that contains a username and password.
If we’ve mounted the secret as a volume, we can read the secret like this:
with open('/etc/secrets/database/password, 'r') as secret_file: database_password = secret_file.read() Grabbing the secret file is as easy reading from a file. Of course, you’d probably abstract this code and add error handling and defaults. After all, this is much more pleasant: get_secret('database/password').
This is even more straight forward, at least in Python. You can read the secret just as you would any other environment variable:
import os database_password = os.environ.get('DATABASE_PASSWORD')I hope this overview of Kubernetes secrets was helpful. By now, you should have a good understand of what Kubernetes secrets are and how to use them. If you have questions, please ask in the comments below or head over to the Kubernetes secrets documentation.
Creating secrets, like most Kubernetes operations, is accomplished using the kubectl command. Fortunately, there are a few ways to create secrets, and each are useful in different circumstances.
Let’s first look at the secret we want to create. Remember that the secret is an object that contains one or more pieces of sensitive data. For our example, let’s imagine we want to create a secret, called database, that contains our database credentials. It will be constructed like this:
database - username - password Suppose you have the following files: username and password. They might have been created like this:
echo -n 'databaseuser' > ./username echo -n '1234567890' > ./password We can use these files to construct our secret:
kubectl create secret generic database --from-file=./username --from-file=./password If you’d prefer, you can skip the files altogether and create the secret from string literals:
kubectl create secret generic database --from-literal=username=databaseuser --from-literal=password=databaseuser Both of the above examples will create identical secrets that look like this:
$ kubectl get secret database NAME TYPE DATA AGE database Opaque 2 1h And let’s example the secret:
$ kubectl describe secret database Name: database Namespace: default Labels: Annotations: Type: Opaque Data ==== username: 12 bytes password: 10 bytes While this is directly applicable, I’ll add this as a note because it could be useful. Sometimes we’ll need to copy secrets from one cluster or namespace to another. Here’s a quick example:
kubectl get secret database --context source_context --export -o yaml | kubectl apply --context destination_context -f - For an explanation and more details, see our guide on copying Kubernetes secrets from one cluster to another.
Creating secrets, like most Kubernetes operations, is accomplished using the kubectl command. Fortunately, there are a few ways to create secrets, and each are useful in different circumstances.
Let’s first look at the secret we want to create. Remember that the secret is an object that contains one or more pieces of sensitive data. For our example, let’s imagine we want to create a secret, called database, that contains our database credentials. It will be constructed like this:
database - username - password Suppose you have the following files: username and password. They might have been created like this:
echo -n 'databaseuser' > ./username echo -n '1234567890' > ./password We can use these files to construct our secret:
kubectl create secret generic database --from-file=./username --from-file=./password If you’d prefer, you can skip the files altogether and create the secret from string literals:
kubectl create secret generic database --from-literal=username=databaseuser --from-literal=password=databaseuser Both of the above examples will create identical secrets that look like this:
$ kubectl get secret database NAME TYPE DATA AGE database Opaque 2 1h And let’s example the secret:
$ kubectl describe secret database Name: database Namespace: default Labels: Annotations: Type: Opaque Data ==== username: 12 bytes password: 10 bytes While this is directly applicable, I’ll add this as a note because it could be useful. Sometimes we’ll need to copy secrets from one cluster or namespace to another. Here’s a quick example:
kubectl get secret database --context source_context --export -o yaml | kubectl apply --context destination_context -f - For an explanation and more details, see our guide on copying Kubernetes secrets from one cluster to another.
Secrets aren’t all that helpful until they’re attached to a pod. In order to actually use the secrets they must be configured in the pod definition.
There are two primary ways two use secrets: as files and as environment variables.
See the following pod config:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true volumes: - name: database-volume secret: secretName: database There are two important blocks to take note of. First, let’s look at the volumes block. We set the name of the volume and specify which secret we want to use. Note that this is set at the pod level, so it could be used in multiple containers if the pod were to define them.
volumes: - name: database-volume secret: secretName: database Next we’ll look at how the volume is mounted onto the container using volumeMounts. We’ll specify which volume we want to use, and set the mount path to /etc/secrets/database.
volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true Inside of the container, we can run an ls on /etc/secrets/database and find that both the username and password files exist.
Secrets can also be used inside of containers as environment variables. Check out the same config but with secrets attached as environment variables instead of volumes:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 env: - name: DATABASE_USERNAME valueFrom: secretKeyRef: name: database key: username - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: database key: password Both volumes and environment variables are perfectly acceptable ways to access secrets from inside your containers. The major difference is that environment variables can only hold a single value, while volumes can hold any number of files—even nested directories. So if your application requires access to many secrets, a volume is a better choice for organization and to keep the configs manageable.
Secrets aren’t all that helpful until they’re attached to a pod. In order to actually use the secrets they must be configured in the pod definition.
There are two primary ways two use secrets: as files and as environment variables.
See the following pod config:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true volumes: - name: database-volume secret: secretName: database There are two important blocks to take note of. First, let’s look at the volumes block. We set the name of the volume and specify which secret we want to use. Note that this is set at the pod level, so it could be used in multiple containers if the pod were to define them.
volumes: - name: database-volume secret: secretName: database Next we’ll look at how the volume is mounted onto the container using volumeMounts. We’ll specify which volume we want to use, and set the mount path to /etc/secrets/database.
volumeMounts: - name: database-volume mountPath: "/etc/secrets/database" readOnly: true Inside of the container, we can run an ls on /etc/secrets/database and find that both the username and password files exist.
Secrets can also be used inside of containers as environment variables. Check out the same config but with secrets attached as environment variables instead of volumes:
apiVersion: v1 kind: Pod metadata: name: web spec: containers: - name: web image: web:1.0.0 env: - name: DATABASE_USERNAME valueFrom: secretKeyRef: name: database key: username - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: database key: password Both volumes and environment variables are perfectly acceptable ways to access secrets from inside your containers. The major difference is that environment variables can only hold a single value, while volumes can hold any number of files—even nested directories. So if your application requires access to many secrets, a volume is a better choice for organization and to keep the configs manageable.
I know some readers will not be using Python containers, but the purpose of this step is to provide a conceptual understanding of how secrets can be used from within the container.
Assuming you’ve followed the first two steps, you should now have a database secret that contains a username and password.
If we’ve mounted the secret as a volume, we can read the secret like this:
with open('/etc/secrets/database/password, 'r') as secret_file: database_password = secret_file.read() Grabbing the secret file is as easy reading from a file. Of course, you’d probably abstract this code and add error handling and defaults. After all, this is much more pleasant: get_secret('database/password').
This is even more straight forward, at least in Python. You can read the secret just as you would any other environment variable:
import os database_password = os.environ.get('DATABASE_PASSWORD')I know some readers will not be using Python containers, but the purpose of this step is to provide a conceptual understanding of how secrets can be used from within the container.
Assuming you’ve followed the first two steps, you should now have a database secret that contains a username and password.
If we’ve mounted the secret as a volume, we can read the secret like this:
with open('/etc/secrets/database/password, 'r') as secret_file: database_password = secret_file.read() Grabbing the secret file is as easy reading from a file. Of course, you’d probably abstract this code and add error handling and defaults. After all, this is much more pleasant: get_secret('database/password').
This is even more straight forward, at least in Python. You can read the secret just as you would any other environment variable:
import os database_password = os.environ.get('DATABASE_PASSWORD')I hope this overview of Kubernetes secrets was helpful. By now, you should have a good understand of what Kubernetes secrets are and how to use them. If you have questions, please ask in the comments below or head over to the Kubernetes secrets documentation.
I hope this overview of Kubernetes secrets was helpful. By now, you should have a good understand of what Kubernetes secrets are and how to use them. If you have questions, please ask in the comments below or head over to the Kubernetes secrets documentation.


Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.
Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.
Want to support Howchoo? When you buy a tool or material through one of our Amazon links, we earn a small commission as an Amazon Associate.
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo
We’re hiring. Write for Howchoo