Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.22 KB

File metadata and controls

61 lines (41 loc) · 1.22 KB

secure-docker-image-build-calico

secure Docker image build project using Calico and Terraform

Kubernetes Network Policies with Calico and Terraform

Overview

This project demonstrates how to implement Kubernetes network policies using Calico and Terraform. It includes:

  • A Kubernetes cluster provisioned via Terraform
  • Calico as the CNI plugin
  • Network policies for:
    • Denying all traffic by default
    • Allowing frontend-to-backend communication
    • Isolating namespaces

Prerequisites

  • Terraform
  • kubectl
  • AWS CLI (for EKS)
  • An AWS account

Project Structure

image

Steps

  1. Provision the Kubernetes Cluster
    terraform init
    terraform apply
    
  2. Set Up Calico
    ./scripts/setup-calico.sh
    
  3. Deploy Applications
    kubectl apply -f k8s/deployments/frontend.yaml
    kubectl apply -f k8s/deployments/backend.yaml
    
  4. Apply Network Policies
    kubectl apply -f k8s/network-policies/
    
    

Features

Deny all traffic by default. Enable frontend-to-backend communication. Isolate namespaces for enhanced security.

Cleanup

To destroy resources:

terraform destroy