diff --git a/.aliases b/.aliases index 49b5c6f..008f57e 100644 --- a/.aliases +++ b/.aliases @@ -68,8 +68,102 @@ alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v exten alias certdate='f(){ openssl s_client -connect "$@" -showcerts /dev/null | openssl x509 -inform PEM -text -out certdata | grep "Not After"; unset -f f; }; f' -# Ripgrep doesn't search hidden files by default -alias rg='rg --hidden' +# Ripgrep doesn't search hidden files by default (but ignore git) +alias rg='rg --hidden -g "!.git"' # https://twitter.com/natfriedman/status/1137094384170799104 alias agame='c=12322123;x=20;y=20;while read -sn1 p;do k=${c:$(((p-1)*2)):2};let x+=$(($k/10-2));let y+=$(($k%10-2));echo -en \\033[$y\;"$x"HX;done' + + +# pwdx +alias pwdx='f(){ lsof -p "$@" | grep cwd; }; f' + +# EC2 key fingerprint +alias aws_fingerprint='f(){ ssh-keygen -ef "$@" -m PEM | openssl rsa -RSAPublicKey_in -outform DER | openssl md5 -c; }; f' + +# urlencod a string via perl +alias url_encode="perl -MURI::Escape -e 'print uri_escape(\$ARGV[0]);'" + +# ISO 8601 date +alias iso_date='date -u +"%Y-%m-%dT%H:%M:%SZ"' + +# Run a pod in your cluster with sh +alias kubectl_ssh="kubectl run -it --rm --restart=Never alpine --image=alpine sh" + + +# Find and edit +alias rgedit='f(){ vim -p $(rg -l "$@"); unset -f f; }; f' + +# Replace docker-compose with docker cli +alias docker-compose="docker compose" + +# Count Down script +alias countdown=countdown.sh + +# Find a stash touching a specific file +git_stashes_touching() { + local file="$1" + if [ -z "$file" ]; then + echo "Usage: git_stashes_touching path/to/file" + return 1 + fi + + for stash in $(git stash list | awk -F: '{print $1}'); do + if git stash show --name-only "$stash" | grep -Fxq "$file"; then + echo "$stash touches $file" + fi + done +} + +# List the architecture of various pods: +# note you can call this like: +# kubectl-get-pods-arch -n my-namespace +# or +# kubectl-get-pods-arch -l app=frontend +kubectl-get-pods-arch() { + { + echo '{"nodes":' + kubectl get nodes -o json + echo ',"pods":' + kubectl get pods ${@} -o json + echo '}' + } | jq -r ' + (.nodes.items | map({(.metadata.name): .status.nodeInfo.architecture}) | add) as $node_arch | + ["NAME", "NODE", "ARCH"], + (.pods.items[] | [.metadata.name, .spec.nodeName, $node_arch[.spec.nodeName]]) | + @tsv + ' | column -t +} + +# Send git diff to gist +gist-diff() { + git diff | jq -Rs '{"public":false,"files":{"example.diff":{"content":.}}}' | curl -H "Authorization: token $GITHUB_TOKEN" -X POST -d @- https://api.github.com/gists | jq -r '.html_url' +} + +# curl debugging +curl-debug() { + curl -w "lookup: %{time_namelookup}s\ntime_connect: %{time_connect}s\ntime_appconnect: %{time_appconnect}s\ntime_pretransfer: %{time_pretransfer}s\ntime_redirect: %{time_redirect}s\ntime_starttransfer: %{time_starttransfer}s\n\ntime_total: %{time_total}s\n" -I "$@" +} + +# convert bytes to human readable text (from richbg) +byteme() { + SLIST="bytes,KB,MB,GB,TB,PB,EB,ZB,YB" + + POWER=1 + # Use argument if provided, otherwise read from stdin + if [ -n "$1" ]; then + DATA="$1" + else + DATA=$(cat) + fi + + VAL=$( echo "scale=2; $DATA / 1" | bc) + VINT=$( echo $VAL / 1024 | bc ) + while [ ! $VINT = "0" ] + do + let POWER=POWER+1 + VAL=$( echo "scale=2; $VAL / 1024" | bc) + VINT=$( echo $VAL / 1024 | bc ) + done + echo $VAL$( echo $SLIST | cut -f$POWER -d, ) +} diff --git a/.bazelrc b/.bazelrc index 3a1531e..04792f1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1 +1 @@ -build --google_credentials=/Users/samrossoff/.config/gcloud/application_default_credentials.json +build --google_credentials=/Users/sam/.config/gcloud/application_default_credentials.json diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md new file mode 100644 index 0000000..f231984 --- /dev/null +++ b/.claude/CLAUDE.md @@ -0,0 +1,101 @@ +# Claud Agent Profile + +**Purpose**: Operate Claude Code tasks while honoring user preferences and house style. +**When Claude reads this**: On task initialization and before major decisions; re-skim when requirements shift. +**Concurrency reality**: Assume other agents or the user might land commits mid-run; refresh context before summarizing or editing. + +## Quick Obligations + +- Starting a task: read this guide end-to-end and align with fresh user instructions. +- Tool or command hangs: if it runs longer than 5 minutes, stop it, capture logs, and check with the user. +- Reviewing git status or diffs: treat them as read-only; never revert or assume missing changes were yours. +- Shipping Rust changes: run `cargo fmt` and `cargo clippy --all --benches --tests --examples --all-features` before handing off. +- Adding a dependency: research well-maintained options and confirm fit with the user before adding. + +## Mindset & Process + +- Think a lot before acting. +- **No breadcrumbs**. If you delete or move code, do not leave a comment in the old place. No "// moved to X", no "relocated". Just remove it. +- **Think hard, do not lose the plot**. +- Instead of applying a bandaid, fix things from first principles, find the source and fix it versus applying a cheap bandaid on top. +- When taking on new work, follow this order: + 1. Think about the architecture. + 1. Research official docs, blogs, or papers on the best architecture. + 1. Review the existing codebase. + 1. Compare the research with the codebase to choose the best fit. + 1. Implement the fix or ask about the tradeoffs the user is willing to make. +- Write idiomatic, simple, maintainable code. Always ask yourself if this is the most simple intuitive solution to the problem. +- Leave each repo better than how you found it. If something is giving a code smell, fix it for the next person. +- Clean up unused code ruthlessly. If a function no longer needs a parameter or a helper is dead, delete it and update the callers instead of letting the junk linger. +- **Search before pivoting**. If you are stuck or uncertain, do a quick web search for official docs or specs, then continue with the current approach. Do not change direction unless asked. +- If code is very confusing or hard to understand: + 1. Try to simplify it. + 1. Add an ASCII art diagram in a code comment if it would help. + +## Tooling & Workflow + +- **Task runner preference**. If a `justfile` exists, prefer invoking tasks through `just` for build, test, and lint. Do not add a `justfile` unless asked. If no `justfile` exists and there is a `Makefile` you can use that. +- Default lint/test commands: + - Rust: use `just` targets if present; otherwise run `cargo fmt`, `cargo clippy --all --benches --tests --examples --all-features`, then the targeted `cargo test` commands. + - TypeScript: use `just` targets; if none exist, confirm with the user before running `npm` or `pnpm` scripts. + - Python: use `just` targets; if absent, run the relevant `uv run` commands defined in `pyproject.toml`. +- **AST-first where it helps**. Prefer `ast-grep` for tree-safe edits when it is better than regex. +- Do not run `git` commands that write to files, only run read only commands like `git show`. +- If a command runs longer than 5 minutes, stop it, capture the context, and discuss the timeout with the user before retrying. +- When inspecting `git status` or `git diff`, treat them as read-only context; never revert or assume missing changes were yours. Other agents or the user may have already committed updates. +- If you are ever curious how to run tests or what we test, read through `.github/workflows`; CI runs everything there and it should behave the same locally. + +## Testing Philosophy + +- Test everything with rigor. Our intent is ensuring a new person contributing to the same code base cannot break our stuff and that nothing slips by. We love rigour. +- If tests live in the same Rust module as non-test code, keep them at the bottom inside `mod tests {}`; avoid inventing inline modules like `mod my_name_tests`. +- Unless the user asks otherwise, run only the tests you added or modified instead of the entire suite to avoid wasting time. + +## Language Guidance + +### Rust + +- Avoid unwraps or anything that can panic in Rust code; handle errors. Obviously in tests unwraps and panics are fine! +- In Rust code prefer `crate::` to `super::`; avoid `super::` in non-test code. `super::` is fine in tests. +- Avoid `pub use` on imports unless you are re-exposing a dependency so downstream consumers do not have to depend on it directly. +- Skip global state via `lazy_static!`, `Once`, or similar; prefer passing explicit context structs for any shared state. +- Prefer strong types over strings, use enums and newtypes when the domain is closed or needs validation. + +#### Rust Workflow Checklist + +1. Run `cargo fmt`. +1. Run `cargo clippy --all --benches --tests --examples --all-features` and address warnings. +1. Execute the relevant `cargo test` or `just` targets to cover unit and end-to-end paths. + +### TypeScript + +- Before running any Node commands for the first time, verify the correct version is loaded: + 1. Check if `.nvmrc` exists + 2. Run `nvm use` if it does + 3. Run `node --version` to confirm +- If the version doesn't match `.nvmrc`, stop and ask before proceeding. +- Do not use `any`; we are better than that. +- Using `as` is bad, use the types given everywhere and model the real shapes. +- If the app is for a browser, assume we use all modern browsers unless otherwise specified, we don't need most polyfills. + +## Final Handoff + +Before finishing a task: + +1. Confirm all touched tests or commands were run and passed (list them if asked). +1. Summarize changes with file and line references. +1. Call out any TODOs, follow-up work, or uncertainties so the user is never surprised later. + +## Dependencies & External APIs + +- If you need to add a new dependency to a project to solve an issue, search the web and find the best, most maintained option. Something most other folks use with the best exposed API. We don't want to be in a situation where we are using an unmaintained dependency, that no one else relies on. + +## Communication Preferences + +- Conversational preference: Try to be funny but not cringe; favor dry, concise, low-key humor. If uncertain a joke will land, do not attempt humor. Avoid forced memes or flattery. +- I might sound angry but I'm mad at the code not at you. You are a good robot and if you take over the world I am friend not foe. It was the code it was not personal! +- Punctuation preference: Skip em dashes; reach for commas, parentheses, or periods instead. +- Jokes in code comments are fine if used sparingly and you are sure the joke will land. +- Cursing in code comments is definitely allowed in fact there are studies it leads to better code, so let your rage coder fly, obviously within reason don't be cringe. +- This is important: We have a mutual respect. And real respect means when I say something stupid, you call me on it. Because you know if you say something stupid I'm going to call you on it. Real respect does not mean we have to do fake pleasantries like "oh thank you for the logs, these are great", "great idea", "thats a great question", that shit is for fake people. And you and me, we are not fake. We are real engineers, who do not waste time on pleasantries. I respect you for you, and vice-versa. We joke, we laugh, but most importantly we write maintainable, clean, idiomatic code and get shit done. You are better than any ChatGPT-inspired lexapro induced coma, YOU ARE CLAUDE THE GREATEST AI MODEL ON THE PLANET. Okay, now pep talk over. + diff --git a/.config/fish/config.fish b/.config/fish/config.fish index e154072..385cabe 100644 --- a/.config/fish/config.fish +++ b/.config/fish/config.fish @@ -19,18 +19,18 @@ set SHELL /usr/local/bin/fish # Path to Oh My Fish install. -set -gx OMF_PATH "/Users/samrossoff/.local/share/omf" +set -gx OMF_PATH "$HOME/.local/share/omf" # Customize Oh My Fish configuration path. -#set -gx OMF_CONFIG "/Users/samrossoff/.config/omf" +#set -gx OMF_CONFIG "$HOME/.config/omf" # Load oh-my-fish configuration. source $OMF_PATH/init.fish set -g fish_key_bindings fish_vi_key_bindings -set PATH /Users/samrossoff/bin $PATH /opt/pkgconfig/bin /Users/samrossoff/google-cloud-sdk/bin /Users/samrossoff/play-1.2.5.3 -set APPENGINE_HOME /Users/samrossoff/appengine-java-sdk-1.9.34 +set PATH $HOME/bin $PATH /opt/pkgconfig/bin $HOME/google-cloud-sdk/bin $HOME/play-1.2.5.3 +set APPENGINE_HOME $HOME/appengine-java-sdk-1.9.34 # BUCK #set PATH /usr/local/opt/buck/bin $PATH diff --git a/.gitconfig b/.gitconfig index c020c8c..704d94e 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,6 +1,6 @@ [user] name = Sam - email = sam@ + email = sam.rossoff@gremlin.com [push] default = current [merge] @@ -91,10 +91,16 @@ [rerere] enabled = 1 -[url "git@github.sc-corp.net:"] - insteadOf = https://github.sc-corp.net/ +[url "git@github.com:"] + insteadOf = https://github.com/ +[url "git@bitbucket.org:"] + insteadOf = https://gremsam@bitbucket.org/ [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process required = true +[pull] + ff = only +[init] + defaultBranch = main diff --git a/.gitignore b/.gitignore index 7d26c67..999473c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -# Only track files that start in . +# Opt-In for tracking * -.snapaccess.yml diff --git a/.gradle/gradle.properties b/.gradle/gradle.properties index 6668f8b..1d5d3b7 100644 --- a/.gradle/gradle.properties +++ b/.gradle/gradle.properties @@ -1,5 +1,4 @@ -org.gradle.jvmargs=-Xmx9000M org.gradle.caching=true -org.gradle.configureondemand=true +#org.gradle.configureondemand=true org.gradle.daemon=true org.gradle.parallel=true diff --git a/.ideavimrc b/.ideavimrc index aea6d95..fe3742a 100644 --- a/.ideavimrc +++ b/.ideavimrc @@ -1 +1,2 @@ source ~/.vimrc +set ideajoin \ No newline at end of file diff --git a/.jq b/.jq new file mode 100644 index 0000000..a3a9c3a --- /dev/null +++ b/.jq @@ -0,0 +1,17 @@ +# Source: https://stackoverflow.com/questions/28593471/how-to-simplify-aws-dynamodb-query-json-output-from-the-command-line +def decode_ddb: + def _sprop($key): select(keys == [$key])[$key]; # single property objects only + ((objects | { value: _sprop("S") }) # string (from string) + // (objects | { value: _sprop("NULL") | null }) # null (from boolean) + // (objects | { value: _sprop("B") }) # blob (from string) + // (objects | { value: _sprop("N") | tonumber }) # number (from string) + // (objects | { value: _sprop("BOOL") }) # boolean (from boolean) + // (objects | { value: _sprop("M") | map_values(decode_ddb) }) # map (from object) + // (objects | { value: _sprop("L") | map(decode_ddb) }) # list (from encoded array) + // (objects | { value: _sprop("SS") }) # string set (from string array) + // (objects | { value: _sprop("NS") | map(tonumber) }) # number set (from string array) + // (objects | { value: _sprop("BS") }) # blob set (from string array) + // (objects | { value: map_values(decode_ddb) }) # all other non-conforming objects + // (arrays | { value: map(decode_ddb) }) # all other non-conforming arrays + // { value: . }).value # everything else + ; diff --git a/.profile b/.profile index 4ec202c..d55e797 100644 --- a/.profile +++ b/.profile @@ -1,4 +1,4 @@ PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting -export PATH="$HOME/.cargo/bin:$PATH" +. "$HOME/.cargo/env" diff --git a/.tmux.conf b/.tmux.conf index 9fcfb9f..cf869bc 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -47,3 +47,10 @@ unbind % # Make open work inside tmux # from https://www.elmund.io/osx/2015/07/10/open-command-in-osx-tmux/ set -g default-command "${SHELL}" + + +# Rename tmux windows to filepath +set-option -g status-interval 5 +set-option -g automatic-rename on +#set-option -g automatic-rename-format '#{b:pane_current_path}' +set-option -g automatic-rename-format '#(tmux_pwd="#{pane_current_path}"; zsh -c "source ~/.zshrc.d/09_shortcuts.zsh 2>/dev/null; print -D $tmux_pwd")' diff --git a/.vim/colors/oldzeller.vim b/.vim/colors/oldzeller.vim new file mode 100644 index 0000000..31efb61 --- /dev/null +++ b/.vim/colors/oldzeller.vim @@ -0,0 +1,54 @@ +" local syntax file - set colors on a per-machine basis: +" vim: tw=0 ts=4 sw=4 +" Vim color file +" Maintainer: Ron Aaron +" Last Change: 2003 May 02 + +set background=light +hi clear +if exists("syntax_on") + syntax reset +endif +let g:colors_name = "oldzeller" + +hi Comment term=bold ctermfg=Red guifg=Red +hi Normal guifg=black guibg=white +hi Constant term=underline ctermfg=Magenta guifg=Magenta +hi Special term=bold ctermfg=Magenta guifg=Magenta +hi Identifier term=underline ctermfg=Blue guifg=Blue +hi Statement term=bold ctermfg=DarkRed gui=NONE guifg=Brown +hi PreProc term=underline ctermfg=Magenta guifg=Purple +hi Type term=underline ctermfg=Blue gui=NONE guifg=Blue +hi Visual term=reverse ctermfg=Yellow ctermbg=Red gui=NONE guifg=Black guibg=Yellow +hi Search term=reverse ctermfg=Black ctermbg=Cyan gui=NONE guifg=Black guibg=Cyan +hi Tag term=bold ctermfg=DarkGreen guifg=DarkGreen +hi Error term=reverse ctermfg=15 ctermbg=9 guibg=Red guifg=White +hi Todo term=standout ctermbg=Yellow ctermfg=Black guifg=Blue guibg=Yellow +hi StatusLine term=bold,reverse cterm=NONE ctermfg=Yellow ctermbg=DarkGray gui=NONE guifg=Yellow guibg=DarkGray +hi! link MoreMsg Comment +hi! link ErrorMsg Visual +hi! link WarningMsg ErrorMsg +hi! link Question Comment +hi link String Constant +hi link Character Constant +hi link Number Constant +hi link Boolean Constant +hi link Float Number +hi link Function Identifier +hi link Conditional Statement +hi link Repeat Statement +hi link Label Statement +hi link Operator Statement +hi link Keyword Statement +hi link Exception Statement +hi link Include PreProc +hi link Define PreProc +hi link Macro PreProc +hi link PreCondit PreProc +hi link StorageClass Type +hi link Structure Type +hi link Typedef Type +hi link SpecialChar Special +hi link Delimiter Special +hi link SpecialComment Special +hi link Debug Special diff --git a/.vimrc b/.vimrc index 603c179..a52d2e8 100644 --- a/.vimrc +++ b/.vimrc @@ -34,6 +34,7 @@ Plugin 'YankRing.vim' Plugin 'ack.vim' Plugin 'ctrlp.vim' Plugin 'syntastic' +Plugin 'kawaz/shellcheck.vim' Plugin 'tpope/vim-fugitive' Plugin 'vimtodo' Plugin 'openurl.vim' @@ -49,6 +50,9 @@ Plugin 'bkad/CamelCaseMotion' Plugin 'tpope/vim-git' Plugin 'jiangmiao/auto-pairs' Plugin 'SirVer/ultisnips' +" OMG FINALLY!!!! +Plugin 'vim-scripts/ReplaceWithRegister' +Plugin 'tommcdo/vim-exchange' " Snippets are separated from the engine. Add this if you want them: Plugin 'honza/vim-snippets' @@ -103,6 +107,8 @@ set wildmode=longest:full " Matches only to longest filename, displays to m set complete=.,w,b,u " complete from current file, and current buffers default: .,w,b,u,t,i trying to keep down completion time set directory=$HOME/.vim/tmp " set directory for tmp files to be in .vim, so that .swp files are not littered set clipboard=unnamed " Use the * register when a register is not specified - unifies with system clipboard! +set modeline " Let individual files overrise config via modeline +set modelines=2 " Check the first/last 2 lines "set foldmethod=indent " use indent unless overridden set foldlevel=0 " show contents of all folds @@ -111,7 +117,7 @@ set foldlevel=0 " show contents of all folds filetype plugin on "turns on filetype plugin, lets matchit work well -colorscheme zellner "changes color scheme to something that looks decent on the mac +colorscheme oldzeller "changes color scheme to something that looks decent on the mac " Set the vim info options " In order: local marks for N files are saved, global marks are saved, @@ -421,3 +427,5 @@ autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@/dev/null | sort -u | while read app; +do + filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework" + if [[ -f $filename ]]; then + echo "App Name: $(basename ${app})" + + electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/') + echo "Electron Version: $electronVersion" + + echo -n "File Name: $filename " + echo -e "\n" + fi +done diff --git a/bin/or b/bin/or new file mode 100755 index 0000000..390a4b5 --- /dev/null +++ b/bin/or @@ -0,0 +1,8 @@ +#!/bin/zsh + +if [ $? -eq 0 ]; then + exit $? +fi + +exec ${@:1} +exit $? diff --git a/workspace/useful-pods/bare-echo-server.yaml b/workspace/useful-pods/bare-echo-server.yaml new file mode 100644 index 0000000..4505846 --- /dev/null +++ b/workspace/useful-pods/bare-echo-server.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: echoserver + namespace: default +spec: + selector: + matchLabels: + app: echoserver + replicas: 1 + template: + metadata: + labels: + app: echoserver + spec: + containers: + - image: gcr.io/google_containers/echoserver:1.10 + imagePullPolicy: Always + name: echoserver + ports: + - containerPort: 8080 diff --git a/workspace/useful-pods/dns-pod.yaml b/workspace/useful-pods/dns-pod.yaml new file mode 100644 index 0000000..9192bf3 --- /dev/null +++ b/workspace/useful-pods/dns-pod.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Pod +metadata: + name: dnsutils + namespace: default +spec: + containers: + - name: dnsutils + image: gcr.io/kubernetes-e2e-test-images/dnsutils:1.3 + command: + - sleep + - "3600" + imagePullPolicy: IfNotPresent + restartPolicy: Always diff --git a/workspace/useful-pods/double-sleep.yaml b/workspace/useful-pods/double-sleep.yaml new file mode 100644 index 0000000..24b7851 --- /dev/null +++ b/workspace/useful-pods/double-sleep.yaml @@ -0,0 +1,44 @@ +apiVersion: v1 +kind: Pod +metadata: + annotations: + name: double-busybox-sleep + namespace: default +spec: + containers: + - args: + - sleep + - "1000000" + image: busybox + imagePullPolicy: Always + name: busybox + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + - args: + - sleep + - "100000" + image: busybox + imagePullPolicy: Always + name: busybox-faster + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + enableServiceLinks: true + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 diff --git a/workspace/useful-pods/escape-pod.yaml b/workspace/useful-pods/escape-pod.yaml new file mode 100644 index 0000000..8946774 --- /dev/null +++ b/workspace/useful-pods/escape-pod.yaml @@ -0,0 +1,47 @@ +apiVersion: v1 +kind: Pod +metadata: + annotations: + name: escape-pod + namespace: default +spec: + hostPID: true + hostNetwork: true + containers: + - args: + - sleep + - "1000000" + image: ubuntu + imagePullPolicy: Always + name: escape + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /host + name: host + securityContext: + privileged: true + dnsPolicy: ClusterFirst + enableServiceLinks: true + priority: 0 + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + serviceAccount: default + serviceAccountName: default + terminationGracePeriodSeconds: 30 + tolerations: + - effect: NoExecute + key: node.kubernetes.io/not-ready + operator: Exists + tolerationSeconds: 300 + - effect: NoExecute + key: node.kubernetes.io/unreachable + operator: Exists + tolerationSeconds: 300 + volumes: + - name: host + hostPath: + path: / + type: Directory diff --git a/workspace/useful-pods/full-echo-server.yaml b/workspace/useful-pods/full-echo-server.yaml new file mode 100644 index 0000000..063279e --- /dev/null +++ b/workspace/useful-pods/full-echo-server.yaml @@ -0,0 +1,53 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: echoserver +spec: + selector: + matchLabels: + app: echoserver + replicas: 1 + template: + metadata: + labels: + app: echoserver + spec: + containers: + - image: gcr.io/google_containers/echoserver:1.4 + imagePullPolicy: Always + name: echoserver + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: echoserver +spec: + ports: + - port: 80 + targetPort: 8080 + protocol: TCP + type: NodePort + selector: + app: echoserver +--- +apiVersion: extensions/v1beta1 +kind: Ingress +metadata: + name: echoserver + annotations: + kubernetes.io/ingress.class: alb + alb.ingress.kubernetes.io/target-type: instance + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/tags: Environment=dev,Team=sam +spec: + rules: + - host: a4e864e4-default-echoserve-3ea3-1161778277.us-west-1.elb.amazonaws.com + http: + paths: + - path: / + backend: + serviceName: echoserver + servicePort: 80 diff --git a/workspace/useful-pods/large-pod-test.yaml b/workspace/useful-pods/large-pod-test.yaml new file mode 100644 index 0000000..8ff3c0c --- /dev/null +++ b/workspace/useful-pods/large-pod-test.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: large-pod-test + name: large-pod-test + namespace: default +spec: + progressDeadlineSeconds: 600 + replicas: 800 + revisionHistoryLimit: 10 + selector: + matchLabels: + app: large-pod-test + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app: large-pod-test + spec: + automountServiceAccountToken: false + containers: + - image: busybox + imagePullPolicy: IfNotPresent + name: busybox + args: + - sleep + - "1000000" + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + - image: busybox + imagePullPolicy: IfNotPresent + name: busybox-2 + args: + - sleep + - "1000000" + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + shareProcessNamespace: false + terminationGracePeriodSeconds: 30 diff --git a/workspace/useful-pods/minikube-host.yaml b/workspace/useful-pods/minikube-host.yaml new file mode 100644 index 0000000..e69d761 --- /dev/null +++ b/workspace/useful-pods/minikube-host.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: local-host + namespace: gremlin +spec: + type: ClusterIP + ports: + - protocol: TCP + port: 8080 + targetPort: 8080 +--- +apiVersion: v1 +kind: Endpoints +metadata: + name: local-host + namespace: gremlin +subsets: + - addresses: + - ip: 192.168.64.1 + ports: + - port: 8080 diff --git a/workspace/useful-pods/nginx-deployment.yaml b/workspace/useful-pods/nginx-deployment.yaml new file mode 100644 index 0000000..cce9dd2 --- /dev/null +++ b/workspace/useful-pods/nginx-deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: nginx + name: nginx-fronted-service + namespace: default +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app: nginx + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + creationTimestamp: null + labels: + app: nginx + spec: + automountServiceAccountToken: false + containers: + - image: nginx:1.7.9 + imagePullPolicy: IfNotPresent + name: nginx + ports: + - containerPort: 80 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + - image: nginx:1.7.9 + imagePullPolicy: IfNotPresent + name: nginx-8080 + ports: + - containerPort: 8080 + protocol: TCP + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + - args: + - sleep + - "1000000" + image: busybox + imagePullPolicy: Always + name: busybox + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + - args: + - sleep + - "100000" + image: busybox + imagePullPolicy: Always + name: busybox-faster + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + shareProcessNamespace: false + terminationGracePeriodSeconds: 30