Skip to content

Instantly share code, notes, and snippets.

View juanbrny's full-sized avatar

Juan Herrera Utande juanbrny

View GitHub Profile
@juanbrny
juanbrny / getclustergroupmembers.py
Created January 9, 2024 21:22
Python script to get all members of a given fleet clustergroup
import json
import subprocess
import sys
# fleet clustergroup membership is dynamic based on the rules in the clustergroup definition
# Those rules are either a matchExpressions selector, a matchLabels selector or a combination of both.
# This script gets the clustergroup name as parameter and get's the rule definition in json format.
# Those rules are then formated to be used in kubectl command that finds all the fleet clustergroup
# members that match those rules and show the in the standard out put.
@juanbrny
juanbrny / getclustergroupmembers.sh
Created January 9, 2024 21:20
Bash script to get all members of a given fleet clustergroup
#!/bin/bash
# fleet clustergroup membership is dynamic based on the rules in the clustergroup definition
# Those rules are either a matchExpressions selector, a matchLabels selector or a combination of both.
# This script gets the clustergroup name as parameter and get's the rule definition in json format.
# Those rules are then formated to be used in kubectl command that finds all the fleet clustergroup
# members that match those rules and show the in the standard out put.
# Check if a ClusterGroup name is provided
if [ "$#" -ne 1 ]; then
@juanbrny
juanbrny / harbor.sh
Last active April 20, 2022 08:37 — forked from kacole2/harbor.sh
Quick Start Harbor Installation Script on SUSE Linux Enterprise Server 15 SP3
#!/bin/bash
#Harbor on SUSE Linux Enterprise Server 15 SP3
#Prompt for the user to ask if the install should use the IP Address or Fully Qualified Domain Name of the Harbor Server
PS3='Would you like to install Harbor based on IP or FQDN? '
select option in IP FQDN
do
case $option in
IP)
#!/bin/bash
##############################################
# Script to dump all kubernetes objects and
# definitions for all namespaces the
# user running the script has access to.
# Includes standard objects and CRDs are not exported.
# References:
# - https://www.studytonight.com/post/how-to-list-all-resources-in-a-kubernetes-namespace
# - Rancher's log collector: https://raw.githubusercontent.com/rancherlabs/support-tools/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh
##############################################
@juanbrny
juanbrny / kubernetesclusterdump.sh
Created August 24, 2021 15:56
Script that gathers the list of all objects defined in all the namespaces the user running the script has access to. If also dumps the object definitions. Usefull to debug customer clusters we don't have access to.
#!/bin/bash
set -e
set -u
#Debug mode only: set -x
##############################################
# Script to dump all kubernetes objects and
# definitions for all namespaces the
# user running the script has access to.
# CRDs are not exported.
@juanbrny
juanbrny / elastic_fluentd_kibana_openshift_deployment.yaml
Last active December 9, 2020 09:58
Basic EFK stack for OpenShift using ClusterLogging and Elastic operators
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
name: "instance"
namespace: "openshift-logging"
spec:
managementState: "Managed"
logStore:
type: "elasticsearch"
retentionPolicy:
@juanbrny
juanbrny / nextcloud_pod.yaml
Last active August 10, 2020 13:07
NextCloud Pod definition for Podman
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2020-03-28T17:03:40Z"
labels:
app: nextcloud
name: nextcloud
spec:
containers:
- name: nextcloud_app
@juanbrny
juanbrny / README.md
Created October 25, 2018 10:10 — forked from ragingprodigy/README.md
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f ${BACKUP_OUTPUT_DIR}.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
@juanbrny
juanbrny / ethereumdemo.txt
Last active March 22, 2018 19:38
ethereumdemo
ETHEREUM DEMO
-----------------------------------------------------
** Mostramos el Deployment en GitHub
** Desplegamos el Deployment de GitHub
https://github.com/juanbrny/kuberneteth
kubectl apply -f https://raw.githubusercontent.com/juanbrny/kuberneteth/master/edmadriddeployment.yaml
@juanbrny
juanbrny / openfaasdemo
Last active March 22, 2018 19:34
OpenFaaS demo on CaaSP
OPENFAAS DEMO
-----------------------------------------------------
** Mostramos todos los charts disponibles en Kubernetes
git clone https://github.com/openfaas/faas-netes
cd faas-netes/
** Creamos namespaces especificos
kubectl create ns openfaas