Skip to content

Instantly share code, notes, and snippets.

@nsabine
Created August 25, 2015 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nsabine/e8bb64d3b3707b423d61 to your computer and use it in GitHub Desktop.
Save nsabine/e8bb64d3b3707b423d61 to your computer and use it in GitHub Desktop.
VMs:
- ose3-disconnected-installer
- 1 GB RAM
- 2 vCPU
- 15 GB HD, default partitioning
- "private" virtual network (internal and host only routing)
- static IP
- RHEL 7.1 minimal server
- ose3-disconnected-master
- 8 GB RAM
- 4 vCPU
- 30 GB HD vda, default partitioning
- 15 GB HD vdb, unused
- "private" virtual network (internal and host only routing)
- static IP
- RHEL 7.1 minimal server
- ose3-disconnected-node1
- 8 GB RAM
- 4 vCPU
- 15 GB HD vda, default partitioning
- 15 GB HD vdb, unused
- "private" virtual network (internal and host only routing)
- static IP
- RHEL 7.1 minimal server
on all three:
set up local yum repos, including ose_3.0.0.1
yum update -y
reboot
Copy ose3 release to installer.
This contains:
- the ose3 yum repo
- exported docker images using `docker_save.sh`
- github.com/openshift/openshift-ansible
scp -r ose_release_v3.0.0.1 ose3-disconnected-installer:~/
on installer:
yum -y install docker docker-registry
vi /etc/hosts
192.168.22.6 ose3-disconnected-master.nsabine.local ose3-disconnected-master
192.168.22.7 ose3-disconnected-node1.nsabine.local ose3-disconnected-node1
192.168.22.8 ose3-disconnected-installer.nsabine.local ose3-disconnected-installer
vi /etc/sysconfig/docker
OPTIONS=--selinux-enabled --insecure-registry 172.30.0.0/16 --insecure-registry ose3-disconnected-installer.nsabine.local:5000
ADD_REGISTRY='--add-registry ose3-disconnected-installer.nsabine.local'
systemctl enable docker-registry
systemctl start docker-registry
systemctl enable docker
systemctl start docker
cd ~/ose_release_v3.0.0.1/docker_images
./docker_load.sh
./docker_push.sh
on master, nodes:
yum -y install docker rsync
vi /etc/sysconfig/docker
OPTIONS=--selinux-enabled --insecure-registry 172.30.0.0/16 --insecure-registry ose3-disconnected-installer.nsabine.local:5000
ADD_REGISTRY='--add-registry http://ose3-disconnected-installer.nsabine.local'
vi /etc/sysconfig/docker-storage-setup
DEVS=/dev/vdc
VG=docker-vg
docker-storage-setup
systemctl stop docker
rm -rf /var/lib/docker/*
systemctl start docker
vi /etc/hosts
192.168.22.6 ose3-disconnected-master.nsabine.local ose3-disconnected-master
192.168.22.7 ose3-disconnected-node1.nsabine.local ose3-disconnected-node1
192.168.22.8 ose3-disconnected-installer.nsabine.local ose3-disconnected-installer
on installer:
ssh-keygen
ssh-copy-id ose3-disconnected-master.nsabine.local
ssh-copy-id ose3-disconnected-node1.nsabine.local
cd ose3-epel
ls
ansible-1.9.1-1.el7.noarch.rpm
python-crypto-2.6.1-1.el7.x86_64.rpm
python-ecdsa-0.11-3.el7.noarch.rpm
python-httplib2-0.7.7-3.el7.noarch.rpm
python-keyczar-0.71c-2.el7.noarch.rpm
python-paramiko-1.15.1-1.el7.noarch.rpm
yum localinstall *.rpm
cd ~/ose_release_v3.0.0.1/github_repos/openshift-ansible
cp inventory/byo/hosts /etc/ansible/hosts
vi /etc/ansible/hosts #(edit host names in masters and nodes sections, uncomment & edit oreg_url, uncomment htpasswd auth)
oreg_url=ose3-disconnected-installer.nsabine.local:5000/openshift3/ose-${component}:${version}
#htpasswd auth
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/openshift/htpasswd'}]
# host group for masters
[masters]
ose3-disconnected-master.nsabine.local
# host group for nodes
[nodes]
ose3-disconnected-master.nsabine.local openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
ose3-disconnected-node1.nsabine.local openshift_node_labels="{'region': 'primary', 'zone': 'default'}"
ansible-playbook ./playbooks/byo/config.yml
on master,nodes:
fix /etc/sysconfig/docker again - ansible changed it
OPTIONS=--selinux-enabled --insecure-registry 172.30.0.0/16 --insecure-registry ose3-disconnected-installer.nsabine.local:5000
ADD_REGISTRY='--add-registry http://ose3-disconnected-installer.nsabine.local'
on master:
oc get nodes
echo '{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"registry"}}' | oc create -f -
oc edit scc privileged
add to end:
```
- system:serviceaccount:default:registry
```
mkdir /registry
oadm registry --service-account=registry --config=/etc/openshift/master/admin.kubeconfig --credentials=/etc/openshift/master/openshift-registry.kubeconfig --images='ose3-disconnected-installer.nsabine.local:5000/openshift3/ose-${component}:${version}' --mount-host=/registry
oadm router router --credentials='/etc/openshift/master/openshift-router.kubeconfig' --images='ose3-disconnected-installer.nsabine.local:5000/openshift3/ose-${component}:${version}'
cd /root/ose_release_v3.0.0.1/github_repos/openshift-ansible/playbooks/byo/openshift-master/roles/openshift_examples/files/examples/image-streams
sed -i 's/registry.access.redhat.com/ose3-disconnected-installer.nsabine.local:5000/g' image-streams-rhel7.json
oc delete imagestream --all -n openshift
oc create -f image-streams-rhel7.json -n openshift
cd /etc/openshift/master
vi master-config.yaml
/identityProviders
- name: htpasswd_provider
challenge: true
login: true
provider:
apiVersion: v1
kind: HTPasswdPasswordIdentityProvider
file: /etc/openshift/openshift.htpasswd
yum install httpd-tools -y
htpasswd -c /etc/openshift/openshift.htpasswd admin
systemctl restart openshift-master
https://ose3-disconnected-master.nsabine.local:8443
Create Project
Create App (cakephp-example)
Start Build
An error occurred while starting the build.imageStreamTag "php:5.5" not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment