Skip to content

Instantly share code, notes, and snippets.

View richardcase's full-sized avatar

Richard Case richardcase

View GitHub Profile
@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:
@richardcase
richardcase / README.md
Last active February 6, 2024 09:50
Rancher Turtles: Create cluster via GitOps with cluster annotation

These steps assume that the previous test scenarios have been done.

  1. In Rancher Manager go to Continous Delivery
  2. Using the namespace drop down in the top bar select fleet-local
  3. Click Git Repos on the left navigation
  4. Click Add Repository button
  5. Fill in the following information:
  • Name: clusters
  • Repository URL: https://github.com/rancher-sandbox/rancher-turtles-fleet-example
  • Branch Name: per-cluster-import
@richardcase
richardcase / README.md
Last active February 6, 2024 10:18
Rancher Turtles: Create cluster via GitOps with namespace annotation

This assumes that that previous test steps have been executed. These instructions will be updated when annotating the namespaces works from the UI extension.

  1. Run the following command to annotate the default namespace for auto import
kubectl label namespace default cluster-api.cattle.io/rancher-auto-import=true
  1. In Rancher Manager go to Continous Delivery
  2. Using the namespace drop down in the top bar select fleet-local
  3. Click Git Repos on the left navigation
@richardcase
richardcase / README.md
Last active February 5, 2024 15:07
Rancher Turtles: Install latest UI extenion

Install Rancher Turtles UI Extension

  1. In the side bar click Extensions
  2. Click Enable
  3. On the Enable Extension Support popup select OK
  4. Wait for the Extensions screen to load, it should have the Installed, Available, Updates and All tabs
  5. Click the the "3 dots" button to the right and click Manage Repositories
  6. Click Create
  7. Enter the following:
  • Name: turtlesui