-
Notifications
You must be signed in to change notification settings - Fork 20
Openshift v3 Disconnected install personal notes
yum install -y wget
rm -rf /etc/yum.repos.d/*.repo
vi /etc/yum.repos.d/ose.repo
[rhel-7-server-rpms]
name=rhel-7-server-rpms
baseurl=http://mobile.dev:8080/repos/rhel-7-server-rpms
enabled=1
gpgcheck=0
[rhel-7-server-extras-rpms]
name=rhel-7-server-extras-rpms
baseurl=http://mobile.dev:8080/repos/rhel-7-server-extras-rpms
enabled=1
gpgcheck=0
[rhel-7-server-ose-3.2-rpms]
name=rhel-7-server-ose-3.2-rpms
baseurl=http://mobile.dev:8080/repos/rhel-7-server-ose-3.2-rpms
enabled=1
gpgcheck=0
echo "192.168.11.1 mobile.dev" >> /etc/hosts
yum install -y atomic-openshift-utils
ssh-keygen
cat /root/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
ssh root@localhost
atomic-openshift-installer install
subdomain apps.192.168.11.10.xip.io disconnect after installer.cfg.yml is generated.
vi /root/.config/openshift/installer.cfg.yml
public_hostname: 192.168.11.10 public_ip: 192.168.11.10
atomic-openshift-installer -u install
wget http://mobile.dev:8080/repos/images/ose3-builder-images.tar
docker load -i ose3-builder-images.tar
rm -rf ose3-builder-images.tar
wget http://mobile.dev:8080/repos/images/ose3-images.tar
docker load -i ose3-images.tar
rm -rf ose3-images.tar
vi /etc/origin/master/master-config.yaml
Replace DenyAllPasswordIdentityProvider with AllowAllPasswordIdentityProvider
systemctl restart atomic-openshift-master
oadm registry --config=/etc/origin/master/admin.kubeconfig --credentials=/etc/origin/master/openshift-registry.kubeconfig -n default
oadm router -n default
## dont use certs for router
oadm policy add-cluster-role-to-user admin admin
docker tag registry.access.redhat.com/openshift3/ose-haproxy-router:v3.1.0.4 openshift3/ose-haproxy-router:v3.2.0.46
docker tag registry.access.redhat.com/openshift3/ose-sti-builder:v3.1.0.4 openshift3/ose-sti-builder:v3.2.0.46
docker tag registry.access.redhat.com/openshift3/ose-docker-builder:v3.1.0.4 openshift3/ose-docker-builder:v3.2.0.46
docker tag registry.access.redhat.com/openshift3/ose-deployer:v3.1.0.4 openshift3/ose-deployer:v3.2.0.46
docker tag registry.access.redhat.com/openshift3/ose-docker-registry:v3.1.0.4 openshift3/ose-docker-registry:v3.2.0.46
docker tag registry.access.redhat.com/openshift3/ose-pod:v3.1.0.4 openshift3/ose-pod:v3.2.0.46
docker tag registry.access.redhat.com/openshift3/ose-haproxy-router:v3.1.0.4 registry.access.redhat.com/openshift3/ose-haproxy-router:v3.1.0.4
docker tag registry.access.redhat.com/openshift3/ose-sti-builder:v3.1.0.4 registry.access.redhat.com/openshift3/ose-sti-builder:v3.1.0.4
docker tag registry.access.redhat.com/openshift3/ose-docker-builder:v3.1.0.4 registry.access.redhat.com/openshift3/ose-docker-builder:v3.1.0.4
docker tag registry.access.redhat.com/openshift3/ose-deployer:v3.1.0.4 registry.access.redhat.com/openshift3/ose-deployer:v3.1.0.4
docker tag registry.access.redhat.com/openshift3/ose-docker-registry:v3.1.0.4 registry.access.redhat.com/openshift3/ose-docker-registry:v3.1.0.4
docker tag registry.access.redhat.com/openshift3/ose-pod:v3.1.0.4 registry.access.redhat.com/openshift3/ose-pod:v3.1.0.4
If you want to delete registry
oc delete svc,dc,rc docker-registry -n default
docker tag registry.access.redhat.com/rhscl/python-27-rhel7 $REGISTRY:5000/openshift/python-27-rhel7
docker tag registry.access.redhat.com/rhscl/postgresql-94-rhel7 $REGISTRY:5000/openshift/postgresql-94-rhel7
docker tag registry.access.redhat.com/rhscl/python-34-rhel7 $REGISTRY:5000/openshift/python-34-rhel7
docker tag registry.access.redhat.com/rhscl/ruby-22-rhel7 $REGISTRY:5000/openshift/ruby-22-rhel7
docker tag registry.access.redhat.com/rhscl/perl-520-rhel7 $REGISTRY:5000/openshift/perl-520-rhel7
docker tag registry.access.redhat.com/rhscl/php-56-rhel7 $REGISTRY:5000/openshift/php-56-rhel7
docker tag registry.access.redhat.com/rhscl/mysql-56-rhel7 $REGISTRY:5000/openshift/mysql-56-rhel7
docker tag registry.access.redhat.com/rhscl/mongodb-26-rhel7 $REGISTRY:5000/openshift/mongodb-26-rhel7
docker tag registry.access.redhat.com/openshift3/nodejs-010-rhel7 $REGISTRY:5000/openshift/nodejs-010-rhel7
docker tag registry.access.redhat.com/jboss-amq-6/amq62-openshift $REGISTRY:5000/openshift/amq62-openshift
docker tag registry.access.redhat.com/jboss-webserver-3/webserver30-tomcat7-openshift $REGISTRY:5000/openshift/webserver30-tomcat7-openshift
docker tag registry.access.redhat.com/jboss-webserver-3/webserver30-tomcat8-openshift $REGISTRY:5000/openshift/webserver30-tomcat8-openshift
docker tag registry.access.redhat.com/jboss-eap-6/eap64-openshift $REGISTRY:5000/openshift/eap64-openshift
apiVersion: v1
kind: ImageStream
metadata:
labels:
app: nodejs-app
name: nodejs-app
namespace: dev
status:
dockerImageRepository: 172.30.27.88:5000/dev/nodejs-app:latest
server.js
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
server.listen(8080);
console.log("Server running at http://127.0.0.1:8000/");
FROM 172.30.162.228:5000/openshift/nodejs-010-rhel7
ADD server.js .
CMD ["node","server.js"]
docker build -t nodejs-app .
docker tag -f nodejs-app 172.30.27.88:5000/dev/nodejs-app:latest
oc create -f nodejs-app.yml
docker push 172.30.27.88:5000/dev/nodejs-app:latest # 2 times ???
oc new-app dev/nodejs-app
apiVersion: v1
kind: ImageStream
metadata:
labels:
app: python-27-rhel7
name: python-27-rhel7
namespace: openshift
status:
dockerImageRepository: 172.30.144.105:5000/openshift/python-27-rhel7
Other notes This example gives the builder service account in the "myproject" namespace permission to build and push to the "openshift" namespace
oc policy add-role-to-user system:image-builder system:serviceaccount:myproject:builder -n openshift
oc policy add-role-to-user system:image-puller system:serviceaccount:openshift -n openshift