Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 <service_account_name> <namespace>" | |
exit 1 | |
fi |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
## 1: | |
# Count the Number of Nodes That Are Ready to Run Normal Workloads | |
k get nodes -o=custom-columns='NAME:.metadata.name, TAINTS:.spec.taints[*]' | |
# Retrieve Error Messages from a Container Log | |
k logs data-handler -n backend | grep ERROR > /k8s/0002/errors.txt | |
# Find the pod with a label of app=auth in the web namespace that Is utilizing the most CPU. | |
k top pods -n web --selector=app=auth --sort-by=cpu | |
## 2: | |
# Edit the Web Frontend Deployment to Expose the HTTP Port |
A guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.
For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way
For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter
This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, key-mapping,
#!/usr/bin/env python3 | |
""" | |
To use: | |
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client | |
2. install pandoc and pypandoc, also tqdm | |
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials | |
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub | |
""" | |
import re | |
import sys |
I have included a .env, ingress-nginx.yaml, controller-nginx.yaml, and bash script that will build your cluster and deploys everything in your folder you specifify in the parameter for the bash script parameters
To deploy from your cloud-config/staging folder and create the cluster do this:
./deploy.sh staging y
If you want to upgrade your existing app deployment, simply remove the y
import sys | |
import base64 | |
import httplib | |
import json | |
from urlparse import urlparse | |
class JiraCommunicator: | |
""" Jira Communicator using REST API """ | |
def __init__(self, endpoint='http://localhost:4516', username='admin', password='admin', apiVersion='latest'): |
#!/bin/bash | |
set -o errexit | |
set -o nounset | |
set -o pipefail | |
CNCF_GCP_ORG=758905017065 | |
echo "# Auditing CNCF CGP Org: ${CNCF_GCP_ORG}" | |
echo "## Iterating over Projects" |