Skip to content

Instantly share code, notes, and snippets.

View svrc's full-sized avatar

Stu Charlton svrc

View GitHub Profile
while read newline
do
new=$(date -d "$(echo "$newline" | sed -E 's/-([0-9][0-9])\.([0-9][0-9])\./ \1:\2:/')" '+%s')
if [ "$old" ] && (( $new - $old > 20))
then
printf "%4i seconds gap before %s" "$((new - old))" "$newline"
fi
old=$new
done <check_liveness.log

Vmware Tanzu Kubernetes Grid and VMware Telco Cloud Automation

Welcome! This is a series of quick guides to setting up dev/test/lab environment with Tanzu Kubernetes Grid and/or with VMware Telco Cloud Automation.

This isn't a replacement for the official documentation but rather is a curated, streamlined set of "how tos" from several locations based on my experiences.

@svrc
svrc / cleanup.yml
Last active June 19, 2020 17:41
PKS Calico Pod Cleanup
apiVersion: v1
kind: ServiceAccount
metadata:
name: calico-node-cleanup
namespace: kube-system
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: calico-node-cleanup
@svrc
svrc / ISTIO 1.4 on PKS with PSPs.md
Last active March 4, 2020 17:35
Installing Istio 1.4 on PKS with restrictive Pod Security Policy

What does this GIST do or not do

  1. Shows you how to use Istio 1.4.0 - 1.4.2 on Kubernetes 1.14+ with a modicum of runtime security for your workloads.
  2. Specifically it installs Istio with CNI support, and allows the use of restrictive PodSecurityPolicies for your workloads. Istio 1.4.3 fixes this issue. However, this may still be useful due to a need to add a PSP privileged role to the Istio helm charts!
  3. It is designed for VMware PKS, but doesn't require it ... (just change the CNI bin dir and excluded namespaces in values-cni.yml, also swap the ClusterRole pks-privileged and pks-restricted mentioned throughout these files with your own PSP roles).
  4. It doesn't fix the need for Istio itself to run as root, but that should be fixed in a future Istio release as it's already fixed in trunk.
  5. Update I've also included a workaround for the CNI race condition bug in Istio CNI if you're using a DaemonSet-based CNI. See istio/istio#14327

Prerequisites

@svrc
svrc / availability set fix
Last active September 23, 2019 19:19
Patch OpsMan for use with Azure availability sets
sudo sed -i "s/AZ_NAME_FOR_AVAILABILITY_SETS = 'Availability Sets'.freeze/AZ_NAME_FOR_AVAILABILITY_SETS = 'null'.freeze/" /home/tempest-web/tempest/web/app/models/persistence/models/azure/azure_availability_zone.rb
sudo service tempest-web restart
nodes-network.json
{
"description": "Configurable Nodes Network IP Block",
"name": "network-profile_nodes-ip-block",
"parameters": {
"node_ip_block_ids": [
"2250dc43-63c8-4bb8-b8cf-c6e12ccfb7de", "3d577e5c-dcaf-4921-9458-d12b0e1318e6"
],
"node_routable":true,
"node_subnet_prefix":20
---
name: edge
director_uuid: ((director_uuid))
releases:
- name: haproxy
version: latest
- name: networking
version: latest
stemcells:
- alias: default
@svrc
svrc / azure-bosh.sh
Last active February 25, 2019 19:13
Azure BOSH start/stop CLI
#!/bin/bash
# Azure Start/Stop CLI. Starts or Stops all BOSH-provisioned VMs in a resource group.
# Requires the "Azure 2.0 CLI", aka az ; requires it to be logged in to your azure account
trap "exit" INT
if [ -z "$2" ]; then
echo "Missing resource group"
echo "USAGE: azure-bosh.sh [start|stop] [resource group]"
@svrc
svrc / credhub-job
Created December 14, 2018 20:22
credhub-job
jobs:
- name: credhub-interpolate
plan:
- get: platform-automation-tasks
- get: platform-automation-image
- get: vars
- task: credhub-interpolate
image: platform-automation-image
file: platform-automation-tasks/tasks/credhub-interpolate.yml
input_mapping: