For this final project, you are required to build a lightweight container orchestrator called Minik8s. It must manage CRI-compatible containers across multiple hosts, supporting container lifecycle management, dynamic scaling, container-to-container networking, and automatic scaling. On top of these core capabilities, each team must implement an elective feature chosen from either (1) a MicroService framework or (2) a Serverless platform integration. You are encouraged, though not obliged, to leverage existing infrastructure such as etcd, ZooKeeper, or RabbitMQ, and to base your runtime on containerd; Docker is also acceptable if you prefer.
The assignment specifies only the functional specs; you may consult the lecture slides, follow Kubernetes-style patterns, or invent and extend designs entirely on your own.
Minik8s must provide a Pod abstraction.
- Users define and launch Pods through YAML. The manifest must support:
kind: object type ->Podname: Pod identifier- container image name and image tag
- container entry-point command and args
volume: shared volumesport: exposed network ports- resource requests (e.g., 1 CPU, 128 MB memory)
namespacelabels
- Built on this abstraction,
Minik8shandles the full Pod lifecycle: start and stopPodon user command. - Fault-tolerance: if any container in a
Podcrashes, Minik8s should automatically restart it. - Visibility: a single command lists every
Podwith at least:- Pod name
- status (and uptime if running)
- namespace
- labels
Minik8s must enable inter-Pod communication. We recommend adopting the Kubernetes model: implement the feature as a CNI plugin (e.g., Flannel; Weave is discouraged because it is no longer maintained). Required capabilities:
- Assign a unique internal IP to every
Podat creation time. - Allow
Pods to reach one another directly, within the same node or across nodes, using these IPs via the CNI plugin.
Based on CNI, Minik8s must provide a Service abstraction.
A Service acts as a front-end proxy that aggregates the network endpoints of a set of Pods and presents a single, stable virtual IP. Users reach the Service by this IP; Minik8s components then forward traffic to the appropriate Pods.
Mandatory Service types to support:
ClusterIP– cluster-internal access only.NodePort– additionally exposes theServiceon a static port of every node so that external clients can reach it.
Functional requirements:
- YAML creation – users create Services via YAML. The manifest must support:
kind:Servicetype:ClusterIPorNodePortname: Service identifierselector: label query to pick Podsports: –port: VIP port inside the cluster –targetPort: port the Pod actually listens on –nodePort: node-wide port (NodePorttype only)namespacelabels
- Traffic forwarding –
Minik8smust forward packets sent to the virtual IP to the selectedPods; implementation should leverage Linux IPVS or iptables. - Load balancing – When multiple
Pods match, traffic must be spread across them (random or round-robin). - Dynamic endpoints –
Pods that die are removed immediately; newly createdPods that match the selector are added automatically. - Deletion – a single user command deletes the
Serviceand all associated state. - Visibility –
minik8s get servicedisplays at least:Servicename- Virtual IP, port,
targetPort - Endpoints (real
PodIPs + ports) - namespace
- labels
Minik8s must support ReplicaSets for declarative Pod management.
A ReplicaSet uses label selectors to “own” a set of Pods and continuously reconciles reality to the user-defined replica count.
Required capabilities:
- YAML creation – users declare a ReplicaSet via YAML. Mandatory fields:
kind:ReplicaSetname:ReplicaSetidentifierselector: label query that picks managedPodsreplicas: desired number of identicalPodinstancesnamespacelabels
- Self-healing – if live
Pods exceed the desired count, theReplicaSetdeletes the excess; if too few exist, it creates new ones. - Deletion – a single command removes the
ReplicaSetand everyPodit owns. - Visibility –
minik8s get replicasetshows at least:ReplicaSetname- desired and current replica counts, expected output format: current counts / desired counts
- namespace
- labels
Beyond the fixed replica count of a ReplicaSet, Minik8s can also elastically scale Pods up and down through an Auto-Scaling ReplicaSet abstraction that reacts to real-time load.
Functional requirements:
- Resource monitoring:
Minik8smust periodically collect per-Podutilization metrics for at least two resource types, CPU (mandatory) plus one optional resource type (memory, memory bandwidth, I/O, network, etc.). We recommend reusing existing collectors, such as cadvisor. - YAML-driven configuration: Users declare autoscaling behavior in a manifest with the following fields.
kind:HorizontalPodAutoscalername: autoscaler identifiertargetWorkload: points to the scaled workload (Pod,ReplicaSet, orDeployment)minReplicas/maxReplicas: hard limits on replica count (max ≥ min)metrics: resource type + target value or utilization percentage (e.g., CPU 60 %, memory 500 Mi). At least two resource types should be supported by the system; a single manifest may specify one or both.
- Scaling policy: The autoscaler must implement the following features.
- When to scale (trigger conditions, cooldown windows)
- How fast to scale (step size & rate, e.g., “add one replica every 15 s”)
Minik8s must allow users to assign human-readable hostnames and sub-paths to any Service through a YAML manifest. Once configured:
- Clients inside the cluster can reach the
Serviceby domain name alone—no need to remember virtual IPs or ports. - The same parent domain can map multiple sub-paths to different Services
While the idea is inspired by Kubernetes Ingress, the exact schema and implementation are not required to mirror Ingress; you are free to define your own YAML format and routing logic as long as the two bullets above are satisfied.
Example: After a user creates Service1 and Service2, they are reachable at
Service1-IP: PortandService2-IP: Port, respectively. Next, the user creates aDNS-config object that:
- Declares the parent domain
example.com.- Maps sub-path
/path1-> Service1 and/path2-> Service2.From that moment on, both human users and
Pods inside the cluster can call:
example:80/path1(routed to Service1)example:80/path2(routed to Service2)The experience is equivalent to contacting the original
Service1-IP: PortandService2-IP: Port, but only the friendly domain name is ever exposed.
DNS Functional Requirements:
- Users can create a
DNSconfiguration object via YAML with the following fields:kind: object type ->DNSname: identifier of theDNSobjecthost: parent domain (e.g.,example.com)paths: list of sub-path rules; each rule contains:- the path prefix
- target Service name
- target Service port
namespacelabels
- A single command can delete the
DNSobject and clean up all associated state. - Once created, the configuration is visible cluster-wide: both end-users and
Pods can reachServices through the declared domain and sub-paths; multipleServices can share the same parent domain differentiated only by path. - Visibility:
minik8s get dnsdisplays at least:hostpathsnamespacelabels
Minik8s must orchestrate containers across at least three physical or virtual machines. The following capabilities are required:
Nodeabstraction:- Every machine is modeled as a
Node. - The control-plane
Nodestarts first and acts as the cluster entry point. - Additional worker
Nodes join by posting a YAML manifest (fields designed by yourself) to the control plane’s API endpoint, such as the API-Server in Kubernetes. minik8s get nodelists each Node’s name, role (control-plane / worker), and status (Ready / NotReady).
- Every machine is modeled as a
- Scheduler: When a
Podis created, the scheduler is consulted to decide whichNodewill control this newPod. You may implement:- A trivial policy (round-robin or random)
- A slightly smarter policy that respects resource requests.
- Even the simplest working scheduler earns > 80 % of this item’s credit.
- Location transparency: The
ServiceandDNSabstractions must hide thePods' physical location; clients reach thePodthrough theService’s stable virtual IP or domain name, regardless of which Node hosts it. - Cluster-wide
ReplicaSet&AutoScaling: BothReplicaSets and the Horizontal Pod Autoscaler should spread all replicas across the entire cluster.
Support Fault-Tolerance for Minik8s, the required functionalities are listed as follows:
- If the control plane crashes, every
Podalready running on worker nodes must stay up and healthy - After the ·Minik8s· control plane restarts, deployed
Pods,ReplicaSets,Services, andDNSobjects can be restored, and their status can be updated to the status before the crash. - There should be heartbeat communication between the
Minik8scontrol plane and data plane, so the control plane can detect whether a data planeNodeis alive; when a data planeNodecrash is detected, newPods should avoid being scheduled there until the Node recovers and rejoins the cluster.
In addition to the basic features, each team must implement at least one optional feature.
At the final demo, only one optional feature will be graded; if multiple are implemented, the team must choose which one to present.
Note: the optional feature is not extra credit. It is part of the 100-point total.
Extend Minik8s networking so that, at control-plane startup, users may choose a Service Mesh architecture instead of the classic Service model. This architecture gives fine-grained traffic control without changing application code, enabling MicroService operation (You can refer to the implementation of Istio). Concrete requirements are as follows:
-
Traffic hijack: adopt a
SideCarpattern: everyPod’s inbound/outbound traffic is intercepted by a proxySideCar. -
Service registry: expose a virtual IP for each
Service; external clients hit this Virtual IP, and the mesh forwards to the correctPod. -
Automated service discovery: the
Service Meshmust automatically detect every deployedServiceandPod, notify the network proxy inside eachPod, and ensure hijacked traffic is routed correctly; when aPod’s IP changes, the registry updates itself and the sidecar proxies reconfigure so the service remains reachable (users can access it and services can call each other). -
Use
SideCars to deliver advanced traffic-control features:- Rolling upgrade: via a custom CLI, instruct the mesh to shift traffic gracefully so a
Servicecan be upgradedPod-by-Podwith zero downtime. - Canary release: expose a custom API where users declare rules that split traffic for the same
Serviceacross differentPods; rules must support both percentage-based weights and regex matches on HTTP headers or URLs.
- Rolling upgrade: via a custom CLI, instruct the mesh to shift traffic gracefully so a
-
Adopt or build a non-trivial
MicroServiceapplication that:-
Solves a realistic problem (e.g., the image-processing pipeline shown below); trivial arithmetic or “Hello World” is not acceptable.
-
Incorporates model-based workloads—small models for image processing, text generation, classification, etc.; large models are not required.
-
Deploy the application on
Minik8sand use it to demonstrate theMicroServicefeatures above; in the final report, briefly explain why aMicroServicearchitecture is necessary and advantageous for this scenario. -
Example codebases may be drawn from GitHub - delimitrou/DeathStarBench: Open-source benchmark suite for cloud microservices , or GitHub - kubeshark/sock-shop-demo: Sock Shop example with additions
-
A working implementation of the basic functionality earns full base marks; extra credit is available for richer complexity and practical utility.
We recommend finding suitable models from HuggingFace , such as https://huggingface.co/openai-community/gpt2,https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0
-
Build a Serverless platform on top of Minik8s that:
- Executes user code at function granularity
- Scales to zero when idle and automatically scales up on demand
- Supports function chaining and communication between functions in a chain
You are encouraged to study existing open-source platforms such as Knative or OpenFaaS for design guidance. Detailed requirements are as follows:
-
Support
Functionabstraction. Users define a function in a single file (either source code or a zip archive), upload it toMinik8swith a CLI command, and invoke it through anHTTP triggerand anevent trigger.- Functions must support Python at a minimum.
- The layout of the function, the format of its return value, and the syntax of the update/invoke commands may be defined by the implementation.
- Invocation methods: expose the function via HTTP requests and allow it to be bound to events. Users specify the event source through a command; event types may include cron schedules, file modifications, or any custom source.
-
Support the
ServerlessWorkflow abstraction: users can define a serverless DAG that contains the following elements:- Function chain: invoke the first function with arguments, then call each subsequent function in sequence, using the output of the previous function as the input to the next, and return the final result.
- Conditional branch: the control plane decides which branch to execute next based on the output of the preceding function.
- Serverless Workflows are declared in a configuration file; follow AWS Step Functions or Knative, or invent your own programming model—any approach that satisfies the above behavior is acceptable.
-
Serverless autoscaling with scale-to-zero
- Instances are created on the first incoming request (cold start) and deleted after a prolonged idle period (scale-to-zero). The platform must also monitor request volume and automatically scale out to >1 instance when traffic rises.
- The implementation must gracefully handle tens of concurrent requests; demonstrate this with wrk2 or JMeter during the presentation.
-
Find or build a non-trivial
Serverlessapplication that:-
Solves a realistic problem (e.g., the image-processing pipeline shown below); trivial arithmetic or “Hello World” is not acceptable.
-
Uses model-based workloads—small models for image processing, text generation, classification, etc.; large models are not required.
-
Deploy the application on Minik8s and use it to demonstrate serverless features; in the final report, briefly explain why a serverless architecture is necessary and advantageous for this scenario.
-
A sample reference is the Alexa skill in ServerlessBench/Testcase4-Application-breakdown/alexa at master · SJTU-IPADS/ServerlessBench .
-
A working implementation of the basic functionality earns full base marks; extra credit is available for richer complexity and practical utility.
We recommend finding suitable models from HuggingFace , such as https://huggingface.co/openai-community/gpt2,https://huggingface.co/stabilityai/stable-diffusion-xl-refiner-1.0
-
Minik8s must provide persistent storage (refer to the Persistent Volumes documentation). When a Pod (e.g., running a database like MySQL) crashes or is deleted, its application data must survive and be mountable by any replacement Pod. Required capabilities are as follows:
- PV / PVC abstractions: Implement both
PersistentVolume(PV) and PersistentVolumeClaim (PVC) and clearly reflect their different roles and use-cases. - Support two provisioning modes
- Static: cluster admin pre-creates PVs.
- Dynamic:
Minik8screates a suitable PV automatically when a PVC is submitted.
- Support at least two PV types
hostPath(simple, single-node only).- At least one type that can be accessed from multiple nodes (See item 5).
- Support Basic PV/PVC life-cycle A
Podobtains storage via a PVC. Deleting thePodreleases the PVC-to-PV bond but retains the data. A newPodthat rebinds the same PVC (or an equivalent one) must see the previous data. Data becomes inaccessible only when the PV itself is deleted. - Multi-node persistent storage (demo required) Show that
Pods scheduled on different nodes, one after another, can successfully bind to and read/write the same PV.- Hint: deploy a dedicated storage node and export volumes through NFS (or similar).
- A plain single-node NFS setup is acceptable, but scores lower; more sophisticated, fault-tolerant storage back-ends are encouraged and will receive higher marks.
The course will grant access to the “Jiao Wo Suan” super-computing platform, which uses Slurm for job scheduling (guide: https://docs.hpc.sjtu.edu.cn/job/slurm.html). Requirements are as follows:
Minik8sallows users to write GPU programs (e.g., CUDA) and handle submission to “Jiao Wo Suan” for compilation and execution.- Users supply only the CUDA source and a build script, and submit this job to
Minik8susing a YAML configuration file. An internalMinik8sservice uploads the code to the platform, runs it, and returns results to the user. - Jobs must be isolated: different job names trigger different service processes when submitted to Slurm. (Hint: mimic a Kubernetes Job to package the GPU code in a
Podthat contains the submission service.) - The YAML carries the usual fields (name, kind, …) plus Slurm-aligned job parameters; exact fields are left to the implementation.
- Implement at least matrix multiplication and matrix addition in CUDA, exploiting hardware concurrency. During the presentation, explain how you use the CUDA parallelism.
- Basic CUDA earns full base marks; richer concurrency or more sophisticated CUDA code yields bonus points.
Minik8s must implement Security Context (see official Security Context documentation: “Set the security context for a Pod”) to configure container privileges and reduce unnecessary access. Requirements are as follows:
Pod-wide Security Context (same for every container in thePod)runAsUser: set UID for all container processes. If this field is omitted, UID = 0 (root).- Demo for presentation:
pson the host must show the process UID equal torunAsUser.
- Demo for presentation:
runAsGroup: set GID for all container processes. If this field is omitted, GID =0 (root).- Demo for presentation: every container in the
Podshows the same GID, matchingrunAsGroup.
- Demo for presentation: every container in the
fsGroup: set GID for all files created in volumes mounted by thePod.- Demo:
ls -lon a newly created file inside the volume shows thefsGroupGID.
- Demo:
- Per-Container Security Context (overrides
Pod-wide values)- Must support at least
runAsUser,runAsGroup, andfsGroup. - Demo for presentation: settings apply only to the target container; other containers remain unchanged.
- Demo for presentation: per-container values take precedence over Pod-wide values.
- Must support at least
- Bonus – implement a
supplementalGroupsPolicyequivalent (see official documentation Supplemental Groups Control , a related example is provided in Security Context documentation: "Configure fine-grained SupplementalGroups control for a Pod" part) supporting both Merge and Strict policies.
Correct implementation of items 1–2 earns full base marks; item 3 yields bonus points.
This lab is highly open-ended: the implementation language and approach are not prescribed (though following Kubernetes patterns is strongly recommended). Assessment is mainly through a final presentation that verifies functionality, performance, and reliability.
- Group Assignments: Required features are split into group and individual tasks. Each team divides the group assignments internally and presents together; the team receives a collective score adjusted by individual contribution.
- Individual Assignments: Every member must implement one personal feature. Each student presents this feature alone and is graded separately.
The lab is completed in multiple iterations, each followed by a checkpoint presentation: one mid-term and one final.
- Mid-term Presentation (not graded) – let TAs review your progress and give feedback. After this presentation, you must submit a short report summarising the current status.
- Final Presentation (graded) – you must implement and clearly demonstrate every required feature.
- Grading breakdown:
- Functional requirements & representation performance: 80%
- Engineering quality: 20%
- Zero tolerance for plagiarism – any detected duplication (vs. current or past submissions) earns 0 marks for everyone involved!
- 3-person teams, self-organized; elect one team leader.
- Clear internal division of labor: – At kickoff, list per-iteration tasks and owner names. – Mid-term Presentation must show what was actually finished, who did it, and whether the schedule is on track; adjust next-iteration plans as needed.
- The final report must state each member’s percentage contribution.
- Open-source workflow: – Every feature lives in its own Git branch; merge only via pull request .
- CI/CD: – PRs must pass automated tests before merging; commits on the main branch auto-deploy. – Any CI/CD stack is allowed (Travis, Jenkins, GitHub Actions, GitLab CI, etc.).
- Best Practice examples:
- JavaScript Project Best Practice: https://github.com/elsewhencode/project-guidelines
- Go Project Layout: https://github.com/golang-standards/project-layout
