Skip to content

Latest commit

 

History

History
95 lines (72 loc) · 3.5 KB

README.md

File metadata and controls

95 lines (72 loc) · 3.5 KB

Design document for the SWDT CLI

This document is a reference for the Wave (Windows Automated Virtual Environment) decisions regarding multi-OS support architecture. It is developed with Cobra/spf13 to conform to a stable namespace and different connection libraries to support remote command execution.

Follow the docs for more information.

Running

  1. make packer - Build the Windows QEMU2 image under packer/output/windows
  2. make start - Start both Minikube and Windows domain via Libvirt
  3. make setup - Install all binaries and required Kubernetes pieces in the Windows node
  4. make copy PROVISIONER="containerd" - Copy the provisioner to the running node and restart the sevice
  5. make destroy - Cleanup everything

Subcommands and namespace

These are the current supported subcommands for the program:

  • swdt start
    • Initialize the entire Cluster, the control plane is supported using Minikube, the Windows node is started by Libvirt.
  • swdt aux
    • Initialize the node auxiliary tools and procedures like enabling RDP, installing Choco and packages, etc.
  • swdt copy
    • Deploy Kubernetes binaries from the HTTP server indicated in the configuration.
  • swdt readiness

Configuration

The configuration API follows the GVK (GroupVersionKind) model from Kubernetes, using api-machinery for marshaling and unmarshalling, as well as defaulting values and validating its content. The goal of reusing this API is to enable sharing of the data structure not only with the CLI, but also with controllers and other projects in a well-known and agreed-upon format.

The project contains a Makefile with targets to generate the required API management and boilerplate functions

flowchart TD

    U(Admin) -->|writes CR| A(Kind: Config)
    A(Kind: Config) -->|parsed by| B(CLI / decoder)
    A(Kind: Config) -->|parsed by| C(Controller)

    B(CLI / decoder) -->|used by| D(business logic / pkg)
    C(Controller) -->|used by| D(business logic / pkg)
Loading

Fields and schema

These are the supported fields for configuring access node credentials, setting up options, and providing Kubernetes binaries information.

  • Credentials: support for SSH and WinRM settings
  • Setup: Define options for initial node bootstrap
  • Kubernetes: Auxiliary Kubernetes binaries installation

Following a configuration sample:

apiVersion: windows.k8s.io/v1alpha1
kind: Node
metadata:
  name: sample
spec:
  credentials:
    username: Administrator
    hostname: 192.168.122.220:22
    publicKey:
  setup:
    enableRDP: true
    chocoPackages:
      - vim
      - grep
  kubernetes:
    provisioners:
      - name: containerd:
        version: 1.7.11
        sourceURL: http://xyz/containerd.exe
        destination: c:\Program Files\containerd\bin\containerd.exe
        overwrite: true
      - name: kubelet
        version: 1.29.0
        sourceURL: http://xyz/kubelet.exe
        destination: c:\k\kubelet.exe
        overwrite: true

Connections

Currently, the project SSH for running commands remotely on the node. The common fields required are username and hostname. To proceed, ssh object content should be filled out with the proper connections parameters.

Testing

See experimental early guide for testers dedicated to try SWDT CLI on Windows host.