Skip to content

Instantly share code, notes, and snippets.

View displague's full-sized avatar
🐝
Mergin' 🎶 on a Sunday afternoon 🎶

Marques Johansson displague

🐝
Mergin' 🎶 on a Sunday afternoon 🎶
View GitHub Profile
@displague
displague / tfacc.sh
Last active August 16, 2023 15:54
delete tfacc packet devices and projects
#!/usr/bin/env bash
CMD=metal
# METAL_ORGANIZATION_ID=(the one you want to clean), otherwise defaults to metal cli settings)
$CMD project get | \
awk '/\s*(tfacc|GHACTION|ansible)/ {print $2}' | \
while read proj; do
$CMD devices get -p $proj | \
awk '/tfacc|ansible|GHACTION/ {print $2}' | \
xargs -n1 $CMD device delete -f --id ;
$CMD project delete -f --id $proj ;
#cloud-config
phone_home:
url: "http://tinkerbell.ewr1.packet.net/phone-home"
post:
- instance_id
tries: 5
autoinstall:
version: 1
# use interactive-sections to avoid an automatic reboot
#interactive-sections:
#!ipxe
dhcp net0
set release 4.7
set zstream 0
set arch x86_64
set ignition-url https://metadata.platformequinix.com/userdata
#set coreos-url https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/${release}/${release}.${zstream}
diff --git a/protos/hardware/hardware.proto b/protos/hardware/hardware.proto
index 3601801..3ac88c0 100644
--- a/protos/hardware/hardware.proto
+++ b/protos/hardware/hardware.proto
@@ -6,36 +6,58 @@ package github.com.tinkerbell.tink.protos.hardware;
import "google/api/annotations.proto";
+// The HardwareService services provides access to data describing the compute
+// and networking profiles of the hardware available to accept workflows.

Kubernetes

  • Rancher
  • Kubernetes API 1.17.5

Nodes

  • 3x Packet c3.small.x86

Benchmark

  • kubestone 0.5.0

Install

import packet
import json
import os
from pathlib import Path
label="marques@MacBook-Pro.hsd1.nj.comcast.net"
manager = packet.Manager(auth_token=os.environ["APIKEY"])
#manager.get_ssh_key("4405413a-8da6-4e56-9c4f-07e532d7a024").delete()
keys = manager.list_ssh_keys()
@displague
displague / 0-packet-provider.yaml
Last active July 8, 2020 16:20
crossplane-provider-packet example
apiVersion: packet.crossplane.io/v1alpha2
kind: Provider
metadata:
name: packet-provider
spec:
credentialsSecretRef:
key: key
name: packet-creds
namespace: packet-test
projectID: b12cc31b-170c-4986-bb55-2489f7c22a88

Stack Dependency

Stacks may depend on access to other custom resources in the API. These dependencies are provided in the dependsOn field of the Stack spec.

Each dependency results in an RBAC Rule authorizing the service account used by the Stack controller to access the resources defined in the Stack.

The following Stack body would result in the Stack's controller running under a

// crdsFromStack fetches the CRDs of the Stack using the shared parent labels
// TODO(displague) change this to use GET on each, the CRDs may not be ready
func (h *stackHandler) crdsFromStack(ctx context.Context) ([]apiextensions.CustomResourceDefinition, error) {
results := []apiextensions.CustomResourceDefinition{}
// TODO(displague) list CRDs by chained field selector, use apigroup+kind,
// not labels.
// Fetch CRDs because h.ext.Spec.CRDs doesn't have plural names
//labelSelector := client.MatchingLabels(map[string]string{