Coder Social home page Coder Social logo

mathieu-benoit / myakscluster Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 10.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%
devops k8s kubernetes azure aks kured azure-monitor security cloud-security terraform azure-cli acr gitops devsecops

myakscluster's Issues

(Beta) Helm 3

Standard Load Balancer

Some gotchas:

  • The load-balancer-sku property can only be used when your cluster is created. You cannot change the load balancer SKU after an AKS cluster has been created. Also, you can only use one type of load balancer SKU in a single cluster.
  • If you want to use your own public IPs, use the load-balancer-outbound-ips, or load-balancer-outbound-ip-prefixes parameters. Both of these parameters can also be used when updating the cluster.
  • VNET Peering is now possible with SLB, it was not with Basic Load Balancer
  • SLB is required for Availability Zones #33

(Preview) Pod Security Policy

AAD integration

Availability Zones

Use --network-policy in az aks create to leverage Calico

Use IP whitelisting for the Kubernetes API

Prerequisities:

  • Only with Standard Load Balancer
  • Implementation with kubenet CNI otherwise with Azure CNI route table will have to be created manually like explained in the doc
  • Min Azure CLI version: 2.0.76

Multiple Node Pools

Learnings and Gotchas:

  • First Node Pool at cluster creation is Linux
  • We can't delete the first Node Pool
  • HTTP application routing add-on can't be used
  • Linux node pools the length must be between 1-12 characters, for Windows node pools the length must be between 1-6 characters
  • Maximum of eight node pools
  • Maximum of 400 nodes across those 8 node pools
  • All node pools must reside in the same subnet (Azure/azure-cli#10984)
  • Must use virtual machine scale sets for the nodes
  • When upgrading a cluster the new nodes will get the taints
  • When you scale a node pool in AKS, taints and tolerations do not carry over by design (Azure/AKS#1061)

Taints and tolerations are used to logically isolate resources with a hard cut-off - if the pod doesn't tolerate a node's taint, it isn't scheduled on the node. An alternate approach is to use node selectors. You label nodes, such as to indicate locally attached SSD storage or a large amount of memory, and then define in the pod specification a node selector. Kubernetes then schedules those pods on a matching node. Unlike tolerations, pods without a matching node selector can be scheduled on labeled nodes. This behavior allows unused resources on the nodes to consume, but gives priority to pods that define the matching node selector.

Managed Identity

Leveraging Managed Identity with AKS instead of Service Principal is more secure for 2 main reasons:

  • There is not anymore the credentials file stored on any AKS nodes (/host/etc/kubernetes/azure.json)
  • MI will wrap and managed the credentials (auto-rotate, when expired, etc.) for you

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.