kubernetes
Kubernetes: Mount a file in your Pod using a ConfigMap
·275 words·2 mins
kubernetes
azure
config map
volume
Lately I’ve been learning Go and this week I started a side project named kube-sherlock. The purpose of this small program is to list any pod that does not have the labels that your organization requires.
For kube-sherlock I created a dockerfile were both the program (kube-sherlock) and the default configuration (config.yaml) are placed in the app folder:
AKS: Configure TLS termination with the http application routing addon
·225 words·2 mins
kubernetes
azure
aks
nginx
ingress controller
When you install a AKS cluster you can configure it to deploy the http application routing addon or you you can update an existing cluster to deploy it.
Either way you end up with an NGINX Ingress Controller running, in the kube-system namespace of your cluster, with the following properties:
ingress-class: addon-http-application-routing annotations-prefix: nginx.ingress.kubernetes.io Does this means that you can use this controller for TLS termination? The answer is yes! And you can also use rate limits, and whitelisting as described in my post Secure your Kubernetes services with NGINX ingress controller, tls and more.
Develop and build ASP.NET Core applications to run on Kubernetes with Draft
·385 words·2 mins
dotnet
kubernetes
azure
aks
azure container registry
aspnetcore
You start developing an ASP.NET Core application to run it in Kubernetes and suddenly you find yourself creating a docker file, building an image, pushing the image to a registry, creating both a deployment and a service definition for Kubernetes and you wonder if there is a tool out there to help you streamline the whole process.
Deploying Elastic Search, Fluentd, Kibana on AKS with Helm
·117 words·1 min
kubernetes
azure
aks
elastic search
kibana
fluentd
For my recent talk at .NET Conf Madrid I managed to install Elastic Search, Fluentd and Kibana (EFK) as a logging solution for the AKS cluster I used in my demos.
The fact is that such deployment was possible thanks to Tim Park and his post Logging with Fluentd, ElasticSearch, and Kibana (EFK) on Kubernetes on Azure where I learned that to effectively deploy EFK on AKS I would have to tweak the resource definitions found in the Kubernetes project.
At last: Network Policies in AKS with kube-router
·433 words·3 mins
kubernetes
azure
network policies
For ages I’ve been waiting for a way to enforce netwok policies on AKS, so last weekend while I was googling around, I found this hidden gem posted by Marcus Robinson: Enforcing Network Policies using kube-router on AKS and had to test the proposed solution.
Prerequisites:
Azure Kubernetes Service (AKS) deployed with HTTP application routing enabled. kubectl installed Create a service exposed throuh your AKS DNS Zone # Let’s start by deploying the following service to your Kubernetes cluster, by saving the following content to a file named dni-function.yaml and replacing [YOUR_DNS__ZONE_NAME] with the corresponding value of your service:
Secure your Kubernetes services with NGINX ingress controller, tls and more.
·994 words·5 mins
kubernetes
azure
nginx
ingress conroller
Disclaimer: samples provided in this post were tested both in Azure Container Services (AKS) and Kubernetes provided by Docker for Windows.
In previous posts I showed you how to Run a Precompiled .NET Core Azure Function in a Container and how to Deploy your first Service to Azure Container Services (AKS).
By now you should be able to run your own services in Kubernetes and starting to wonder about how can you give answers to questions such as:
My kubectl Cheat Sheet
·195 words·1 min
kubernetes
cheat sheet
kubectl
This is a small kubectl Cheat Sheet with the list of commands and settings I use, almost on a daily basis, when working with kubernetes.
Get version and cluster information # Get kubectl version # kubectl --version Get cluster information # kubectl cluster-info Check cluster nodes # kubectl get nodes Get running services # kubectl get services -w --all-namespaces Context # List all available contexts # kubectl config get-contexts Get current context # kubectl config current-context Change the context # kubectl config use-context [context name] Deployment # Deploy # kubectl apply -f [yaml definition file] Get deployment definition # kubectl get deployment [deployment name] -o yaml Update the image of a deployment # kubectl set image deployment/[deployment name] [container name]=[image tag] Set autoscale for a deployment # kubectl autoscale deployment [deployment name] --min=2 --max=5 --cpu-percent=80 Delete a deployment # kubectl delete -f [yaml definition file] Get secret definition # kubectl get secret [secret name] -o yaml Force delete a pod # kubectl delete pod [pod name] --grace-period=0 --force Logs # Read a pod’s log # kubectl logs [pod name] -n [namespace name] Misc # Install kubernetes dashboard # kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml Hope it helps!
Deploy your first Service to Azure Container Services (AKS)
·550 words·3 mins
azure
kubernetes
docker
aks
In this post I’ll show you how to Deploy your first Service to Azure Container Services (AKS).
Prerequisites:
Azure CLI installed and basic knowledge experience. Docker installed and basic knowledge. Azure Subscription Kubernetes experience. Create a resource group: # Firt create a Resource Group. Be aware that at the time of writing AKS is not available in all Azure regions.