Coder Social home page Coder Social logo

rthangaraj / myakscluster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mathieu-benoit/myakscluster

0.0 0.0 0.0 544 KB

How to setup a secure Kubernetes cluster on Azure

Home Page: http://alwaysupalwayson.com/private-aks-and-acr/

Shell 33.45% HCL 66.55%

myakscluster's Introduction

Build Status

myakscluster

Here are blog articles related to this repository:

To properly setup and secure your AKS cluster, there is a couple of features and components to enable in order to properly setup your Security Posture, here is the list:

Basic - without cost:

  • Managed Identity #62
  • Azure Lock #21
  • kured #13
  • Disable K8S Dashboard #24
  • Network Policy with Calico #9
  • AAD #10
  • Azure Policy for AKS #11
  • Azure KeyVault for Azure pipelines #3

Advanced - with cost:

Complementary Azure services to leverage:

  • Azure Advisor for AKS
  • Azure Security Center for ACR
  • Azure Security Center for AKS

Architecture diagram

Provisioning

Prerequisites

  • Install Azure CLI
  • Install Terraform
    • Optional if you would like to leverage Terraform instead of Azure CLI.
  • Install Azure ConnectedK8s and KubernetesConfiguration CLI extensions
    • Optional if you would like to use Azure Arc enabled Kubernetes.

Configuration pre-provisioning

az login
#az account list -o table
#az account set -s <subscriptionId>

export LOCATION='canadacentral'
export NODES_COUNT=3
export NODE_SIZE='Standard_DS2_v2'
export ZONES=false

./run-pre-checks.sh

randomSuffix=$(shuf -i 1000-9999 -n 1)
export AKS=FIXME$randomSuffix
export K8S_VERSION=$(az aks get-versions \
  -l $LOCATION \
  --query "orchestrators[?isPreview==null].orchestratorVersion | [-1]" \
  -o tsv)

Provisioning Option 1: Azure CLI

cd cli
./create-aks-cluster.sh

FYI, current issues/workarounds with Azure CLI:

Provisioning Option 2: Terraform

cd tf
sudo terraform init
terraform plan \
  -var aks_name=$AKS \
  -var k8s_version=$K8S_VERSION \
  -var location=$LOCATION \
  -var aks_node_count=$NODES_COUNT \
  -var aks_node_size=$NODE_SIZE
terraform apply \
  -auto-approve \
  -var aks_name=$AKS \
  -var k8s_version=$K8S_VERSION \
  -var location=$LOCATION \
  -var aks_node_count=$NODES_COUNT \
  -var aks_node_size=$NODE_SIZE

Configuration post-provisioning

You need to connect to the Jumpbox VM via the Bastion host and run the commands below:

az login \
  --service-principal \
  -u FIXME \
  -p FIXME \
  --tenant-id FIXME
az aks get-credentials \
  -g $RG \
  -n $RG
./configure-aks-cluster.sh

Pricing estimation

  • AKS
    • $0.10 per cluster per hour.
  • Virtual Machines related to AKS worker nodes
    • Estimation: For 2 Node pools X 3 Standard_DS2_v2 Ubuntu worker nodes, ~ $xx USD/month
    • To decrease the cost: you may want to leverage Azure Reserved VMs Instances to reduce the cost of your AKS worker nodes
  • Managed Disks (related to the AKS's Nodes OS Disk)
    • Estimation: ~ $xx USD/month
  • Log Analytics Workspace (related to the Azure Monitor for Containers add-on)
  • Standard Load Balancer
    • Estimation: TODO
    • To decrease the cost: you may want to leverage Basic Load Balancer instead which is free but you won't be able to use Availability Zones nor VNET Peering features
  • Azure Firewall
    • Estimation: TODO
  • Public IP
    • Related to the SLB + FW
    • Estimation: TODO
  • Bandwidth (related to Availability Zones)
    • Estimation: TODO
    • Note: you may want to leverage PodAffinity to avoid cross-zones communications with Pods too chatty
  • Private Endpoint
    • Estimation: For 2 Private Endpoints (AKS + ACR)
  • Bastion - TODO

Other considerations:

Resources

myakscluster's People

Contributors

mathieu-benoit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.