Skip to content

Instantly share code, notes, and snippets.

Avatar

Roberto Carratala rcarrata

View GitHub Profile
@rcarrata
rcarrata / aro4_install.sh
Last active Mar 9, 2021
Aro OCP4 quickly installation
View aro4_install.sh
#!/bin/bash
## USAGE
function usage() {
echo
echo "Usage:"
echo " $0 [command] [options]"
echo " $0 --help"
echo
echo "Example:"
View gist:a93598e8ddda971c532ee118255f08f8
#!/bin/bash
# Install Golang
wget https://dl.google.com/go/go1.15.2.linux-amd64.tar.gz
tar -xvf go1.15.2.linux-amd64.tar.gz
mv go /usr/local
export GOROOT=/usr/local/go
export GOPATH=$HOME
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
go version
@rcarrata
rcarrata / regenerate-kubeconfig.sh
Created Jan 20, 2021
Script for regenerating the kubeconfig for system:admin user
View regenerate-kubeconfig.sh
#!/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/O=system:masters"
echo "create signing request resource definition"
@rcarrata
rcarrata / kubernetes_service_session_affinity.md
Created Oct 2, 2020 — forked from fjudith/kubernetes_service_session_affinity.md
Enable Session Affinity (a.k.a Sticky Session) to Kubernetes service
View kubernetes_service_session_affinity.md
@rcarrata
rcarrata / metal_aws_machineset.sh
Created Aug 5, 2020
Machineset for create bare metal nodes in AWS
View metal_aws_machineset.sh
#!/usr/bin/env bash
export REGION="eu-west-1"
export AZS="${REGION}a ${REGION}b ${REGION}c"
export FLAVOR="m5.metal"
MACHINESET_PREFIX=$(oc get machineset -n openshift-machine-api -o json| jq '.items[0].metadata.labels."machine.openshift.io/cluster-api-cluster"' | tr -d '""')
for AZ in ${AZS}; do
export NAME="${MACHINESET_PREFIX}-metal-${AZ}"
@rcarrata
rcarrata / k8s-tower.yaml
Created Jul 16, 2020
Playbook for solve the issue in Tower of pip install openshift / kubernetes
View k8s-tower.yaml
#!/usr/bin/env ansible-playbook
# Installs the company specific virtual environments for Python properly
# into the Tower environment following the Ansible Tower environment notes:
# URL: https://docs.ansible.com/ansible-tower/3.3.4/html/upgrade-migration-guide/virtualenv.html
#
# NOTE: Requires the EPEL repository to install the python2-pip package.
#
# Usage:
# $ sudo ./setup_venvs.yml -i inventory.sand_swn01.ini
#
View check_port.py
#!/usr/bin/python
import socket
import time
retry = 2
delay = 1
timeout = 1
ips = {}
@rcarrata
rcarrata / ocs4-example
Last active Feb 7, 2020
Openshift Container Storage 4 Examples
View ocs4-example
#
# Namespace used for sandboxing
#
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: demo-ocs-workloads
View workaround_tower_repos_aws.sh
#!/bin/bash
## Workaround for fix the bug
## https://github.com/ansible/workshops/pull/498/files
sudo yum-config-manager --disable rhui-REGION-rhel-server-extras
sudo yum-config-manager --disable rhui-REGION-rhel-server-rhscl
sed -i.bak 's/rhui-REGION-rhel-server-extras/rhel-7-server-rhui-extras-rpms/g' roles/repos_el/vars/RedHat-7.yml
sed -i.bak 's/rhui-REGION-rhel-server-rhscl/rhel-server-rhui-rhscl-7-rpms/g' roles/repos_el/vars/RedHat-7.yml
@rcarrata
rcarrata / auto_ocp4.sh
Created Aug 21, 2019
OCP4 Automatic Installer Script
View auto_ocp4.sh
#!/bin/bash
# Small Script for install IPI OCP4 automatically
set -e
set -o pipefail
usage() {
echo "Usage: $0 [ -a aws_secret_key_id ] [ -s aws_secret_access_key ] [ -o ocp_version ] [ -r aws_region ]" 1>&2
}