Skip to content

Instantly share code, notes, and snippets.

View rcarrata's full-sized avatar
🥋

Roberto Carratalá rcarrata

🥋
View GitHub Profile
@rcarrata
rcarrata / hcp-rosa.md
Last active April 16, 2024 21:14
Hosted Control Planes for ROSA HCP

HyperShift

  • Set environment variables
CLUSTER_NAME="rosa-hcp-rcs"
PREFIX_NAME="hcp-rcs"
REGION="us-east-1"
VERSION="4.14.9"
USER=rcarrata
@rcarrata
rcarrata / aro4_install.sh
Last active January 17, 2024 10:52
Aro OCP4 quickly installation
#!/bin/bash
## USAGE
function usage() {
echo
echo "Usage:"
echo " $0 [command] [options]"
echo " $0 --help"
echo
echo "Example:"
@rcarrata
rcarrata / regenerate-kubeconfig.sh
Last active October 27, 2023 19:27
Script for regenerating the kubeconfig for system:admin user
#!/bin/bash
AUTH_NAME="auth2kube"
NEW_KUBECONFIG="newkubeconfig"
echo "create a certificate request for system:admin user"
openssl req -new -newkey rsa:4096 -nodes -keyout $AUTH_NAME.key -out $AUTH_NAME.csr -subj "/CN=system:admin"
echo "create signing request resource definition"
@rcarrata
rcarrata / appgw_aro.md
Created July 18, 2023 08:32
Application GW Load Balancer in ARO

Application GW Load Balancer in ARO

  • Set environment variables useful for this guide:
export NAMESPACE=aro-agw
export AZR_CLUSTER=aro-$USER
export AZR_RESOURCE_LOCATION=eastus
export AZR_RESOURCE_GROUP=aro-$USER-rg
export AppGW_CIDR="10.0.10.0/23"
@rcarrata
rcarrata / hibernate.md
Last active July 22, 2022 10:15
Hibernate Clusters with OpenShift Cluster Manager (OCM)
@rcarrata
rcarrata / check_certs.sh
Created June 14, 2022 15:05
Check Certificates from OpenShift 4
#!/bin/bash
API=$(oc whoami --show-server | cut -d '/' -f3-)
APPS=$(oc whoami --show-console | cut -d '.' -f2-)
APPS_ROUTE="*.$APPS:443"
echo "## Certificate for $APPS_ROUTE"
echo | openssl s_client -connect $APPS_ROUTE | openssl x509 -noout -text
echo "--------------------------------"
echo ""
@rcarrata
rcarrata / enable_osd_gcp_apis.sh
Last active April 27, 2022 10:33
Enable APIs in GCP for OpenShift Dedicated installation
# Enable APIs OSD in GCP
# based in https://docs.openshift.com/dedicated/osd_planning/gcp-ccs.html#ccs-gcp-customer-procedure_gcp-ccs
# Set your GCP project
PROJECT_ID="mygcp-project"
echo "# Setting your $PROJECT_ID GCP project"
gcloud config set project $PROJECT_ID
# Enable required APIs in GCP
apis=("deploymentmanager.googleapis.com" "compute.googleapis.com" "cloudapis.googleapis.com" \
@rcarrata
rcarrata / ocs4-example
Last active February 7, 2022 07:51
Openshift Container Storage 4 Examples
#
# Namespace used for sandboxing
#
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: demo-ocs-workloads
@rcarrata
rcarrata / upgrade-4.9.sh
Created November 8, 2021 18:09
Upgrade OCP to 4.9
#!/bin/bash
# Set up a the patch for upgrade towards 4.9 safely
# Check https://access.redhat.com/articles/6329921 for more information
oc -n openshift-config patch cm admin-acks --patch '{"data":{"ack-4.8-kube-1.22-api-removals-in-4.9":"true"}}' --type=merge
# Change the channel to the Fast 4.9 (Stable 4.9 not available at this moment
oc patch clusterversion version --type="merge" -p '{"spec":{"channel":"fast-4.9"}}'
# Upgrade towards the latest
@rcarrata
rcarrata / pods-example.sh
Last active October 14, 2021 13:52
Networking Example - hostNetwork | hostPID | hostIPC | hostPort | NodePort | Capabilities examples
#### Prereqs
kubectl create ns influx
oc adm policy add-scc-to-user anyuid -z default -n influx
#### HostNetwork
# pods in the host network of a node can communicate with all pods on all nodes without NAT
# Not using a separated network namespace. The pod will see the entire ip stack
# https://kubernetes.io/docs/concepts/cluster-administration/networking/#the-kubernetes-network-model
cat <<EOF > /tmp/influxdb-hostnetwork.yaml