All Projects → kizotheitguy → Azure-AKS-ApplicationGateway-WAF

kizotheitguy / Azure-AKS-ApplicationGateway-WAF

Licence: other
No description or website provided.

Projects that are alternatives of or similar to Azure-AKS-ApplicationGateway-WAF

aks-terraform-helm
Showcase for Azure, AKS, Terraform, Helm and Let's Encrypt
Stars: ✭ 23 (+43.75%)
Mutual labels:  ingress, aks, aks-kubernetes-cluster
unicorn
Content for the "Intelligent Cloud Bootcamp: Advanced Kubernetes" workshop
Stars: ✭ 28 (+75%)
Mutual labels:  ingress, aks, aks-kubernetes-cluster
kubernetes the easy way
Automating Kubernetes the hard way with Vagrant and scripts
Stars: ✭ 22 (+37.5%)
Mutual labels:  cluster, kubernetes-cluster, k8s-cluster
k8s-lemp
LEMP stack in a Kubernetes cluster
Stars: ✭ 74 (+362.5%)
Mutual labels:  cluster, waf, kubernetes-cluster
roxy-wi
Web interface for managing Haproxy, Nginx, Apache and Keepalived servers
Stars: ✭ 1,109 (+6831.25%)
Mutual labels:  waf, loadbalancer
moosefs-csi
Container Storage Interface (CSI) for MooseFS
Stars: ✭ 44 (+175%)
Mutual labels:  cluster, kubernetes-cluster
kubectl-node-restart
Krew plugin to restart Kubernetes Nodes sequentially and gracefully
Stars: ✭ 73 (+356.25%)
Mutual labels:  cluster, kubernetes-cluster
aks-multi-tenant-agic
This sample shows how to use the Application Gateway Ingress Controller in a multi-tenant AKS cluster to expose multiple instances of the same application, one for each tenant.
Stars: ✭ 27 (+68.75%)
Mutual labels:  application-gateway, aks
terraform-azurerm-kubernetes
Terraform module to deploy a Kubernetes cluster on Azure, using AKS.
Stars: ✭ 16 (+0%)
Mutual labels:  kubernetes-cluster, aks
multi-master-kubernetes
Multi-master Kubernetes cluster on Exoscale
Stars: ✭ 65 (+306.25%)
Mutual labels:  kubernetes-cluster, k8s-cluster
loadbalancer-controller
Kubernetes loadbalancer controller to provision ingress controller dynamically
Stars: ✭ 93 (+481.25%)
Mutual labels:  ingress, loadbalancer
aksctl
An easy to use CLI for AKS cluster
Stars: ✭ 46 (+187.5%)
Mutual labels:  kubernetes-cluster, aks-kubernetes-cluster
k8s-istio-demo
Demo showing the capabilities of Istio
Stars: ✭ 22 (+37.5%)
Mutual labels:  cluster, kubernetes-cluster
GPU-Kubernetes-Guide
How to setup a production-grade Kubernetes GPU cluster on Paperspace in 10 minutes for $10
Stars: ✭ 34 (+112.5%)
Mutual labels:  kubernetes-cluster, k8s-cluster
k8s-actions
Enable GitHub developers to deploy to Kubernetes service using GitHub Actions
Stars: ✭ 104 (+550%)
Mutual labels:  kubernetes-cluster, aks
vamp2setup
Vamp Lamia Alpha Setup Guide
Stars: ✭ 33 (+106.25%)
Mutual labels:  gateway, kubernetes-cluster
inspr
Inspr is an agnostic application mesh for simpler, faster, and securer development of distributed applications (dApps).
Stars: ✭ 49 (+206.25%)
Mutual labels:  cluster, kubernetes-cluster
rbac-tool
Rapid7 | insightCloudSec | Kubernetes RBAC Power Toys - Visualize, Analyze, Generate & Query
Stars: ✭ 546 (+3312.5%)
Mutual labels:  cluster, k8s-cluster
kube-watch
Simple tool to get webhooks on Kubernetes cluster events
Stars: ✭ 21 (+31.25%)
Mutual labels:  cluster, kubernetes-cluster
terraform-vultr-condor
Kubernetes Deployment Tool for Vultr
Stars: ✭ 60 (+275%)
Mutual labels:  kubernetes-cluster, k8s-cluster

Azure-AKS-ApplicationGateway-WAF

This documentation explains how you can configure your kubernetes cluster behind Application Gateway and Web Application Firewall on Azure Portal.

You can also checkout the YouTube video for visual explanation.

You would have had an understanding of configuring a LoadBalancer, WAF, AppGateway and Provisioning Kubernetes cluster I will use the Azure Vote application which can be found on the Azure documentation website for AKS as the example which is pretty straight forward. https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-prepare-app

Steps:

Enabling AKS preview for your Azure subscription

az provider register -n Microsoft.ContainerService 

Create a resource group

az group create --name myResourceGroup --location westeurope 

Create AKS cluster

az aks create --resource-group myResourceGroup --name myAKSCluster --node-count 1 --generate-ssh-keys 

Connect to the cluster

az aks install-cli 
az aks get-credentials --resource-group myResourceGroup --name myAKSCluster 
kubectl get nodes 

External L4 LoadBalancer

Download the Azure Vote YAML file (azure-vote-all-in-one-redis.yaml) from

https://github.com/Azure-Samples/azure-voting-app-redis 

Use the kubectl create command to run the application.

kubectl create -f azure-vote-all-in-one-redis.yaml 

You can now browse to the external IP address to see the Azure Vote App

Internal L4 LoadBalancer:

To do this, I will be adding the following annotations to the service based on cloud provider to the azure-vote-all-in-one-redis.yaml file

[...] metadata: name: my-service annotations: service.beta.kubernetes.io/azure-load-balancer-internal: "true" [...]

The "azure-vote-front" service config in the azure-vote-all-in-one-redis.yaml file will then look like this:

--- 
apiVersion: v1 
kind: Service 
metadata: 
  name: azure-vote-front 
  annotations: 
      service.beta.kubernetes.io/azure-load-balancer-internal: "true" 
spec: 
  type: LoadBalancer 
  ports: 
  - port: 80 
  selector: 
    app: azure-vote-front 

If you run the get service command; it will look like this

alt text

The resources in the resource group will now look like this alt text

Exposing the App through the Application Gateway & Web Application Firewall

There are 2 methods I will describe here to achieve the picture below: alt text

Different VNET

Create the AppGateway/WAF

Create the Gateway new or different Resource group and VNET

alt text

alt text

Add the IP Address of the LoadBalancer as the backend IP of my pre-configured AppGatway/WAF.

Then peer the VNET of the cluster resource group and the AppGateway resource group.

alt text

Peer from K8s Cluster VNET to the AppGateway VNET

alt text

Peer from K8s Cluster VNET to the AppGateway VNET

alt text

You can now browse to the external IP address of the Application Gateway to see the Azure Vote App

alt text

Same VNET

Create the AppGateway/WAF

Create the Subnet in the VNET of the K8s Cluster

alt text

alt text

Create the AppGateway/WAF in the same resource group of the cluster and use the same VNET

alt text

alt text

You can now browse to the external IP address of the Application Gateway to see the Azure Vote App

alt text

Ingress

Another use case can be to have the loadbalancer to route traffic to more apps in different services endpoint running in the same cluster. In this case, we'll use the Ingress service to manage the traffic routing for the cluster ingress traffic and proxying it to the right endpoints.

Ingress can provide load balancing, SSL termination and name-based virtual hosting.

Please visit the kubernetes documentation to learn more on setting up an Ingress Controller

DeployIngress.yaml for a single Service Ingress

--- 
apiVersion: extensions/v1beta1  
kind: Ingress  
metadata:  
  name: nginx-ingress  
spec:  
  backend:   
  serviceName: nginx  
  ServicePort: 80  

For multiple endpoints, the file will look like this 

DeployIngress.yaml 
--- 
apiVersion: extensions/v1beta1 
kind: Ingress 
metadata: 
  name: test 
  annotations: 
    ingress.kubernetes.io/rewrite-target: / 
spec: 
  rules: 
  - host: foo.bar.com 
    http: 
      paths: 
      - path: /foo 
        backend: 
          serviceName: s1 
          servicePort: 80 
      - path: /bar 
        backend: 
          serviceName: s2 
          servicePort: 80 
  
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].