Skip to content

Instantly share code, notes, and snippets.

View funkytaco's full-sized avatar

Luis Gonzalez funkytaco

View GitHub Profile
import os
import sys
import pytest
try:
# python3, mock is built in.
from unittest.mock import patch
except ImportError:
# In python2, mock is installed via pip.
# Docker daemon
systemctl is-active docker
# Check that Docker volume group has adequate space
echo $(echo \"$(docker info 2>/dev/null | awk '/Data Space Available/ {print $4}') / $(docker info 2>/dev/null | awk '/Data Space Total/ {print $4}')\" | bc -l) '>' 0.3 | bc -l
# Check that Docker volume group has adequate metadata space
echo $(echo \"$(docker info 2>/dev/null | awk '/Metadata Space Available/ {print $4}') / $(docker info 2>/dev/null | awk '/Metadata Space Total/ {print $4}')\" | bc -l) '>' 0.3 | bc -l
# etcd is active
# A test to see if a route can bind to endpoints w/o a svc.
# Create an endpoints
apiVersion: v1
kind: Endpoints
metadata:
labels:
app: console
name: console-test
namespace: openshift-console
---
- name: Create partitions on master
hosts: masters
become: yes
tasks:
- name: Create LVEtcd logical volume
lvol:
lv: LVEtcd
size: 10g
@funkytaco
funkytaco / gist:0d48fb987673599fecd4a2e8cc3d53c6
Last active March 25, 2020 13:49 — forked from abutcher/gist:ad9271655e4fe63a2740
Openshift - Regenerate ose dns entries
#!/usr/bin/env oo-ruby
require "/var/www/openshift/broker/config/environment"
Rails.configuration.analytics[:enabled] = false
Mongoid.raise_not_found_error = false
class Regenerate
def self.run
entries = []
Application.all.each do |app|
@funkytaco
funkytaco / kubectl.fish
Created November 8, 2019 20:49 — forked from terlar/kubectl.fish
Kubernetes fish completions
# kubernetes - is an open source system for managing containerized
# applications across multiple hosts, providing basic mechanisms for
# deployment, maintenance, and scaling of applications.
# See: https://kubernetes.io
function __kubectl_no_command
set -l cmd (commandline -poc)
if not set -q cmd[2]
return 0
end
@funkytaco
funkytaco / README.md
Last active November 5, 2019 21:00
prometheusoperator.0.27.0 YAML

So I found this by googling for prometheusoperator.0.27.0

Found it in Google's cache: https://webcache.googleusercontent.com/search?q=cache:u0dOwNTOWH0J:https://github.com/operator-framework/community-operators/blob/master/upstream-community-operators/prometheus/prometheusoperator.0.27.0.clusterserviceversion.yaml+&cd=1&hl=en&ct=clnk&gl=us

It looks like there was a 0.32.0 version added to OperatorHub 8 days ago, but maybe it's not published yet. https://github.com/operator-framework/community-operators/tree/master/upstream-community-operators/prometheus

So just create a new project my-prometheus, update metadata.namespace from 'placeholder' to 'my-prometheus'

@funkytaco
funkytaco / openshift-cheatsheet.md
Created October 28, 2019 02:31 — forked from shawon100/openshift-cheatsheet.md
My Openshift Cheatsheet
  • Binary Builds
oc new-build --binary=true --name=ola2 --image-stream=redhat-openjdk18-openshift
oc start-build ola2 --from-file=./target/ola.jar --follow
oc new-app 
  • Turn off/on DC triggers to do a batch of changes without spam many deployments
@funkytaco
funkytaco / precommit.md
Created October 24, 2019 06:34 — forked from yungblud/precommit.md
Pre Commit

package.json

  "scripts": {
    "precommit": "npm run precommit:client && npm run precommit:server",
    "precommit:client": "cd client && npm run precommit",
    "precommit:server": "cd server && npm run precommit"
  },

server/package.json

@funkytaco
funkytaco / tsconfig.json
Created October 24, 2019 05:55 — forked from wilk/tsconfig.json
tsconfig
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": [
"es5",