Skip to content

Add k3s VmWith#1

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/add-k3s-vm
Draft

Add k3s VmWith#1
Copilot wants to merge 4 commits intomainfrom
copilot/add-k3s-vm

Conversation

Copy link

Copilot AI commented Feb 8, 2026

Adds k3s (lightweight Kubernetes) support to freestyle VMs.

Implementation

VmK3s builder

  • Installs k3s via official installer script with systemd oneshot service
  • Configurable version and server arguments
  • Readiness check waits for cluster availability

VmK3sInstance runtime

  • kubectl(args) - Execute kubectl commands
  • applyManifest(manifest) - Apply YAML manifests using heredoc (prevents shell injection)
  • deleteResource(type, name, namespace) - Delete resources
  • getResources<T>(type, namespace) - Get typed JSON resources
  • getKubeconfig() - Access cluster config
  • getClusterInfo() / getNodes() - Cluster introspection

Usage

import { freestyle, VmSpec } from "freestyle-sandboxes";
import { VmK3s } from "@freestyle-sh/with-k3s";

const { vm } = await freestyle.vms.create({
  spec: new VmSpec({
    with: { k3s: new VmK3s() }
  })
});

await vm.k3s.applyManifest(`
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: nginx
  spec:
    replicas: 2
    ...
`);

const pods = await vm.k3s.getResources("pods", "default");

Package includes basic and advanced examples demonstrating namespace management, multi-resource deployments, and service creation.

Original prompt

Can you add a k3s VmWith


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits February 8, 2026 03:42
Co-authored-by: JacobZwang <59858341+JacobZwang@users.noreply.github.com>
Co-authored-by: JacobZwang <59858341+JacobZwang@users.noreply.github.com>
Co-authored-by: JacobZwang <59858341+JacobZwang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add k3s VM with necessary configurations Add k3s VmWith Feb 8, 2026
Copilot AI requested a review from JacobZwang February 8, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants