Skip to content

Instantly share code, notes, and snippets.

@cdoan1
cdoan1 / README.md
Last active August 30, 2021 14:15
argocdCluster
@cdoan1
cdoan1 / resource-scan-2.sh
Last active June 18, 2021 17:22
AppSub Testing
datestring() {
sdate=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" $1 "+%s")
edate=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" $2 "+%s")
delta=$(( (edate - sdate) / 60 ))
echo "$delta"
}
extract() {
appsub_name_local=$1
@cdoan1
cdoan1 / downstream-mirror.md
Last active May 25, 2021 14:56
rhacm-downstream-mirror-2

Start with the custom registry, which is an index image containing multiple release packages. Find the corresponding bundle image name associated to release 2.3.0.

podman run --name custom-registry --rm -p 50051:50051 \
quay.io/acm-d/acm-custom-registry:2.0.11-DOWNSTREAM-2021-05-21-21-35-58

grpcurl -plaintext  localhost:50051 api.Registry/ListBundles | jq '.bundlePath' | grep 2.3.0

Create and index image from the bundle.

@cdoan1
cdoan1 / rhacm-downstream-mirror.md
Last active May 20, 2021 14:59
Mirror Downstream Images

Mirror RHACM Downstream

In order to mirror the downstream images, we need to get the image lists from the index image. There are a number of ways to do this, but probably the simplest way, is to generate a mapping.txt file fromt he index image and oc image mirror.

mapping.txt method

  1. Generate the mapping.txt file.
@cdoan1
cdoan1 / README.md
Last active April 26, 2021 14:54
https proxy docker setup with signed certificate (letsencrypt)

Readme

  1. example 1, deploy simple http proxy on http
  2. example 2, deploy squid proxy, with SSL bump configuration, to allow proxying https content, encrypted with private.key

It is easy to stand up an http proxy. But to configure openshift cluster wide proxy, the proxy server has to be trusted.

@cdoan1
cdoan1 / README.md
Last active April 22, 2021 17:32
active-standby

DR

Is it possible to test / verify moving managed cluster data from one hub to another? Or, create a cluster, then "remove" the data on the hub, and recreate it in place?

  1. have a hub with a managed cluster created through cli/manifests
  2. remove the data from the hub
  3. put the data back on the hub

Clusters

@cdoan1
cdoan1 / post-deploy-report.sh
Last active April 14, 2021 20:26
post-deployment-reporting
#!/bin/bash
# collect a record of all the running pods
for NS in `oc get namespace | grep open-cluster | awk '{print $1}'`
do
oc get pods -n $NS >> temp.txt
done
# report the total number of pods in ACM
number_pods=$( cat temp.txt | grep -v NAME | wc -l | awk '{print $1}' )

Sizing Worksheet

I am writing this article to document data related to sizing classification for RHACM 2.2 deployments.

We define three generic size classifications, based on the number of managed clusters under management.

Then, we deploy RHACM 2.2 into each of the size classifications, and measure the system based on the workload.

Today, we will keep the workload very generic.

@cdoan1
cdoan1 / install-observability.sh
Last active April 23, 2021 13:59
Deploy Observability
#!/bin/bash
NS=${NS:-open-cluster-management-observability}
# step 1
oc create namespace $NS
# step 2
# NOTE: the warning for export is just a warning, not an error
oc get secret multiclusterhub-operator-pull-secret -n open-cluster-management --export -o yaml | oc apply -n $NS -f -
@cdoan1
cdoan1 / clusterdeployment.yaml
Created February 22, 2021 23:32
featureGate example
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
creationTimestamp: null
labels:
hive.openshift.io/hiveutil-created: "true"
name: fgt
spec:
baseDomain: demo.red-chesterfield.com
clusterName: fgt