Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jwmatthews/59ae5eaf6bea5e4f6c5eb076639b6904 to your computer and use it in GitHub Desktop.
Save jwmatthews/59ae5eaf6bea5e4f6c5eb076639b6904 to your computer and use it in GitHub Desktop.
vagrant init openshift/origin-all-in-one
vagrant up
vagrant ssh
cd ~
git clone https://github.com/projectatomic/atomicapp.git
cd atomicapp
sudo yum install python-pip
sudo make install
cd ~
sudo atomicapp run projectatomic/etherpad-centos7-atomicapp --mode fetch --destination etherpad-centos7-atomicapp
cd etherpad-centos7-atomicapp
oc login -u admin:admin
# admin:admin and user:user are from the vagrant setup of OSE we are using, built into the box
oc whoami -t
b1H1HlaL0xvdiRX5LqNemw-Odr-VDN9RaybPOQmFHQU
oc new-project jwm2
sudo cp answers.conf.sample answers.conf
Edit answers.conf, replace the "accesstoken" and answer the other parameters
$ cat answers.conf
[mariadb-atomicapp]
db_pass = jwm
image = centos/mariadb
db_user = jwm
db_name = jwm
root_pass = MySQLPass
[mariadb-centos7-atomicapp]
provider = openshift
[mariadb-centos7-atomicapp:mariadb-atomicapp]
db_pass = jwm
image = centos/mariadb
db_user = jwm
root_pass = MySQLPass
db_name = jwm
[etherpad-app]
db_pass = jwm
db_name = jwm
db_host = mariadb
db_user = jwm
image = centos/etherpad
hostport = 9001
db_port = 3306
[general]
accesstoken = b1H1HlaL0xvdiRX5LqNemw-Odr-VDN9RaybPOQmFHQU
provider = openshift
providertlsverify = False
provider-api = https://127.0.0.1:8443
namespace = jwm2
$ time sudo atomicapp run . -v
INFO :: - cli/main.py :: Atomic App: 0.6.3 - Mode: Run
DEBUG :: - cli/main.py :: Final parsed cmdline: run . -v
DEBUG :: - nulecule/main.py :: NuleculeManager init app_path: .
DEBUG :: - nulecule/main.py :: NuleculeManager init image: None
DEBUG :: - nulecule/main.py :: Request to unpack to None to .
INFO :: - nulecule/base.py :: Found existing external application: mariadb-centos7-atomicapp Loading:
DEBUG :: - utils.py :: Loading answers from file: ./answers.conf
DEBUG :: - plugin.py :: Configuration option 'provider-config' not provided
DEBUG :: - plugin.py :: Configuration option 'provider-config' not provided
DEBUG :: - plugin.py :: Configuration option 'provider-config' not provided
DEBUG :: - providers/openshift.py :: Given config: {u'accesstoken': u'b1H1HlaL0xvdiRX5LqNemw-Odr-VDN9RaybPOQmFHQU', 'provider': u'openshift', u'providertlsverify': False, u'provider-api': u'https://127.0.0.1:8443', 'namespace': u'jwm2'}
INFO :: - providers/openshift.py :: Using namespace jwm2
DEBUG :: - providers/openshift.py :: Processing artifact: artifacts/kubernetes/.mariadb-pod.yaml
DEBUG :: - providers/openshift.py :: Processing artifact: artifacts/kubernetes/.mariadb-service.yaml
DEBUG :: - utils.py :: Finding the users home directory
DEBUG :: - utils.py :: Running as user vagrant. Using home directory /home/vagrant for configuration data
DEBUG :: - providers/openshift.py :: List of parameters passed: {'provider-tlsverify': None, 'provider-api': u'https://127.0.0.1:8443', 'provider-cafile': None, 'provider-auth': None}
DEBUG :: - providers/openshift.py :: .kube/config exists, using default configuration file
WARN :: - providers/lib/kubeshift/kubebase.py :: CAUTION: TLS verification has been DISABLED
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
DEBUG :: - providers/lib/kubeshift/kubebase.py :: Connection successfully tested on URL https://10.2.2.2:8443/api/v1/
DEBUG :: - providers/lib/kubeshift/kubebase.py :: Connection successfully tested on URL https://10.2.2.2:8443/oapi/v1/
DEBUG :: - providers/lib/kubeshift/client.py :: Using OpenShift Provider KubeClient library
DEBUG :: - providers/openshift.py :: There are currently 1 namespaces in the cluster.
DEBUG :: - providers/openshift.py :: Namespaces: [u'jwm2']
INFO :: - providers/openshift.py :: Deploying to OpenShift
INFO :: - providers/lib/kubeshift/openshift.py :: Pods 'mariadb' successfully created
INFO :: - providers/lib/kubeshift/openshift.py :: Services 'mariadb' successfully created
DEBUG :: - plugin.py :: Configuration option 'provider-config' not provided
DEBUG :: - providers/openshift.py :: Given config: {u'accesstoken': u'b1H1HlaL0xvdiRX5LqNemw-Odr-VDN9RaybPOQmFHQU', 'provider': u'openshift', u'providertlsverify': False, u'provider-api': u'https://127.0.0.1:8443', 'namespace': u'jwm2'}
INFO :: - providers/openshift.py :: Using namespace jwm2
DEBUG :: - providers/openshift.py :: Processing artifact: artifacts/openshift/.etherpad-rc.yaml
DEBUG :: - providers/openshift.py :: Processing artifact: artifacts/openshift/.etherpad-svc.yaml
DEBUG :: - utils.py :: Finding the users home directory
DEBUG :: - utils.py :: Running as user vagrant. Using home directory /home/vagrant for configuration data
DEBUG :: - providers/openshift.py :: List of parameters passed: {'provider-tlsverify': None, 'provider-api': u'https://127.0.0.1:8443', 'provider-cafile': None, 'provider-auth': None}
DEBUG :: - providers/openshift.py :: .kube/config exists, using default configuration file
WARN :: - providers/lib/kubeshift/kubebase.py :: CAUTION: TLS verification has been DISABLED
DEBUG :: - providers/lib/kubeshift/kubebase.py :: Connection successfully tested on URL https://10.2.2.2:8443/api/v1/
DEBUG :: - providers/lib/kubeshift/kubebase.py :: Connection successfully tested on URL https://10.2.2.2:8443/oapi/v1/
DEBUG :: - providers/lib/kubeshift/client.py :: Using OpenShift Provider KubeClient library
DEBUG :: - providers/openshift.py :: There are currently 1 namespaces in the cluster.
DEBUG :: - providers/openshift.py :: Namespaces: [u'jwm2']
INFO :: - providers/openshift.py :: Deploying to OpenShift
INFO :: - providers/lib/kubeshift/openshift.py :: Services 'etherpad-svc' successfully created
INFO :: - providers/lib/kubeshift/openshift.py :: Replicationcontrollers 'etherpad' successfully created
DEBUG :: - nulecule/main.py :: Writing answers to file.
DEBUG :: - nulecule/main.py :: FILE: ./answers.conf.gen
DEBUG :: - nulecule/main.py :: ANSWERS: defaultdict(<type 'dict'>, {u'mariadb-centos7-atomicapp:mariadb-atomicapp': {u'db_pass': u'jwm', u'image': u'centos/mariadb', u'db_user': u'jwm', u'db_name': u'jwm', u'root_pass': u'MySQLPass'}, u'mariadb-centos7-atomicapp': {u'provider': u'openshift'}, u'etherpad-app': {u'db_pass': u'jwm', u'db_name': u'jwm', u'db_host': u'mariadb', u'db_user': u'jwm', u'image': u'centos/etherpad', u'hostport': 9001, u'db_port': 3306}, u'mariadb-atomicapp': {u'db_pass': u'jwm', u'image': u'centos/mariadb', u'db_user': u'jwm', u'root_pass': u'MySQLPass', u'db_name': u'jwm'}, 'general': {u'accesstoken': u'b1H1HlaL0xvdiRX5LqNemw-Odr-VDN9RaybPOQmFHQU', 'provider': u'openshift', u'providertlsverify': False, u'provider-api': u'https://127.0.0.1:8443', 'namespace': u'jwm2'}})
DEBUG :: - nulecule/main.py :: ANSWERS FORMAT: ini
DEBUG :: - utils.py :: Setting gid/uid of ./answers.conf.gen to 1000,1000
Your application resides in .
Please use this directory for managing your application
real 0m0.561s
user 0m0.244s
sys 0m0.074s
$ oc get pods
NAME READY STATUS RESTARTS AGE
etherpad-iam8s 1/1 Running 0 7m
mariadb 1/1 Running 0 7m
$ oc describe pod etherpad-iam8s
Name: etherpad-iam8s
Namespace: jwm2
Security Policy: anyuid
Node: origin/10.0.2.15
Start Time: Tue, 20 Sep 2016 20:15:18 +0000
Labels: name=etherpad
Status: Running
IP: 172.17.0.8
Controllers: ReplicationController/etherpad
Containers:
etherpad:
Container ID: docker://2044c3045c8b3343a1437b79bf458816918f56648697b604c99b36e84b268c35
Image: centos/etherpad
Image ID: docker://sha256:9b6c1d3748312c7de8fd47ee194c639bb348ca89f2d2c1695f5cfcd3bde6b8b7
Port: 9001/TCP
State: Running
Started: Tue, 20 Sep 2016 20:15:22 +0000
Ready: True
Restart Count: 0
Volume Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-1u29u (ro)
Environment Variables:
DB_HOST: mariadb
DB_DBID: jwm
DB_PASS: jwm
DB_PORT: 3306
DB_USER: jwm
Conditions:
Type Status
Initialized True
Ready True
PodScheduled True
Volumes:
default-token-1u29u:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-1u29u
QoS Tier: BestEffort
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
8m 8m 1 {default-scheduler } Normal Scheduled Successfully assigned etherpad-iam8s to origin
8m 8m 1 {kubelet origin} spec.containers{etherpad} Normal Pulling pulling image "centos/etherpad"
8m 8m 1 {kubelet origin} spec.containers{etherpad} Normal Pulled Successfully pulled image "centos/etherpad"
8m 8m 1 {kubelet origin} spec.containers{etherpad} Normal Created Created container with docker id 2044c3045c8b
8m 8m 1 {kubelet origin} spec.containers{etherpad} Normal Started Started container with docker id 2044c3045c8b
[vagrant@localhost etherpad-centos7-atomicapp]$ curl 172.17.0.8:9001
<!doctype html>
<html>
<title>Etherpad</title>
<script>
/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment