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 | |
# | |
# This script takes a sitconfig file and it will move | |
# for each node | |
# the nodeNetwork section into a separated NMStateconfig | |
# | |
# It can be helpful to reduce a siteconfig file, moving | |
# the network configuration to separate NMStateconfig files | |
# Then everything will be merged together with ArgoCD | |
# to start a deployment |
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 all the policies ordered by ztp-wave: | |
$> oc -n <CLUSTER_NAME> get policies -o json | jq -r '.items[] | "Policy: " + .metadata.name + " on wave: " + .metadata.annotations."ran.openshift.io/ztp-deploy-wave"' | sort -g -t ":" -k 3 |
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 | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: ./script.sh <CGU-NAME> <CLUSTER-NAME>" | |
exit 1 | |
fi | |
export CGUNAME=$1 | |
export CLUSTERNAME=$2 |
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 | |
# | |
echo "Execute the command from a directory containing a Git repo of the assisted-agent" | |
echo "Also, exports a proper KUBECONFIG to your Openshift cluster with RHACM installed" | |
IMAGE=`oc -n open-cluster-management get deployment infrastructure-operator -o yaml | grep assisted-installer-agent-rhel8 | grep value | awk '{print $2}'` | |
echo "#########################################" | |
echo "Assisted Agent image is: $IMAGE" |
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 | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: ./script.sh <NAMESPACE> <HOSTNAME_1> ... <HOSTNAME_N>" | |
exit 1 | |
fi | |
export CLUSTERNS=$1 | |
export HOSTNAME=$2 |
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
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: hello | |
labels: | |
app: hello | |
namespace: test | |
spec: | |
serviceAccount: testuser | |
serviceAccountName: testuser |
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 | |
if [ -z "$CHANNEL" ] | |
then | |
echo Provide the channel via \'export CHANNEL=stable-4.x\' | |
exit 1 | |
fi | |
rm -f version_maps &> /dev/null | |
VERSIONS=$(curl -sH 'Accept: application/json' "https://api.openshift.com/api/upgrades_info/v1/graph?channel=${CHANNEL}" | jq '.nodes[].version' -r) |
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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: reproducer-sync-waves | |
annotations: | |
argocd.argoproj.io/sync-wave: "0" | |
spec: {} | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: |
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 | |
# | |
echo "Execute the command from a directory containing a Git repo of the assisted-service" | |
echo "Also, exports a proper KUBECONFIG to your Openshift cluster with RHACM installed" | |
IMAGE=`oc -n multicluster-engine get deployment infrastructure-operator -o yaml | grep agent-service-rhel8 | grep image | awk '{print $2}'` | |
echo "#########################################" | |
echo "Assisted service image is: $IMAGE" |
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
# It returns all the BMH of an spoke cluster | |
# and its corresponding Agent | |
# it could be useful when scaling down a cluster with ZTP | |
# ZTP only controls (and delete) the BMH object | |
# but the Agent is not under the Gitops control | |
# and it has to be manually deleted | |
oc -n <SPOKE_CLUSTER_NS> get Agent.agent-install.openshift.io -o json \ | |
| jq '.items[].metadata | "BMH resource: " + .labels."agent-install.openshift.io/bmh" + " with Agent: " + .name ' |
NewerOlder