<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8" -->

---
title: How to Manage Kubernetes Secrets with Terraform | daily.dev
description: Kubernetes Secrets provide a secure way to store sensitive information like passwords and API tokens, abstracting them from application code. This improves...
canonical: https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Manage Kubernetes Secrets with Terraform | daily.dev
og:description: Kubernetes Secrets provide a secure way to store sensitive information like passwords and API tokens, abstracting them from application code. This improves...
og:url: https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8
og:image: https://api.daily.dev/og/posts/xNtOu7Gx8.png
og:image:alt: How to Manage Kubernetes Secrets with Terraform
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Manage Kubernetes Secrets with Terraform

**[Spacelift](https://daily.dev/sources/spacelift)** · [@lonyless](https://daily.dev/lonyless) · 8 min read · 30 upvotes · 0 comments

## Summary

Kubernetes Secrets provide a secure way to store sensitive information like passwords and API tokens, abstracting them from application code. This improves security by avoiding hardcoding sensitive data. Terraform can manage these secrets in a centralized, declarative manner, offering features like secret rotation and integration with tools like Vault. However, the Terraform state file stores secrets in plain text, necessitating extra security measures. Combining Kubernetes and Terraform with tools like Spacelift can streamline workflows, improve security, and enable comprehensive infrastructure management.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://spacelift.io/blog/terraform-kubernetes-secret>

---

Tags: [#security](https://daily.dev/tags/security), [#devops](https://daily.dev/tags/devops), [#kubernetes](https://daily.dev/tags/kubernetes), [#terraform](https://daily.dev/tags/terraform), [#iac](https://daily.dev/tags/iac)

[View this post on daily.dev](https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Manage Kubernetes Secrets with Terraform","url":"https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8"},"datePublished":"2024-08-02T12:45:56.949Z","dateModified":"2024-10-05T19:00:16.885Z","description":"Kubernetes Secrets provide a secure way to store sensitive information like passwords and API tokens, abstracting them from application code. This improves...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5f7dd547eee18c08e68162cf0de87901?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/5f7dd547eee18c08e68162cf0de87901?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"Spacelift","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Victor Batista","url":"https://daily.dev/lonyless","image":"https://avatars.githubusercontent.com/u/48859696?v=4","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":2340}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-manage-kubernetes-secrets-with-terraform-xntou7gx8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":30},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,devops,kubernetes,terraform,iac","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Spacelift","item":"https://daily.dev/sources/spacelift"},{"@type":"ListItem","position":3,"name":"How to Manage Kubernetes Secrets with Terraform"}]}
```

