Skip to content

Instantly share code, notes, and snippets.

@zonggen
zonggen / cleanup.sh
Created January 24, 2022 20:36
Verify RBAC Restriction With Namespace Scoped CRD `ProjectHelmChartRepository`
#!/usr/bin/env bash
oc delete secret/htpasswd-consoledeveloper-basic-sec1 -n openshift-config
oc delete role/helm-crd-role
oc delete rolebinding/consoledeveloper-basic-role
oc delete user/consoledeveloper-basic
# In addition, make sure to manually clean up the testing CR
@zonggen
zonggen / 0000_10-project-helm-chart-repository.crd.yaml
Last active November 5, 2021 19:40
Namespace-scoped Helm Respository CRD
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: projecthelmchartrepositories.helm.openshift.io
spec:
scope: Namespaced
preserveUnknownFields: false
group: helm.openshift.io
names:
kind: ProjectHelmChartRepository
@zonggen
zonggen / README.md
Last active September 30, 2021 06:29
How to Run OpenShift Helm Certification Test Workflow from Your Fork

How to Run OpenShift Helm Certification Test Workflow from Your Fork

Prerequisites

  1. Have a running test cluster in order for chart-verifier to run checks
  2. Have a Personal Access Token (PAT) that has write access to the sandbox repository: https://github.com/openshift-helm-charts/sandbox
  3. Your Github ID is under "approvers" list in "OWNERS" file on "main" branch of your fork in order to run tests (defined here: https://github.com/openshift-helm-charts/development/blob/main/scripts/src/workflowtesting/checkprforci.py#L52)

Steps

@zonggen
zonggen / NOTE.md
Created August 3, 2020 02:16
RHCSA brain dump

Users:

  • /etc/sudoers(.d)
  • /etc/passwd
  • useradd
  • usermod
  • userdel -r
  • passwd

Groups:

  • /etc/group
@zonggen
zonggen / fcos-installer
Created April 15, 2020 18:49
Install Fedora CoreOS by running `coreos-installer` directly on block device `/dev/loop0`
#!/usr/bin/env bash
function create_ign_file() {
cat >> base3.ign <<EOF
{
"ignition": {
"version": "3.0.0"
},
"passwd": {
"users": [
@zonggen
zonggen / cosa
Last active April 15, 2020 19:09
Quick start on CoreOS Assembler and Fedora CoreOS
#!/usr/bin/env bash
# this script will use podman, but docker will work too
rpm -qa | grep -q podman || (echo "podman not installed!" ; exit 1)
# checks if cosa image was pulled previously
podman image exists quay.io/coreos-assembler/coreos-assembler || \
podman pull quay.io/coreos-assembler/coreos-assembler
# create a tmp directory for storing builds
@zonggen
zonggen / gitdiff.md
Last active March 9, 2020 20:04
Customized RHCOS Pipeline
diff --git a/Makefile b/Makefile
index 6c55e9c..9d22dfa 100644
--- a/Makefile
+++ b/Makefile
@@ -17,6 +17,6 @@ Job Git URL: $(SPEC_URL)\n"
 .PHONY: publish
 publish:
 	oc process -f pipeline.yaml \
-	    --param=SPEC_REF=$(SPEC_REF) \
@zonggen
zonggen / note.txt
Created February 20, 2020 19:39
MCO concept
MCO | MCC -> MC (Ignition configs, FIPS, kernel types, kernel args, etc)
| MCD -> file management (one daemon for each node)
| MCS -> Machine config server
Two types of Machine Configs: worker / master
For a cluster of 6 nodes(3 masters, 3 workers), in order to add a Machine Config
to change kernel type to RT kernel for workers:
Assuming three MC's are available in the cluster:
@zonggen
zonggen / note.md
Last active February 20, 2020 19:29
Add repo for rpm-ostree

Drop in repos into /etc/yum.repos.d/. You can use the same ones RHCOS uses for composes: https://gitlab.cee.redhat.com/coreos/redhat-coreos/blob/master/rhel8.repo

Or alternatively, if the pkgs don't have any deps, you can just rpm-ostree install <URL>

e.g. rpm-ostree install http://download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/authselect/1.1/2.el8/x86_64/authselect{,-libs}-1.1-2.el8.x86_64.rpm

@zonggen
zonggen / procedure.md
Created February 18, 2020 21:54
Debug in master node using crc
$ crc start
$ crc login
$ oc get nodes
NAME                 STATUS   ROLES           AGE   VERSION
crc-2n9vw-master-0   Ready    master,worker   88d   v1.14.6+6ac6aa4b0

$ oc debug node/crc-2n9vw-master-0
Starting pod/crc-2n9vw-master-0-debug ...
To use host binaries, run `chroot /host`