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
kernel https://nke-dev.s3.us-west-2.amazonaws.com/22.04-69164c58/vmlinuz console=tty0 console=ttyS0,115200 ip=dhcp fb=false interface=ens5f0 url=https://releases.ubuntu.com/jammy/ubuntu-22.04.4-live-server-amd64.iso autoinstall ds=nocloud-net;s=${cloudinit-url} initrd=initrd.magic initrd https://nke-dev.s3.us-west-2.amazonaws.com/22.04-69164c58/initrd boot
#cloud-config
users:
- default
- name: nke-user
gecos: NKE User
sudo: ALL=(ALL) NOPASSWD:ALL
groups: root
lock_passwd: true
root@nke-sc-1:/usr/local/nke/bin# df -Th
Filesystem Type Size Used Avail Use% Mounted on
tmpfs tmpfs 101G 5.7M 101G 1% /run
/dev/mapper/ubuntu--vg-ubuntu--lv ext4 98G 19G 75G 20% /
tmpfs tmpfs 504G 0 504G 0% /dev/shm
tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/nvme2n1p2 ext4 2.0G 131M 1.7G 8% /boot
/dev/nvme2n1p1 vfat 1.1G 6.1M 1.1G 1% /boot/efi
tmpfs tmpfs 101G 4.0K 101G 1% /run/user/1000
tmpfs tmpfs 1008G 12K 1008G 1% /var/lib/kubelet/pods/35224ae1-6550-41d1-b281-947d9dcde52d/volumes/kubernetes.io~projected/kube-api-access-n84hw
diff --git a/api/src/api.rs b/api/src/api.rs
index 7f70fa10..e189c24c 100644
--- a/api/src/api.rs
+++ b/api/src/api.rs
@@ -163,30 +163,45 @@ impl Forge for Api {
.await
.map_err(CarbideError::from)?;
- let rpc::VpcSearchQuery { id, .. } = request.into_inner();
-
use log::LevelFilter;
use sqlx::prelude::*;
use carbide::db::network_segment::NetworkSegment;
#[sqlx::test(fixtures("network_segment_complete"))]
async fn test_update_network_segment_name(pool: sqlx::PgPool) -> sqlx::Result<()> {
pretty_env_logger::formatted_timed_builder()
.filter_level(LevelFilter::Error)
.init();
@j-griffith
j-griffith / main.rs
Last active August 9, 2022 18:41
Example PUT/GET of Secret to Vault API Using Reqwest
use reqwest::header::HeaderMap;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug)]
struct Secret {
data: HashMap<String, String>,
}
#[derive(Serialize, Deserialize)]
use reqwest::header;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
struct Secret {
key: String,
value: String,
}
#[tokio::main]
@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