---
# System prepended metadata

title: Designing an API for multi OS clusters

---

# Designing an API for multi OS clusters

You are the owner of "BlueBirdNetes" a Kubernetes copy cat startup that
is attempting to heavily simplify the K8s API to work on multiple OSs with
minimal feature drift.

You can use the internet for this assignment, for example you might want to copy and paste some golang snippets for things like starting a simple HTTP server or starting a gofunc.

- You dont need to worry about impl details such as using the k8s client or anything like that.  
- External APIs can be used without proper imports as long as their commented, but they shouldnt be required for this. 
- Using the internet to look at the apiserver API or the Kubelet client implementation is totally OK, but you might be overthinking it .  Just follow your instincts, think about what the kubelet does, and what the APIServer in K8s does, and mock out the behaviour in a way that makes sense, to you. 
- This is not a quiz on your ability to write a perfect API, or your knowledge of K8s internals, in anyway, but just an assesment of your ability to mock out a system.
- https://unofficial-kubernetes.readthedocs.io/en/latest/concepts/cluster-administration/master-node-communication/
- 

So here goes, basically were going to try to write a server and a client, where the kubelet is the client and the server is your APIServer.  Your APIServer will have to recieve requests for stuff, and Your kubelet will have to "watch" the apiserver and act on requests.  You can implement the watch on the client OR server side, whatever you want.

# Goal: Build an APIServer simulator
- APIServer can "create Pod", "delete Pod"
- APIServer can "create Service", "delete Service"
- "Pods" are processes that  have "labels" which are key:value pairs


# 

al: Build a Kubelet simulator
- The Kubelet watches the APIServer, and
- Runs new pods
- Kills old pods
- Adds "routes" from services to pods (assume there are reasonable network abstractions, linux or windows is fine)



your code:

apiserver.go
```


```

kubelet.go
```

```
