Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
| #!/bin/bash | |
| # | |
| # dockerpsns - proof of concept for a "docker ps --namespaces". | |
| # | |
| # USAGE: ./dockerpsns.sh | |
| # | |
| # This lists containers, their init PIDs, and namespace IDs. If container | |
| # namespaces equal the host namespace, they are colored red (this can be | |
| # disabled by setting color=0 below). | |
| # |
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "k8s.io/client-go/kubernetes" | |
| "k8s.io/client-go/pkg/api/v1" | |
| "k8s.io/client-go/tools/clientcmd" | |
| ) |
| # General | |
| datetime (If you want to revert to the hardware clock being in UTC, do:) | |
| `timedatectl set-local-rtc 0` | |
| ## Docker | |
| Also making sure we can do docker commands without sudo | |
| ``` | |
| yaourt -S --noconfirm docker | |
| usermod -a -G docker $USER |
| FROM alpine:latest | |
| RUN apk update && apk upgrade && \ | |
| apk add --no-cache \ | |
| openssh | |
| RUN mkdir -p /keys/web /keys/worker | |
| CMD ssh-keygen -t rsa -f /keys/web/tsa_host_key -N '' && \ | |
| ssh-keygen -t rsa -f /keys/web/session_signing_key -N '' && \ |
| ''' | |
| Distributed Tensorflow example of using data parallelism and share model parameters. | |
| Trains a simple sigmoid neural network on mnist for 20 epochs on three machines using one parameter server. | |
| Change the hardcoded host urls below with your own hosts. | |
| Run like this: | |
| pc-01$ python example.py --job-name="ps" --task_index=0 | |
| pc-02$ python example.py --job-name="worker" --task_index=0 | |
| pc-03$ python example.py --job-name="worker" --task_index=1 | |
| pc-04$ python example.py --job-name="worker" --task_index=2 | |
| More details here: ischlag.github.io |
| #!/bin/bash | |
| # Sometimes you need to move your existing git repository | |
| # to a new remote repository (/new remote origin). | |
| # Here are a simple and quick steps that does exactly this. | |
| # | |
| # Let's assume we call "old repo" the repository you wish | |
| # to move, and "new repo" the one you wish to move to. | |
| # | |
| ### Step 1. Make sure you have a local copy of all "old repo" | |
| ### branches and tags. |
| #!/bin/bash | |
| # This script is used to compile Tensorflow Serving protobuf definition into Python | |
| # The generated definitions in Python are stored in the tensorflow_serving_apis folder | |
| # Usage: | |
| # ./compile_ts_serving_proto.sh 333325e413e9680d67ae90196fa123f5271fcf615 | |
| # | |
| : ${1?”Error. Please provide the Tensorflow Serving git commit hash/branch name. Usage: ./compile_ts_serving_proto.sh my_awesome_branch “} | |
| script_dir=”$( cd “$( dirname “${BASH_SOURCE[0]}” )” && pwd )” | |
| ts_git_revision=$1 #branch/release or commit hash | |
| local_ts_api_dir=”${script_dir}/tensorflow_serving_apis/” #directory that stores the compiled python proto definition |