Skip to content

Instantly share code, notes, and snippets.

View sallyom's full-sized avatar

Sally O'Malley sallyom

View GitHub Profile
@sallyom
sallyom / time-skew.sh
Last active February 9, 2021 15:44
testing with OpenShift nested libvirt cluster and setting time ahead 370 days
#!/bin/bash
set -euxo pipefail
final-check () {
if
! oc wait co --all --for='condition=Available=True' --timeout=20s 1>/dev/null || \
! oc wait co --all --for='condition=Progressing=False' --timeout=20s 1>/dev/null || \
! oc wait co --all --for='condition=Degraded=False' --timeout=20s 1>/dev/null; then
echo "Some ClusterOperators Degraded=True,Progressing=True,or Available=False"
@sallyom
sallyom / create-cluster-gcp-mirrord-local-registry.sh
Last active October 5, 2020 20:25
libvirt nested OpenShift4 cluster in single gcp instance with mirrored registry: latest nightly build
#!/bin/bash
NAME="$1"
if [ -z "$NAME" ]; then
echo "usage: create-cluster <name>"
exit 1
fi
CLUSTER_DIR="${HOME}/clusters/${NAME}"
if [ -d "${CLUSTER_DIR}" ]; then
@sallyom
sallyom / local-registry-10-yr-cert-with-SAN.sh
Last active August 15, 2022 17:43
set up a local registry at localhost:5000 (or gcp hostname if in gcp instance uncomment L5, comment L6) with SAN cert good for 10yrs
#!/bin/bash
set -euxo pipefail
trap "rm -rf create-registry-certs" EXIT
# Set up local registry with long-lived certs with SAN
# if in gcp instance
#HOSTNAME=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/hostname" -H "Metadata-Flavor: Google")
HOSTNAME=localhost
sudo dnf -y install podman httpd httpd-tools make
## OpenShift4 pull-secret:
1. Download your pull-secret from [console.redhat.com](https://console.redhat.com/openshift/install/aws/installer-provisioned)
- click on “Download Pull Secret”. Save it somewhere, e.g. ~/some-dir/pull-secret
2. Add the apps.ci auth to pull-secret! _internal OpenShift developers only_
- Obtain an API token by visiting https://oauth-openshift.apps.ci.l2s4.p1.openshiftapps.com/oauth/token/request
copy the oc login cmd and paste in terminal to login to the ci cluster, then run this:
- `$ oc registry login --to ~/some-dir/pull-secret`
This will append the auth from registry.ci.openshift.org to your cloud.openshift.com pull-secret but it will also
make the pull-secret multi-line.
@sallyom
sallyom / containers-tools-resources
Last active April 28, 2020 21:06
containers tools resources
Thank You!!
Resources
CRI-O
https://github.com/cri-o/cri-o
https://cri-o.io
Buildah
https://github.com/containers/buildah
https://buildah.io
@sallyom
sallyom / podman-generate-systemd.sh
Last active April 28, 2020 21:17
this script will start a podman container and create a systemd service from it, then show systemctl start/stop the.service starts/stops the container
#!/bin/sh
# Setting up some colors for helping read the demo output.
bold=$(tput bold)
bright=$(tput setaf 14)
yellow=$(tput setaf 11)
reset=$(tput sgr0)
# commands
read_bright() {
#!/bin/bash
trap 'exit 0' INT
# Setting up some colors for helping read the demo output.
# Comment out any of the below to turn off that color.
bold=$(tput bold)
blue=$(tput setaf 4)
reset=$(tput sgr0)
@sallyom
sallyom / service-ca-demo.sh
Last active May 29, 2019 20:31
script that demos features of service-ca-operator
#!/bin/sh
# service-ca-demo.sh demo script.
# This script will demonstrate features of service-ca-operator
# Prerequisite: A running OpenShift 4.x cluster
# Setting up some colors for helping read the demo output.
# Comment out any of the below to turn off that color.
bold=$(tput bold)
bright=$(tput setaf 14)
@sallyom
sallyom / crt-append.sh
Last active September 16, 2019 09:18
append router-ca to kubeconfig
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
####################################################################################
# This is no longer required, only the idp.sh is required to configure htpasswd idp
# HOWEVER, if your install fails and cluster is functional enough to configure
# idp and/or login with kubeadmin, you'll need to run this to avoid x509 error
@sallyom
sallyom / idp.sh
Last active February 21, 2019 14:36
okd-configure-htpasswd
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# not sure this is still necessary, but can't hurt...
# kick the console pods because they cache oauth metadata (temporary, should not be required)
oc delete pods -n openshift-console --all --force --grace-period=0