Skip to content

Instantly share code, notes, and snippets.

View awgreene's full-sized avatar

Alexander Greene awgreene

  • Red Hat
  • Ruston, WA
View GitHub Profile
@awgreene
awgreene / README.md
Last active October 19, 2022 21:01
Rukpak Demo

RukPak Demo

This demo showcases how to install the prometheus operator with RukPak!

Prerequisites

Install Cert Manager

$ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.0/cert-manager.yaml
@awgreene
awgreene / ExploreBundleImage.sh
Created May 4, 2021 00:12
Allows you to explore the content in a bundle
#!/bin/bash
tmp_dir=$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')
cd $tmp_dir
trap 'rm -rf -- "$tmp_dir"' EXIT
docker save $1 -o manifest.tar
tar -xf manifest.tar
cd $(ls -d */|head -n 1)
mkdir contents
tar -xf layer.tar -C contents
@awgreene
awgreene / myKind.crd.yaml
Created November 27, 2019 19:40
My kind has a single field that can be an int or a string.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
creationTimestamp: null
name: mykinds.operators.coreos.com
spec:
group: operators.coreos.com
names:
kind: MyKind
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: clusterserviceversions.operators.coreos.com
spec:
group: operators.coreos.com
names:
@awgreene
awgreene / csv.yaml
Last active November 27, 2019 18:57
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.2.4
creationTimestamp: null
name: clusterserviceversions.operators.coreos.com
spec:
group: operators.coreos.com
names:
apiVersion: v1
kind: ServiceAccount
metadata:
name: keda-operator
namespace: openshift-operators
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: scaledobjects.keda.k8s.io
// A custom HTTPClient is used here since the default HTTPClients ProxyFromEnvironment
// uses a cache which won't let us update the proxy env vars
sess, err := session.NewSession(&aws.Config{
Credentials: credentials.NewStaticCredentials(cfg.AccessKey, cfg.SecretKey, ""),
Region: &d.Config.Region,
Endpoint: &d.Config.RegionEndpoint,
HTTPClient: &http.Client{
Transport: &http.Transport{
Proxy: func(req *http.Request) (*url.URL, error) {
return httpproxy.FromEnvironment().ProxyFunc()(req.URL)
```
apiVersion: v1beta3
baseDomain: devcluster.openshift.com
metadata:
name: cluster
platform:
platform:
aws:
region: us-east-1
proxy:
@awgreene
awgreene / automated-openshift-installer.sh
Last active June 20, 2019 20:48
This script downloads and runs the OpenShift installer associated with the provided tag.
#!/bin/bash
# This script downloads and runs the OpenShift installer associated with the provided tag.
echo 'Select a tag from https://openshift-release.svc.ci.openshift.org to download and run...'
read -p 'Openshift Tag: ' TAG
oc adm release extract --command=openshift-install registry.svc.ci.openshift.org/ocp/release:$TAG
export DIR_NAME=cluster-0
export LOG_LEVEL=debug

Pinning an Openshift Version

  1. Deploy a OpenShift Cluster and make sure it is stable.

  2. Get the clusterversion:

$ oc get clusterversion
NAME      VERSION                           AVAILABLE   PROGRESSING   SINCE     STATUS
version   4.0.0-0.alpha-2019-01-29-032610   True        False         23h       Cluster version is 4.0.0-0.alpha-2019-01-29-032610