Skip to content

Instantly share code, notes, and snippets.

@jwsy
jwsy / Dockerfile
Created April 1, 2022 05:44
jade-shooter Dockerfile
FROM nginxinc/nginx-unprivileged
EXPOSE 8080
COPY index.html /usr/share/nginx/html
COPY scenes /usr/share/nginx/html/scenes
COPY sprites /usr/share/nginx/html/sprites
apiVersion: apps/v1
kind: Deployment
metadata:
name: jade-shooter
labels:
app: jade-shooter
spec:
replicas: 1
selector:
matchLabels:
@jwsy
jwsy / install_rancher.sh
Last active December 21, 2021 10:02
Script to install rancher on your macOS machine
#!/bin/bash -x
date
### 0. Install helm, kubectl (kubernetes-cli), and k3d with brew
brew install helm k3d kubectl
### 1. Create a cluster with k3d that connects port 443 to the loadbalancer provided by k3d
# Optionally install with more agents `--agents 3`
k3d cluster create k3d-rancher \
--api-port 6550 \
@jwsy
jwsy / k3d_rancher.ps1
Last active August 27, 2021 04:07
Script
# Default env vars
$env:CLUSTER_NAME="k3d-rancher"
$env:RANCHER_SERVER_HOSTNAME="rancher.localhost"
$env:KUBECONFIG_FILE="${env:CLUSTER_NAME}.yaml"
date
# Get kubectl and helm
choco list --local-only
choco install kubernetes-cli -y
choco install kubernetes-helm -y
@jwsy
jwsy / Dockerfile
Created October 27, 2020 12:34
Dockerfile updated, add a script to show how to run sweethoney on files local to the host (vs. within the docker guest container)
FROM ubuntu
LABEL maintainer="Matthew Schwartz @schwartz1375"
USER root
ENV DEBIAN_FRONTEND=noninteractive
#RUN DEBIAN_FRONTEND=noninteractive \
RUN apt-get -y update && apt-get -y \
@jwsy
jwsy / k3d_rancher.sh
Created August 5, 2020 02:53
Create a k8s cluster and install Rancher with k3d and Helm
#!/bin/bash -x
### 1. Create a cluster with k3d that connects port 443 to the loadbalancer provided by k3d
k3d cluster create k3d-rancher --api-port 6550 --servers 1 --agents 3 --port 443:443@loadbalancer --wait
k3d cluster list
### 2. Set up a kubeconfig so you can use kubectl in your current session
KUBECONFIG_FILE=~/.kube/k3d-rancher
k3d kubeconfig get k3d-rancher > $KUBECONFIG_FILE
export KUBECONFIG=$KUBECONFIG_FILE
@jwsy
jwsy / machine.js
Created May 30, 2020 00:12
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'SWAPI',
initial: 'idle',
context: {
user: null
},
states: {
idle: {
on: {
FETCH: 'loading'
@jwsy
jwsy / rancher install log.log
Last active February 5, 2020 11:24
rancher install log
PS C:\Users\jyee> helm repo add rancher-stable https://releases.rancher.com/server-charts/stable
"rancher-stable" has been added to your repositories
PS C:\Users\jyee> helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "rancher-stable" chart repository
...Successfully got an update from the "jetstack" chart repository
Update Complete. ⎈ Happy Helming!⎈
PS C:\Users\jyee> kubectl create namespace cattle-system
namespace/cattle-system created
PS C:\Users\jyee> helm install rancher rancher-stable/rancher --namespace cattle-system --set hostname=rancher.localdev
@jwsy
jwsy / cert-manager install.log
Created February 3, 2020 03:50
cert-manager install
PS C:\Users\jyee> kubectl create namespace cert-manager
namespace/cert-manager created
PS C:\Users\jyee> kubectl apply --validate=false -f https://raw.githubusercontent.com/jetstack/cert-manager/release-0.12/deploy/manifests/00-crds.yaml
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io created
customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io created
@jwsy
jwsy / helm install.log
Created February 3, 2020 03:43
helm install
PS C:\Users\jyee> choco install kubernetes-helm
>>
Chocolatey v0.10.15
Installing the following packages:
kubernetes-helm
By installing you accept licenses for the packages.
Progress: Downloading kubernetes-helm 3.0.2... 100%
kubernetes-helm v3.0.2 [Approved]
kubernetes-helm package files install completed. Performing other installation steps.