Skip to content

Instantly share code, notes, and snippets.

View DStorck's full-sized avatar

Deirdre Storck DStorck

  • Samsung CNCT
  • Seattle, WA
View GitHub Profile
@DStorck
DStorck / seconds.rb
Last active February 28, 2016 06:30
#oh the variables we we will use !!
days_in_a_year = 365.245
minutes_in_a_year = 60 * 24 * days_in_a_year
#this time business was all new to me but i tried to set it for my birthday in NYC
my_age = Time.new(1980,9,7, 19, 44, 00, -0500)
now = Time.now
my_age_in_seconds = now - my_age
seconds_in_a_day = 60 * 60 * 24
@DStorck
DStorck / gcloud-commands.md
Last active March 10, 2017 21:58
gcloud kubernetes commands

Common gcloud commands

gcloud auth list - see a list of credentialed accounts

gcloud components list - see available components and whether or not they are installed

gcloud components install COMPONENT_ID . - install it

gcloud config list - show active configuration

# make secret with kubectl create secret generic my-secret --from-literal=key1=supersecret
# to use secret in a env var
apiVersion: v1
kind: Pod
metadata:
name: pod-secrets-to-env
namespace: default
spec:
containers:
@DStorck
DStorck / kubectl-commands.md
Last active February 9, 2024 19:34
kubectl commands

filter kubernetes response with kubectl

make file with all results , then filter into new file

kubectl get nodes > all_nodes.txt

cat all_nodes.txt | while read line ; do if [[ $line == *"sobusy"* ]]; then echo $line; fi; done > filtered_nodes.txt

filter results by search criteria

kubectl logs <pod> <search_criteria> > some_file.txt

@DStorck
DStorck / systemctl.md
Last active September 12, 2017 18:30
helpful systemctl commands

systemctl commands

systemctl enable # tell systemd to start service at boot

systemctl edit kubelet.service # or vi /etc/systemd/system/kubelet.service

systemctl daemon-reload

systemctl restart kubelet.service

@DStorck
DStorck / k8s-netpol.yaml
Created September 7, 2017 17:00
kubernetes network policy example
kind: NetworkPolicy
apiVersion: extensions/v1beta1
metadata:
name: access-nginx
namespace: secret
spec:
podSelector:
matchLabels:
run: nginx
ingress:
@DStorck
DStorck / k8s-samples.yaml
Last active September 7, 2017 23:13
kubernetes sample configurations
# simple pv
kind: PersistentVolume
apiVersion: v1
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: manual