Skip to content

Instantly share code, notes, and snippets.

View Miciah's full-sized avatar

Miciah Dashiel Butler Masters Miciah

  • Red Hat, Inc.
  • North Carolina
View GitHub Profile
@Miciah
Miciah / openshift.ks
Created September 6, 2012 17:31
OpenShift kickstart script
# This kickstart script configures a system that acts as either a node or
# a broker.
#
# TODO: Comment everything better.
#
# TODO: Figure out which commands in %post are unnecessary.
# XXX: Some commands are definitely unnecessary (e.g., some semanage
# commands that specify settings that are already default). Should we
# keep these commands?
#
@Miciah
Miciah / kick.sh
Last active September 27, 2017 10:11
OpenShift kickstart script (using beta packages)
#!/bin/sh
set -e
if [ $# -lt 1 ]
then
printf 'Usage: %s vm_name [arg1 [arg2 [...]]]\n' "$0"
printf 'Example:\n'
printf '%s my_new_broker_and_node install_components=broker,node,activemq,datastore named_ip_addr=10.0.0.1' "$0"
exit 1
@Miciah
Miciah / version_comp
Last active August 29, 2015 13:57
version_comp
function zeropadl () {
result="$1"
while [[ ${#result} -lt $#2 ]]
do
result="0$result"
done
echo -n "$result"
}
function zeropadr () {
# bundle install --path=/tmp/rhc_bundle
Fetching gem metadata from http://rubygems.org/............
Resolving dependencies...
Bundler could not find compatible versions for gem "net-ssh":
In Gemfile:
rhc (>= 0) ruby depends on
net-ssh (<= 2.9.2, >= 0) ruby
rhc (>= 0) ruby depends on
net-ssh (3.0.1)
Gerber <https://www.gerbercollision.com/> (x6, but 1 negative)
Tao Auto on Capital (specialises in Japanese cars) (x4)
Firestone downtown (x3)
Allen's Automotive (about a mile from the tower, pleasant walk) (x3)
Coats Auto Body (x2)
Benchmark Auto Works (x2)
Capital City Collision <http://www.capitalcitycollisionshop.com/> (x2)
Triangle Collision (x2)
Mission Valley Gas Station (x2)
Atlantic Tire and Service (10% discount for Red Hat employees)
# Based on <https://github.com/openshift/openshift-ansible/tree/master/playbooks/adhoc/s3_registry>.
# Deploy the image registry:
oadm registry --config=/openshift.local.config/master/admin.kubeconfig --credentials=/openshift.local.config/master/openshift-registry.kubeconfig
# Scale the image registry down:
oc scale --replicas=0 dc/docker-registry
# Write out configuration:
cat > /root/config.yml <<EOF
% g merge dinhxuanvu/enterprise-rhc/enterprise-2.2
Auto-merging rel-eng/packages/rhc
CONFLICT (content): Merge conflict in rel-eng/packages/rhc
Auto-merging client.spec
CONFLICT (content): Merge conflict in client.spec
Automatic merge failed; fix conflicts and then commit the result.
zsh: exit 1 git merge dinhxuanvu/enterprise-rhc/enterprise-2.2
QE, we want to test a configuration that is a variation on the standard HA
(multi-broker) configuration with F5 BIG-IP plus routing-daemon. In particular,
we want to set up clustered F5 BIG-IP, we want to colocate an instance of the
routing-daemon on *each* broker host, and we want to ensure that ActiveMQ is
configured with redelivery enabled.
Our goal is to verify that this configuration works as expected and that we can
support it for customers.
The standard openshift.sh installation script can perform most of the
#!/usr/bin/ruby
require 'aws-sdk'
require 'getoptlong'
require 'net/ssh'
require 'parseconfig'
REGIONS = {
'us-east-1' => 'N. Virginia',
'us-west-2' => 'Oregon',
@Miciah
Miciah / oc-run
Last active April 15, 2016 20:00
$ oc run jenkins-master --image=docker-registry.usersys.redhat.com:5000/aos-ci/jenkins-master-aos --port=80 --expose --dry-run -o json > ,one-port
$ oc run jenkins-master --image=docker-registry.usersys.redhat.com:5000/aos-ci/jenkins-master-aos --overrides='{"apiVersion":"v1","spec":{"template":{"spec":{"containers":[{"name":"jenkins-master","image":"docker-registry.usersys.redhat.com:5000/aos-ci/jenkins-master-aos","ports":[{"containerPort":80},{"containerPort":41000}]}]}}}}' --expose --dry-run -o json > ,two-ports
error: --port must be a positive integer when exposing a service
$ oc run jenkins-master --image=docker-registry.usersys.redhat.com:5000/aos-ci/jenkins-master-aos --port=80 --overrides='{"apiVersion":"v1","spec":{"template":{"spec":{"containers":[{"name":"jenkins-master","image":"docker-registry.usersys.redhat.com:5000/aos-ci/jenkins-master-aos","ports":[{"containerPort":80},{"containerPort":41000}]}]}}}}' --expose --dry-run -o json > ,two-ports
$ diff -u ,one-port ,two-ports
--- ,one-port 201