Skip to content

Instantly share code, notes, and snippets.

View daxmc99's full-sized avatar

Dax McDonald daxmc99

View GitHub Profile
apiVersion: v1
kind: ConfigMap
metadata:
annotations:
linkerd.io/created-by: linkerd/cli stable-2.6.1
labels:
linkerd.io/control-plane-component: prometheus
linkerd.io/control-plane-ns: linkerd
name: linkerd-prometheus-config
namespace: linkerd
@daxmc99
daxmc99 / docker-for-mac.md
Last active November 4, 2019 20:06 — forked from BretFisher/docker-for-mac.md
Getting a Shell in the Docker for Mac Moby VM

2018 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Moby VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@daxmc99
daxmc99 / rioStart.sh
Last active January 24, 2020 01:10
rioStart.sh
#!/bin/bash
#set -x
#set -e
name='rio'
k3d delete --name=$name
k3d create -n $name --image rancher/k3s:v1.0.0 --publish 80:80 --publish 443:443 --publish 9443:9443 --publish 9080:9080 \
--server-arg --no-deploy=traefik
declare -i i; i=0
until k3d get-kubeconfig --name='rio'
do
@daxmc99
daxmc99 / k3dStart.sh
Created September 16, 2019 23:05
k3d local development script
#!/bin/bash
#set -x
#set -e
k3d delete --name='k3s-default'
k3d create --workers 1 --image rancher/k3s:v0.8.1 &&
declare -i i; i=0
until k3d get-kubeconfig --name='k3s-default'
do
if (( i > 20 )); then
break
@daxmc99
daxmc99 / dropdown.md
Created August 15, 2019 23:16 — forked from citrusui/dropdown.md
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@daxmc99
daxmc99 / rancher2customnodecmd.sh
Created July 11, 2019 21:32 — forked from superseb/rancher2customnodecmd.sh
Add custom node to Rancher 2.0 (from v2.0.0-alpha26 and up)
#!/bin/bash
docker run -d -p 80:80 -p 443:443 --name rancher-server rancher/rancher:latest
while ! curl -k https://localhost/ping; do sleep 3; done
# Login
LOGINRESPONSE=`curl -s 'https://127.0.0.1/v3-public/localProviders/local?action=login' -H 'content-type: application/json' --data-binary '{"username":"admin","password":"admin"}' --insecure`
LOGINTOKEN=`echo $LOGINRESPONSE | jq -r .token`
# Change password
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS - Node Group'
Parameters:
KeyName:
Description: The EC2 Key Pair to allow SSH access to the instances
Type: AWS::EC2::KeyPair::KeyName
@daxmc99
daxmc99 / rancher2_embedded_etcd_query.md
Created June 14, 2019 17:53 — forked from superseb/rancher2_embedded_etcd_query.md
Rancher 2 single install embedded etcd query

Rancher 2 single install embedded etcd query

Option 1: run etcd image matching the embedded version and re-use container network to use etcdctl

docker run -e ETCDCTL_API=3 --net=container:$(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') quay.io/coreos/etcd:v$(docker exec $(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') curl -s http://localhost:2379/version | docker run -i oildex/jq:1.6 jq -r .etcdserver) etcdctl get / --prefix --keys-only

Option 2: use curl to talk to the embedded etcd and decode using jq

@daxmc99
daxmc99 / Install cert-manager v8 into Rancher.md
Last active June 6, 2019 18:09
Install cert-manger version 8 on Rancher 2.2.x with Catalog
  1. Add https://charts.jetstack.io to global catalogs
  2. Enter into the system project
  3. Install cert-manager v8 into the 'kube-system' namespace.

If webhook pod fails to deploy after several minutes you may need to uninstall and reinstall

This guide also depends on the chart having NO relative urls. You may need to repackage the chart with --url if this is the case.

@daxmc99
daxmc99 / dockerForMacETCD.sh
Created June 3, 2019 20:07
Access etcd on docker for mac
docker exec -it <$ etcd container id> sh
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2379 --key=/run/config/pki/etcd/peer.key --cert=/run/config/pki/etcd/peer.crt --cacert=/run/config/pki/etcd/ca.crt get / --prefix --keys-only