Skip to content

Instantly share code, notes, and snippets.

View richardcase's full-sized avatar

Richard Case richardcase

View GitHub Profile
/*
Copyright 2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
labels:
ccm: external
csi: external
name: "richtest2"
spec:
clusterNetwork:
pods:
## template: jinja
#cloud-config
runcmd:
- echo 'Running on {{ v1.cloud_name }}' > /var/tmp/cloud_name
@richardcase
richardcase / configuration.nix
Created February 10, 2024 10:47
NixOs - Start
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@richardcase
richardcase / main.go
Created February 9, 2024 06:27
SSH Client
package main
import (
"fmt"
"io/ioutil"
"log"
"net"
"os"
"time"
@richardcase
richardcase / README.md
Created February 6, 2024 10:48
Rancher Turtles: Destroy child/workload cluster
  1. In Rancher Manager got to Continuos Delivery
  2. Click Git Repos from the left navigation
  3. Change the namespace to fleet-local using the dropdown on the top bar
  4. Click the "3 dots" on the line for clusters
  5. Select Delete from the menu
  6. Click Delete button
  7. Wait until the following returns no clusters found:
kubectl get clusters.cluster.x-k8s.io
@richardcase
richardcase / README.md
Last active February 6, 2024 10:44
Rancher Turtles: Remove a cluster from Rancher Manager

Also called un-importing

  1. In Rancher Manager go to Cluster Management
  2. Tick the box next to cluster1-capi
  3. Click the Delete button
  4. Type cluster1-capi in the text box
  5. Click the Delete button
  6. Run the following command to check that the CAPI cluster hasn't been deleted:
@richardcase
richardcase / README.md
Created February 6, 2024 10:35
Rancher Turtles: Scale existing imported cluster using GitOps

These steps assume you have followed the steps to import a cluster

  1. Open the samples repo (or your own fork): https://github.com/rancher-sandbox/rancher-turtles-fleet-example/tree/main
  2. Got to the clusters folder
  3. Edit cluster1.yaml:
  • Find the MachineDeployment
  • Change Replicas from 1 to 2
  1. Commit the change
  2. In Rancher Manager go to Cluster Management
  3. Explore cluster1-capi
@richardcase
richardcase / README.md
Last active April 5, 2024 08:30
Rancher Turtles: Setup Rancher Manager using kind
  1. Create a file called kind-cluster-with-extramounts.yaml with the following contents
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
name: rancher-manager
nodes:
- role: control-plane
  image: kindest/node:v1.26.3
 extraMounts:
@richardcase
richardcase / README.md
Last active April 5, 2024 08:33
Rancher Turtles: Installation of backend

This assumes you have a Rancher Manage v2.8.0 cluster running in kind with the docker socket shared (see this).

  1. Create a new file called feature.yaml with this content:
apiVersion: management.cattle.io/v3
kind: Feature
metadata:
  name: embedded-cluster-api
spec: