Designing Distributed Systems

I recently saw a Microsoft post on Twitter advertising this free e-book, so I gave it a go and it’s quite an interesting easy read. It’s only 160 pages, so good stuff for a few evenings. If you are interested in distributed systems..microservices..container and so on, you should read it.

You can download it here:

Designing Distributed Systems

This book gives you an introduction into some of the basic patterns you normally use in distributed systems. If you are like me, you probably will have used at least a few of them but might have not heard the correct “term” of it. That’s fine, I’m really bad it, it’s basically the reason I’m bad at those tech knowledge questions in interviews, where you have to explain pattern xy but you have no idea, until they explain it to you quick and you think, well I have used that for ages. That’s why I like technically discussions about actual work you did more than stupid questions.

Coming back to the book and its content. The book contains four parts:

Continue reading “Designing Distributed Systems”

Local Docker Images on Kubernetes – Docker for Windows

Failed to pull image “testapp:latest”: rpc error: code = Unknown desc = Error response from daemon: pull access denied for testapp, repository does not exist or may require ‘docker login’

Why??? It is there…

I just installed Docker for Windows + Kubernetes on my PC because I wanted to test some changes I made to the Kubernetes C# client, so I quickly created an easy .Net Core Console App and made an image with:

FROM microsoft/dotnet:2.1-sdk-alpine AS build 
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

FROM microsoft/dotnet:2.1-runtime-alpine AS runtime
WORKDIR /app
COPY --from=build /app/out ./
ENTRYPOINT ["dotnet", "TestApp.dll"]

Then I built it with:

docker build -t testapp .

Checked the images in docker:

Good, it is in my local image store. So I could run it now in Kubernetes with the Kube file I created:

apiVersion: batch/v1
kind: Job
metadata:
  name: testapp-job
  labels:
    app: testapp
spec:
 template:
   spec:
      containers:
      - name: testapp-job
        image: testapp:v1
      restartPolicy: Never

So I ran:

kubectl create -f .\Kube.yml

And checked the Kubernetes Dashboard:

Well it has nothing to do with the login or the repository. It’s more about the tag, it makes Kubernetes not look into your local store for some reason.

How do you fix this:

Just apply a different tag and use that. As simple as that.

Continue reading “Local Docker Images on Kubernetes – Docker for Windows”