Skip to content

Instantly share code, notes, and snippets.

View rjhowe's full-sized avatar

Ryan Howe rjhowe

  • Red Hat
  • Raleigh
View GitHub Profile

4.8 +

# oc patch ingresscontroller default -n openshift-ingress-operator -p '[{"op": "add", "path": "/spec/tuningOptions/threadCount", "value" : 8}]' --type=json

4.7 and below

#/bin/bash
#USAGE
# `ocpkg 4.8.34`` or with out y release and latest will be chosen `ocpkg 4.8``
DEPENDENCIES=("oc" "jq" "skopeo")
IFS=. read -r Ver4 VerX VerY <<< ${1}
STREAM=fast
CHANNEL="${STREAM}-4.${VerX}"
@rjhowe
rjhowe / hello-openshift.yaml
Last active May 21, 2021 16:50
hello-openshift.yaml
kind: List
apiVersion: v1
items:
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: hello-openshift
app: hello-openshift
name: hello-openshift
@rjhowe
rjhowe / gist:a1fbb0af52b20b6c91e5d65d4ab56cae
Last active March 11, 2021 20:52
default-router.yaml
apiVersion: operator.openshift.io/v1
kind: IngressController
metadata:
name: default
namespace: openshift-ingress-operator
spec:
replicas: 3
endpointPublishingStrategy:
type: HostNetwork
nodePlacement:
@rjhowe
rjhowe / toolbox.sh
Created October 2, 2020 19:23
Example Toolbox script
#!/bin/bash
set -eo pipefail
trap cleanup EXIT
# Defaults
REGISTRY=registry.redhat.io
IMAGE=rhel8/support-tools
TOOLBOX_NAME=toolbox-"${USER}"
TOOLBOXRC="${HOME}"/.toolboxrc
{
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "hello-openshift",
"creationTimestamp": null,
"labels": {
"app": "hello-openshift"
}
@rjhowe
rjhowe / cheatsheet-elasticsearch.md
Last active January 10, 2020 16:02 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
@rjhowe
rjhowe / ocr.sh
Last active October 26, 2020 14:14
OpenShift 4.x Release Viewer Graph
#!/bin/bash
# Requires JQ installed.
# curl -sH 'Accept: application/json' https://api.openshift.com/api/upgrades_info/v1/graph?channel=stable-4.1&arch=amd64 | jq -S '.nodes | sort_by(.version)'
PS3='Please enter your choice: '
# The names of the channels currently need to be hardcoded as there is no way to get a list of what current channels are avaiable.
# https://github.com/openshift/cincinnati/issues/171#issuecomment-555626636
@rjhowe
rjhowe / OCP-AWS-CheatSheet.md
Last active November 19, 2019 20:36
OCP IPI AWS Cheat Sheet

OCP IPI AWS Cheat Sheet

Set variables for AWS commands

  • First I move my metadata.json to
  • Either add to script and source, or add to bashrc and export
metadata=~/.metadata.json

source <(jq -r "to_entries|map(\"\(.key)=\(.value|tostring)\")|.[]" $metadata)
@rjhowe
rjhowe / haproxy-config.template
Last active October 7, 2019 17:26
harproxy template with header logging
{{/*
haproxy-config.cfg: contains the main config with helper backends that are used to terminate
encryption before finally sending to a host_be which is the backend that is the final
backend for a route and contains all the endpoints for the service
*/}}
{{- define "/var/lib/haproxy/conf/haproxy.config" }}
{{- $workingDir := .WorkingDir }}
{{- $defaultDestinationCA := .DefaultDestinationCA }}
{{- $dynamicConfigManager := .DynamicConfigManager }}
{{- $router_ip_v4_v6_mode := env "ROUTER_IP_V4_V6_MODE" "v4" }}