Skip to content

Instantly share code, notes, and snippets.

View j-griffith's full-sized avatar

John Griffith j-griffith

  • Bozeman, Montana
View GitHub Profile
@j-griffith
j-griffith / k3s-dev-env.md
Created May 27, 2022 18:22
Basic local k3s setup with Multipass, k3sup, metallb and nginx

Using Multipass VMs and K3s for Nucleus Development Env

Assumes multipass is installed and configured, Multipass can be installed on Linux, Mac and Windows. If using Linux, It's highly recommended to configure Multipass to use KVM/Libvirt.

Multipass

Create a could-init file with user settings:

#!/bin/bash
# Work around dumb ENV var for AWS config settings that are only good in current session
# Messed with env var init tricks, but at the end of the day, just much easier to write
# a proper credentials file out, then it's good for all sessions
# alias `awslogin="aws-login <account> <user> && update-aws-creds.sh"`
cat >~/.aws/credentials <<EOF
[default]
aws_access_key_id=$AWS_ACCESS_KEY_ID
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
version: "1.21"
name: <CLUSTER_NAME>
region: us-west-2
availabilityZones: [us-west-2a, us-west-2b, us-west-2c]
iam:
withOIDC: true
vpc:
#!/bin/bash
VERSION="release-5.0"
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$VERSION/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$VERSION/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$VERSION/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$VERSION/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$VERSION/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
hgc "github.com/mittwald/go-helm-client"
"helm.sh/helm/v3/pkg/repo"
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.1
creationTimestamp: null
name: nuclei.omniverse.nvidia.io
spec:
group: omniverse.nvidia.io
names:
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: nvcloud-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
---
# Simple nginx ingress example
# Test using `curl -kL http://<elb>/apple`
kind: Pod
apiVersion: v1
metadata:
name: apple-app
labels:
app: apple
spec:
Kind: "ClusterRole",
},
ObjectMeta: metav1.ObjectMeta{
Name: "kubevirt.io:admin",
Labels: map[string]string{
virtv1.AppLabel: "",
"rbac.authorization.k8s.io/aggregate-to-admin": "true",
},
},
Rules: []rbacv1.PolicyRule{
type Node struct {
// Role indicates details for the type of node specified (controlPlane, Worker, Bootstrap, LoadBalancer etc)
Role string `yaml:"Type"`
// CPUCount specifies the number of virtual CPUs to assign to the specified node type (must satsify template requirements)
// +optional
CPUCount int `yaml:"CPUCount"`
// DiskSizeGB specifies the size of the root disk for the specified node type (must satsify template requirements)
// +optional
DiskSizeGB int `yaml:"DiskSizeGB"`
// MemSizeGB specifies the amount of memory in GB for the specified node type (must satsify template requirements)