Skip to content

Instantly share code, notes, and snippets.

@cdoan1
cdoan1 / downstream-icsp.yaml
Last active July 14, 2020 02:56
downstream-icsp
---
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
name: rhacm-repo
spec:
repositoryDigestMirrors:
- mirrors:
- quay.io:443/acm-d
source: registry.redhat.io/rhacm2
@cdoan1
cdoan1 / determine-mch-digest.sh
Created July 16, 2020 18:54
get the version of RHACM or OCM deployment
#!/bin/bash
# right now, the best way to correlate a deployment to version
# is through the mch pod image digest
oc get deployment multiclusterhub-operator \
-n open-cluster-management \
-o jsonpath='{.spec.template.spec.containers[].image}'
@cdoan1
cdoan1 / bma-list.csv
Created July 17, 2020 13:22
baremetal list
hostName hostNamespace bmcAddress macAddress role username password
h29-master-1-0 ocp-bm ipmi://192.168.124.1:6235 52:54:00:9f:f0:a5 master admin password
h29-master-1-1 ocp-bm ipmi://192.168.124.1:6236 52:54:00:eb:cf:94 master admin password
h29-master-1-2 ocp-bm ipmi://192.168.124.1:6237 52:54:00:a9:b2:08 master admin password
h29-worker-1-0 ocp-bm ipmi://192.168.124.1:6238 52:54:00:59:45:57 worker admin password
h29-worker-1-1 ocp-bm ipmi://192.168.124.1:6239 52:54:00:c6:7a:3f worker admin password
@cdoan1
cdoan1 / rhacm_migrate_1x_2x.md
Created July 30, 2020 03:39
Migrate 1.x to 2.x

Migrating from version 1.x to version 2.0

If you plan to migrate from the technology preview version of {product-name-short} (1.x) to the generally available version (2.0), you must uninstall version 1.0 and then install version 2.0 as a clean installation. Upgrading directly from the product technology preview version 1.x of {product-title} to version 2.0 is not supported.

Complete the following steps to migrate from version 1.x to version 2.0:

  1. Detach each of your managed clusters from your {product-title-short} hub cluster before uninstalling the version 1.x. See Removing a cluster from management for instructions that explain how to remove the managed clusters.

  2. Uninstall {product-title-short} version 1.x by completing the procedure in Uninstalling.

@cdoan1
cdoan1 / create-import-manifest.yaml
Created August 6, 2020 12:56
2.0 create and import manifest
---
apiVersion: hive.openshift.io/v1
kind: ClusterDeployment
metadata:
name: {{ .ManagedClusterName }}
namespace: {{ .ManagedClusterName }}
labels:
cloud: {{ .ManagedClusterCloud }}
region: {{ .ManagedClusterRegion }}
vendor: {{ .ManagedClusterVendor }}
@cdoan1
cdoan1 / 00-create-thanos-configmap.sh
Created August 6, 2020 14:57
register thanos cm
#!/bin/bash
export CID=$(oc get clusterversion -o jsonpath='{.items[].spec.clusterID}{"\n"}')
export URL=https://
cat > cm-$CID.yaml <<EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
@cdoan1
cdoan1 / recreate-multicloud-ca-cert.sh
Last active December 4, 2020 01:33
RHACM 2.1 create multicloud-ca-cert
#!/bin/bash
#
# manually recreate the Issuers and Certificates
# for cert-manager
#
# WHEN to use this script
# * when console-header fails to start because multicloud-ca-cert is missing
# * when Issuers and Certificates are not present
#
# This script will create the Issuers/Certificates, and cause the multicloud-ca-cert to be
@cdoan1
cdoan1 / openstack-acm-hive.sh
Last active February 2, 2021 15:45
Create OCP Cluster in OpenStack via RHACM
#!/bin/bash
#
# Refer to the `hiveutil` documenation for a complete argument listing see:
# https://github.com/openshift/hive/blob/master/docs/hiveutil.md
#
# or, hiveutil -help
#
# here, we're using an example external network, and getting a FIP
EXTERNAL_NETWORK=provider_net_cci_9
FIP=$(openstack floating ip create $EXTERNAL_NETWORK)
parameter description examples
apiVIP The VIP to use for internal API communication.
bootMACAddress The MAC address of the NIC the host will use to boot on the provisioning network. It must be unique.
bootstrapOSImage A URL to override the default operating system image for the bootstrap node. The URL must contain a sha256 hash of the image. https://mirror.example.com/images/qemu.qcow2.gz?sha256=a07bd...
clusterOSImage A URL to override the default operating system for cluster nodes. The URL must include a sha256 hash of the image. https://mirror.example.com/images/metal.qcow2.gz?sha256=3b5a8...
externalBridge The name of the bridge on the hypervisor attached to the external network. baremetal
ingressVIP The VIP to use for ingress traffic.
libvirtURI The location of the hypervisor for running the bootstrap VM. qemu://localhost/system
provisioningBridge The name of the bridge on the hypervisor attached to
@cdoan1
cdoan1 / generate-update-issuer-cert-manifest.sh
Last active December 4, 2020 16:02
Update certificate from cert-manager certificate
#!/bin/bash
# manually recreate the Issuers and Certificates for cert-manager
NS=${NS:-open-cluster-management}
CLUSTER=${CLUSTER:-mycluster}
BASE_DOMAIN=${BASE_DOMAIN:-mydomain.com}
APPLICATION_UI_DEPLOYMENT=$(oc get deployment -n $NS | grep applicationui | awk '{print $1}')
CONSOLE_CHART=$(oc get helmrelease -A | grep console | awk '{print $2}')