Your personalized experience awaits

Fill out this form and an expert will reach out to schedule time to talk.

After briefly getting acquainted, we’ll show you how Faros AI helps:

  • Boost velocity, quality and efficiency in developer workflows
  • Maximize AI’s impact on productivity
  • Improve delivery and resource allocation
Want to learn more about Faros AI?
An illustration of a lighthouse in the sea

Thank you!

A Faros AI expert will reach out to schedule a time to talk.
P.S. If you don't see it within one business day, please check your spam folder.
Oops! Something went wrong while submitting the form.

Secure Kubernetes Deployments: Architecture and Setup

Learn how to achieve secure Kubernetes deployments using a lightweight deployment agent inside your private network. Discover secrets management, Helm templating, and CI/CD integration for enterprise-grade security.

Oleg Gusak
Oleg Gusak
Multi-colored shipping containers representing Kubernetes
5
min read
Browse Chapters
Share
July 2, 2025

How to achieve secure Kubernetes deployments in the enterprise environment

Kubernetes has become the de facto compute platform for running and managing microservices at scale. However, as with any powerful system, secure deployment to Kubernetes clusters—especially in enterprise environments—presents a number of non-trivial challenges.

In this article, we’ll walk through the architecture and implementation of a secure deployment solution that avoids the complexity of traditional agent-based approaches and ensures that secrets and cluster access are properly protected.

The challenge of secure Kubernetes deployments

At its core, Kubernetes deployments involve interacting with the Kubernetes API server. In cloud environments, that API server typically resides inside a private network—exactly where it should be from a security perspective. Public access to the Kubernetes API is a security risk and must be avoided in enterprise setups.

This introduces a primary challenge: How do we deploy services to Kubernetes clusters when we cannot access the Kubernetes API from outside the private network?

Furthermore, deploying applications to Kubernetes often involves Helm charts, which require several configuration parameters. Many of these parameters are secrets—API keys, credentials, tokens—that should never be committed to source control or exposed in plain text.

That’s our second challenge: How do we securely populate secrets into Helm chart values?

Existing solutions: Too much overhead

There are several tools available today that attempt to enable secure Kubernetes deployments:

  • HCP Terraform agents: These agents run inside the private network and allow HCP Terraform (hosted on the public internet) to deploy resources securely. While effective, these agents require complex setup and ongoing maintenance. They also need outbound internet access and introduce additional moving parts.
  • GitOps tools like Argo CD: Argo CD can be deployed inside the cluster to perform Helm-based deployments. However, it requires its own management lifecycle, plug-ins for secret management, and integration with source control. Helm secrets are usually stored in external Kubernetes secret objects, requiring chart customization or complex overlays.

These approaches work but often introduce operational burdens, brittle configurations, and unnecessary complexity, particularly for smaller teams or simpler use cases.

Novel solution: A lightweight deployment agent for secure Kubernetes deployments

To overcome these challenges, my team developed a lightweight, secure deployment mechanism built around a containerized script we call the deployment agent

Here’s how it works: 

  1. It runs inside the private network. 
  2. Secrets are managed via cloud provider secret stores.
  3. Deployment recipes as code.
  4. A secure trigger from the CI/CD pipeline.

Below is an architecture diagram of the secure Kubernetes deployment solution: 

Architecture Diagram: Secure Kubernetes Deployment

Let’s go through a secure Kubernetes deployment step by step. 

1. The deployment agent runs inside the private network

The deployment agent runs as a containerized job inside the same private network as the Kubernetes cluster. This ensures that access to the Kubernetes API server is secure and local—no need to expose it to the internet.

2. Secrets managed via cloud provider secret stores

Managing secrets securely is critical for production-grade Kubernetes deployments. In our architecture, secrets are never hardcoded or stored in source control. Instead, we leverage native secret management services provided by the cloud provider:

These secrets are created and maintained using Terraform, which ensures that access policies and secret lifecycles are fully defined as code. The deployment agent uses its associated IAM role or Azure service principal to authenticate and retrieve the secrets securely at runtime.

To simplify secret integration with Helm, we use a placeholder system in our values.yaml files. Rather than embedding raw secret values, we define them as templated references. For example:

database:

  password: {{ az:kv:db-password }}

  username: my-app-user

Here’s how this system works:

  • az indicates the cloud provider (Azure in this case)
  • kv refers to the backing secret service (Key Vault)
  • db-password is the key within that secret store

The deployment agent parses the values.yaml file before deployment. When it encounters a placeholder like {{ az:kv:db-password }}, it queries the designated secret store, fetches the secret value using the configured credentials, and replaces the placeholder in-memory. The final rendered values.yaml—with real values substituted—is passed to Helm for deployment.

This process ensures that:

  • Secrets never appear in source control
  • Helm charts remain reusable and cloud-agnostic
  • All secret access is audit-logged and controlled via IAM policies

This flexible and secure templating mechanism lets us use standard Helm workflows without customizing upstream charts to explicitly reference Kubernetes Secret objects. It keeps secrets external, dynamic, and decoupled from chart logic.

3. Deployment recipes as code

Deployment logic is abstracted into simple YAML-based deployment scenarios. Each scenario defines:

  • The target Helm chart (stored in a private OCI registry)
  • Parameters to apply (secrets and config)
  • Target namespace and release name

This makes deployments repeatable, declarative, and version-controlled.

4. Secure trigger from the CI/CD pipeline

The agent is triggered by an external CI/CD system, which is authenticated via a limited-permission identity. Depending on the environment, the setup looks like this:

AWS Deployment:

  • A CI/CD process running in a separate AWS account
  • An IAM role with permissions only to launch the deployment agent in the target account

Azure Deployment:

  • A GitHub Actions workflow authenticated via OIDC-based Azure service principal
  • The service principal can only launch the container job in the target Azure subscription

This separation of concerns ensures that the CI/CD pipeline doesn’t have direct access to the Kubernetes API, secrets are never exposed outside the private network, and deployment actions are scoped and auditable.

Benefits of the deployment agent architecture

There are multiple benefits to this secure Kubernetes deployment architecture: 

  • Enhanced security: By restricting API access, securely managing secrets with cloud providers, and employing granular permissions, we significantly reduce the attack surface.
  • Operational simplicity: No long-lived agents or complex GitOps tooling. The lightweight nature of the deployment agent and the use of "deployment recipes" reduce the complexity often associated with agents and external tools.
  • Cloud-native secret integration: Uses existing cloud infrastructure for secret management.
  • Flexible: Supports AWS, Azure, and other cloud providers.
  • Faster, More Reliable Deployments: Automation through the CI/CD pipeline and predefined scenarios ensures consistent and repeatable deployments.

A solution for enterprise Kubernetes deployment challenges

Kubernetes provides powerful orchestration capabilities, but deploying to it securely requires thoughtful design. By placing a minimal deployment agent inside the private network, integrating with native secret stores, and tightly controlling CI/CD roles, we’ve built a solution that balances security, simplicity, and scalability.

This architecture has proven effective in real-world deployments and can be adapted to fit a variety of organizational setups. If you're looking for a secure and manageable way to deploy to Kubernetes without exposing your cluster or secrets, this approach may be the right fit.

We'd love to answer any questions you have. If you'd like to learn more, be sure to reach out.

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

Block quote

Ordered list

  1. Item 1
  2. Item 2
  3. Item 3

Unordered list

  • Item A
  • Item B
  • Item C

Text link

Bold text

Emphasis

Superscript

Subscript

Contact us
Tell us what you want to achieve with Faros AI and we’ll show you how.
Want to learn more about Faros AI?
An illustration of a lighthouse in the sea

Thank you!

You will get an email soon. Feel free to download Faros AI Community Edition.
Oops! Something went wrong while submitting the form.

More articles for you

Editor's Pick
Guides
DevProd
20
MIN READ

The Engineering Productivity Handbook: How to tailor your initiative to your goals, operating model and culture

What to measure and why it matters. How to collect and normalize productivity data. And the key to operationalizing metrics that drive impact.
February 25, 2025
Editor's Pick
Guides
7
MIN READ

All you need to know about the DORA metrics, and how to measure them

All you need to know about the DORA metrics, and how to measure them. | Faros.ai
November 6, 2024
Editor's Pick
Guides
AI
5
MIN READ

GitHub Copilot Best Practices for Optimizing Impact

Maximize your return with a complete guide to GitHub Copilot best practices.
October 22, 2024