Skip to content

Instantly share code, notes, and snippets.

View sallyom's full-sized avatar

Sally O'Malley sallyom

View GitHub Profile
See the tutorial below.
@sallyom
sallyom / build-kn.sh
Created October 19, 2023 15:13
binary-image-ex
#!/usr/bin/env bash
set -o errexit
# Create a container
container=$(buildah from alpine)
# Run this from wherever the built binaries are available
buildah config --label maintainer="Sally O'Malley <somalley@redhat.com>" $container
@sallyom
sallyom / cluster-monitoring-resources.yaml
Created September 11, 2023 16:11
role,rolebinding,service-monitor
apiVersion: v1
kind: Namespace
metadata:
name: rekor-system
labels:
openshift.io/cluster-monitoring: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
@sallyom
sallyom / describe-node
Last active December 16, 2022 14:45
oc describe node
$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
devtmpfs devtmpfs 3.8G 0 3.8G 0% /dev
tmpfs tmpfs 3.8G 0 3.8G 0% /dev/shm
tmpfs tmpfs 3.8G 25M 3.8G 1% /run
/dev/mapper/rhel-root xfs 70G 5.4G 64G 8% /
/dev/vda1 xfs 794M 214M 581M 27% /boot
/dev/vda2 vfat 200M 8.0K 200M 1% /boot/efi
tmpfs tmpfs 777M 0 777M 0% /run/user/1000
----------------------------------------------------------
@sallyom
sallyom / e2e-test.sh
Last active May 9, 2022 21:18
test script to run sigstore integration tests with skopeo's `make sigstore-testenv-up`
#!/bin/bash
### Run `make sigstore-testenv-up` from local checkout of containers/skopeo before running this script.
### This script must run from local checkout of sigstore/sigstore
set -ex
echo "running tests"
export VAULT_TOKEN=testtoken
# This is an example configTarget that is used in testing.
# Harpoon will start with this config then will load targets from ./examples/config-reload.yaml
targets:
- name: config
methods:
configTarget:
configUrl: https://raw.githubusercontent.com/sallyom/harpoon/config-upload/examples/config-reload.yaml
schedule: "*/1 * * * *"
@sallyom
sallyom / section-in-bashrc
Last active March 21, 2022 17:09
fancy git terminal prompt to place in ~/.bashrc
# Helper function for fancy git prompt.
# Place this in ~/.bashrc
# Then, `source ~/.bashrc` will execute the prompt function w/out having to reboot
# (otherwise, any ~/.bashrc settings take effect with every reboot.
# Lines 7-38 go in ~/.bashrc
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@sallyom
sallyom / microshift-install-volsync
Last active December 17, 2021 15:37
microshift instance, configure storage and install volsync operator
mkdir ~/.kube && sudo cp /var/lib/microshift/resources/kubeadmin/kubeconfig ~/.kube/config
sudo chown -R ec2-user:ec2-user ~/.kube
curl -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz
tar -xzvf oc.tar.gz
sudo install -t /usr/local/bin oc
rm oc.tar.gz oc kubectl README.md
SNAPSHOTTER_VERSION=v4.2.1
# Change to the latest supported snapshotter version
@sallyom
sallyom / enable-cgroups-v2-centos8
Created September 22, 2021 13:59
Steps to enable cgroups v2 in centos 8, fedora
1. Edit /etc/default/grub
- Append `systemd.unified_cgroup_hierarchy=1` to line `GRUB_CMDLINE_LINUX=`
2. Generate grub config file
```shell
grub2-mkconfig -o /boot/grub2/grub.cfg
```
3. reboot
@sallyom
sallyom / scribe-config.yaml
Created April 19, 2021 19:03
$ cat scribe-config.yaml
---
dest-access-mode: ReadWriteOnce
dest-namespace: dest
dest-copy-method: Snapshot
source-pvc: mysql-pv-claim
source-copy-method: Snapshot
source-namespace: source
dest-service-type: LoadBalancer
source-service-type: LoadBalancer
source-cron-spec: '*/2 * * * *'