Skip to content

Instantly share code, notes, and snippets.

View cwilkers's full-sized avatar

Chandler Wilkerson cwilkers

View GitHub Profile
@cwilkers
cwilkers / inventory.yaml
Created March 9, 2018 19:03
3.9 inventory
---
all:
children:
OSEv3:
children:
nodes:
children:
masters:
hosts:
openshift-master-[0:2].{{ public_hosted_zone }}
@cwilkers
cwilkers / test-build-vm-list.yml
Created June 19, 2018 16:02
Test play to see vms var populated by openshift_rhv role
---
- name: Deploy oVirt template and virtual machines
hosts: localhost
connection: local
gather_facts: false
tasks:
- name: Build vm list
import_role:
name: openshift_rhv
tasks_from: build_vm_list
@cwilkers
cwilkers / gist:de909d7fe7734731a9901e867924b51c
Created October 31, 2018 15:31
Federated ingress for pacman on PIT demo environment
# First check the IPs referred to by the application DNS entry
$ host pacman.apps.e2e.bos.redhat.com
pacman.apps.e2e.bos.redhat.com has address 10.19.114.198
pacman.apps.e2e.bos.redhat.com has address 10.19.114.123
pacman.apps.e2e.bos.redhat.com has address 10.29.124.37
pacman.apps.e2e.bos.redhat.com has address 10.19.227.154
# Create federated ingress and ingressplacement objects:
$ cat federatedingress.yaml
---
@cwilkers
cwilkers / Create list of federated types
Created February 14, 2019 16:34
Return all custom types created by a CRD with a certain group name (*.federation.k8s.io)
---
- name: Backup federation control plane on master cluster
hosts: federation
tasks:
- name: Read CRDs
command:
argv:
- oc
- --context={{federation_context}}
- get
@cwilkers
cwilkers / update-oi.sh
Created April 8, 2019 16:01
Keep my openshift-installer updated with latest
#!/bin/bash
openshift_tag=`curl -s https://api.github.com/repos/openshift/installer/releases | grep -oP '"tag_name": "\K(.*)(?=")' | head -n 1`
current_tag=$(~/bin/openshift-install version | grep -oE 'v[0-9.]+')
if [[ "$openshift_tag" != "$current_tag" ]]
then
echo "Downloading new copy, available $openshift_tag differs from installed $current_tag"
cd /tmp
wget --quiet https://github.com/openshift/installer/releases/download/${openshift_tag}/openshift-install-linux-amd64
chmod +x openshift-install-linux-amd64
@cwilkers
cwilkers / annotate-pod.sh
Created April 10, 2019 20:58
Script to annotate a pod with a Velero Restic volume list
#!/bin/bash
# This script adds Velero/Restic labels to a pod according to the pod's
# current volume set (filtering to only persistentVolumeClaims)
# According to https://heptio.github.io/velero/v0.11.0/restic
# TODO: Make this script produce help if options are not given
# Currently it just assumes you mean to annotate a NooBaa server pod
# Usage:
# annotate-pod.sh namespace pod
#
NS=${1:-noobaa}
@cwilkers
cwilkers / three-peers.sh
Created August 14, 2019 13:55
VPC Peering script
#!/bin/bash
set -e
# Fill in Array of openshift contexts
declare -a CONTEXTS
CONTEXTS=($(oc config get-contexts -o name))
# Check for three clusters
if [ ${#CONTEXTS[@]} != 3 ]
then
@cwilkers
cwilkers / nooba-server-0.log
Created October 14, 2019 20:13
Log from noobaa-server-0 -c noobaa-server
Oct-14 18:55:32.238 [BGWorkers/32] [L0] core.server.bg_services.agent_blocks_reclaimer:: AGENT_BLOCKS_RECLAIMER: BEGIN
::ffff:10.131.0.1 - - [14/Oct/2019:18:55:35 +0000] "GET /fe/ HTTP/1.1" 200 507 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36"
::ffff:10.131.0.1 - - [14/Oct/2019:18:55:35 +0000] "GET /fe/styles.css HTTP/1.1" 200 - "https://noobaa-mgmt-noobaa.apps.upi.e2e.bos.redhat.com/fe/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, lik
e Gecko) Chrome/70.0.3538.67 Safari/537.36"
::ffff:10.131.0.1 - - [14/Oct/2019:18:55:35 +0000] "GET /fe/preload.js HTTP/1.1" 200 - "https://noobaa-mgmt-noobaa.apps.upi.e2e.bos.redhat.com/fe/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, lik
e Gecko) Chrome/70.0.3538.67 Safari/537.36"
::ffff:10.131.0.1 - - [14/Oct/2019:18:55:35 +0000] "GET /fe/assets/fonts/roboto/Hgo13k-tfSpn0qi1SFdUfVtXRa8TVwTICgirnJhmVJw.woff2 HTTP/1.1" 200 14524 "https://noobaa-mgmt-noobaa.apps.upi.e2e.bos.redha
@cwilkers
cwilkers / cpu-stress-pod.yaml
Created January 23, 2020 15:21
Pod definition using pinned stress container
apiVersion: v1
kind: Pod
metadata:
generateName: stress-
spec:
containers:
- name: cpu-demo-ctr
image: quay.io/cwilkers/stress-pin
resources:
limits:
@cwilkers
cwilkers / fix-registry-proxy.sh
Created February 27, 2020 14:23
Fix for reaching image registry with unknown CA from devel ocp
#!/bin/bash
REGISTRY=registry-proxy.engineering.redhat.com
true | openssl s_client -showcerts -connect ${REGISTRY}:443 2>/dev/null | openssl x509 > ca.crt
oc create configmap registry-cas -n openshift-config --from-file=${REGISTRY}=ca.crt
oc patch image.config.openshift.io/cluster --patch '{"spec":{"additionalTrustedCA":{"name":"registry-cas"}}}' --type=merge
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}'
oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"managementState":"Managed"}}'