Skip to main content

Posts

Showing posts with the label Linux

Error running script in docker container

I’m working on getting an Azure DevOps build agent running in a docker container. An error I got while trying to get this done was the following: exec ./start.sh: no such file or directory Here is the corresponding (simplified) docker file: Nothing special... Where is the fault? The problem turns out to be the start.sh file itself. I originally created it using Notepad what resulted in Windows-style line endings(CRLF).  Instead this should be Linux-style line endings(LF). There are multiple tools out there that supports this (like Notepad++) but you can also do this through VSCode. At the bottom of the editor you can find the currently used line endings style. If you click on it you can change it:

Running a Blazor WebAssembly app on Azure App Service for Linux

I hope this blog post becomes irrelevant in the future, we'll see. I was trying today to deploy a Blazor WebAssembly app on Linux. Although I was able to succesfully deploy the Blazor WebAssembly app through my Azure DevOps pipeline, the application didn't want to run???? After a lot of trial and error, I found the following information in the documentation : Blazor WebAssembly apps can be deployed to Azure App Services on Windows, which hosts the app on IIS . Deploying a standalone Blazor WebAssembly app to Azure App Service for Linux isn't currently supported. We recommend hosting a standalone Blazor WebAssembly app using Azure Static Web Apps , which supports this scenario. Whoopsy! I could have thought about this sooner, because when I tried to Publish the application through Visual Studio(right click on the Project –> Publish) only the Azure App Service(Windows) option was shown:

Kubernetes–Schedule a pod on a Linux node–Part 2

Yesterday I blogged about the usage of the “kubernetes.io/os” nodeselector to schedule a pod specifically on a windows or linux node pool. Today I want to share another way through the usage of taints and tolerations. This Kubernetes feature allows users to mark a node (taint the node) so that no pods can be scheduled to it, unless a pod has a toleration that indicates it will accept this taint. Using this Kubernetes feature we can create nodes that are reserved (dedicated) for specific pods.  Using this, we can pick one OS and taint all the nodes with this OS, so that any pods that do not specify toleration will use the non-tainted nodes. This Taint effectively allows us to specify a default OS for the cluster, and if you want to use the other OS, you need to state this explicitly. To enable this, we first need to taint our Windows nodes. We would run this command for each Windows node: kubectl taint nodes <nodeName> OS=Windows:NoSchedule After this is applied it...

Kubernetes–Schedule a pod on a Linux node–Part 1

On our Kubernetes(AKS) cluster we have multiple node pools some with Linux nodes and some with Windows nodes: But what if you want to schedule specific workloads on Linux or Windows nodes? The easiest way to control this is through the OS node selector. The OS node selector(“kubernetes.io/os”) is a built-in selector which indicates the OS that the node is running. We can use this selector to ensure that the pod is only deployed to nodes with the right OS. Here is an example for Windows pods: And here is in example for Linux pods: Unfortunately you don’t always have direct control on the pod specification(e.g. when you are using a 3th party Helm chart). In that case we have to take a different approach. But that is for another blog post tomorrow…

Install .NET Core 3.1 SDK on Ubuntu 18.04 inside WSL

I’m a big fan of WSL ( Windows Subsystem for Linux ) to test my .NET Core applications on Linux. Recently I tried to install the .NET Core 3.1 SDK on my Ubuntu distribution inside WSL: bawu@ORD02476:~$ sudo apt-get install dotnet-sdk-3.1 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dotnet-sdk-3.1 E: Couldn't find any package by glob 'dotnet-sdk-3.1' E: Couldn't find any package by regex 'dotnet-sdk-3.1' This didn’t seem to work. He couldn’t find the .NET Core 3.1 SDK inside the package manager. I first tried to refresh the packages list: bawu@ORD02476:~$ sudo apt update 0% [Connecting to archive.ubuntu.com] [Connecting to security.ubuntu.com] Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelea...