Skip to content

Instantly share code, notes, and snippets.

View rjhowe's full-sized avatar

Ryan Howe rjhowe

  • Red Hat
  • Raleigh
View GitHub Profile
@rjhowe
rjhowe / gist:75ea255be10acc1d9761
Created February 1, 2016 19:41
Configuring Openshift Install to use port 443
Based on OSE enterprise 3.1.0.4 installer
# sed -i 's/8443/443/g' /usr/share/ansible/openshift-ansible/roles/openshift_master/tasks/main.yml
# sed -i 's/8443/443/g' /usr/share/ansible/openshift-ansible/roles/openshift_master_cluster/tasks/configure.yml
Then add the following under "OSEv3:vars"
[OSEv3:vars]
> cat project-request.json
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "project-request",
"creationTimestamp": null
},
"objects": [
{
[root@infra ~]# cat /etc/haproxy/haproxy.cfg
# Global settings
#---------------------------------------------------------------------
global
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 20000
user haproxy
group haproxy
daemon
@rjhowe
rjhowe / gist:f8bb858add4b77285b411caa7ee1bdcc
Last active April 30, 2020 00:27
Removing and Adding Back etcd memember.

CONTEXT: 3 Masters:

master1.openshift.com 172.17.28.10
master2.openshift.com 172.17.28.12
master3.openshift.com 172.17.28.18

In this example we will be adding "master2.openshift.com" back into the cluster after it was removed.

@rjhowe
rjhowe / AddingLargeETCD.md
Last active September 21, 2016 15:55
Adding old etcd member with large DB back to cluster

CONTEXT: 3 Masters:

master1.openshift.com 172.17.28.10
master2.openshift.com 172.17.28.12
master3.openshift.com 172.17.28.18

In this example we will be adding "master2.openshift.com" back into the cluster.

@rjhowe
rjhowe / OSE-New-ETCD.md
Last active September 22, 2016 19:21
Steps to add a new etcd to the OpenShift cluster
  1. Install etcd on the "NEW_ETCD"
  • Do not start the etcd service
# yum install etcd-2.3.7-4.el7.x86_64
  1. Add iptable rules on the "NEW_ETCD"
# systemctl enable iptables.service --now

On the 1st master, the master with the directory /etc/etcd/ca

  1. Back up the certs

  2. Create new CA from existing openssl.cnf

# cd /etc/etcd/
# export etcd_openssl_conf=/etc/etcd/ca/openssl.cnf
# sed -i 's/365/1825/' $etcd_openssl_conf
# openssl req -config ${etcd_openssl_conf} -newkey rsa:4096
apiVersion: v1
kind: Pod
metadata:
name: sleep-test-pod
spec:
containers:
- name: sleep-test-container
image: rhel7
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 30; done;" ]
Manual data migration of the etcd cluster
In case the migration fails (for some reason), we can finish the migration manually. Depending on a point in which the migration fails we will need the following commands (followed by all the remaining commands):
Before the etcd migration started:
In this case it is recommended to re-run the migration playbook again. The cluster can end up with master services stopped. They must be started and running before the migration is repeated.
Before the first member got migrated:
Before the command is run the etcd service must be stopped.
Raw
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"creationTimestamp": null
},
"objects": [
{
"kind": "ClusterRole",
"apiVersion": "v1",