Skip to content

Instantly share code, notes, and snippets.

Avatar

Luis Gonzalez funkytaco

View GitHub Profile
View test.py
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.
View OpenShift Monitoring
# 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
View 01_ocp_route_ep_test
# 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
View partition.yaml
---
- 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 Mar 25, 2020 — forked from abutcher/gist:ad9271655e4fe63a2740
Openshift - Regenerate ose dns entries
View gist:0d48fb987673599fecd4a2e8cc3d53c6
#!/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 Nov 8, 2019 — forked from terlar/kubectl.fish
Kubernetes fish completions
View kubectl.fish
# 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 Nov 5, 2019
prometheusoperator.0.27.0 YAML
View README.md

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'

View openshift-cheatsheet.md
  • 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
View precommit.md

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

View tsconfig.json
{
"compileOnSave": true,
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"sourceMap": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"lib": [
"es5",
You can’t perform that action at this time.