+-----------------------+ +-------------------+ +-------------------+ +--------------------+
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| Managed Cluster -------------------- BIG IP -------------- API --------| HUB |
| | | WAF | | Gateway | | |
| | | | | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mask() { | |
local n=8 # number of chars to leave | |
local a="${1:0:${#1}-n}" # take all but the last n chars | |
local b="${1:${#1}-n}" # take the final n chars | |
printf "%s%s\n" "${a//?/*}" "$b" # substitute a with asterisks | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# use this script to force the certiifcate renew for the default ingress certificate of a hcp. | |
# | |
function convert() { | |
echo $(date -d "$1" "+%s") | |
} | |
function dlog() { | |
echo $(date -u +"%Y-%m-%d-%I:%M:%S") $1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
node=${1} | |
list=$(oc get hc -A --sort-by=.metadata.creationTimestamp -ojson \ | |
| jq -r '.items[] | select(.metadata.name | contains("sdq")) | .metadata.name,.metadata.creationTimestamp,.metadata.namespace') | |
ma=($list) | |
for ((i=0;i<${#ma[@]};i+=3)) | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
oc patch mch multiclusterhub -n multicluster-hub --type=merge \ | |
-p "{\"spec\":{\"overrides\":{\"components\":[{\"name\":\"cluster-backup\",\"enabled\":true}]}}}" | |
oc patch mce multiclusterengine -n multicluster-engine --type=merge \ | |
-p "{\"spec\":{\"overrides\":{\"components\":[{\"name\":\"managedserviceaccount-preview\",\"enabled\":true}]}}}" | |
BACKUP_NS=openshift-velero | |
SECRET_NAME=velero-iam-credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function convert() { | |
echo $(date -d "$1" "+%s") | |
} | |
function dlog() { | |
echo $(date -u +"%Y-%m-%d-%I:%M:%S") $1 | |
} | |
for certificate in $(oc get certificate -n default -o name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get CRD sorted | |
oc get crd -A --sort-by=.metadata.creationTimestamp | |
# inline template | |
oc get route keycloak --template "http://{{.spec.host}} " | |
# Enable DEX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
oc get deployment \ | |
| grep -v "NAME" \ | |
| awk '{print $1}' \ | |
| xargs -I % sh -c 'echo %; oc get deployment % -o yaml | grep "sre-registry"' | |
oc get deployment \ | |
| grep -v "NAME" \ | |
| awk '{print $1}' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
imageContentSources: | |
- mirrors: | |
- quay.io:443/acm-d | |
source: registry.redhat.io/rhacm2 | |
- mirrors: | |
- registry.redhat.io/openshift4/ose-oauth-proxy | |
source: registry.access.redhat.com/openshift4/ose-oauth-proxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def delta_sn(a, b): | |
d1 = datetime.strptime(a, '%Y-%m-%dT%H:%M:%SZ') | |
d2 = datetime.strptime(b, '%Y-%m-%dT%H:%M:%SZ') | |
diff = (d2 - d1).total_seconds() / 60 | |
return round(diff, 1) | |
def calculate_rate(attribute_name): | |
a0 = ds8[(ds8[attribute_name] > 0)] | |
a0_max = ds8[(ds8[attribute_name] == ds8[attribute_name].max())] |
NewerOlder