Skip to content

Instantly share code, notes, and snippets.

@jwmatthews
Last active September 27, 2016 15:50
Show Gist options
  • Save jwmatthews/b34fb225ca24fd045b7b38e919c6e6a9 to your computer and use it in GitHub Desktop.
Save jwmatthews/b34fb225ca24fd045b7b38e919c6e6a9 to your computer and use it in GitHub Desktop.
# Trying with explicit 10.1.2.2 as IP of the OpenShift server
rm /home/vagrant/.kube/config
$ oc login 10.1.2.2:8443 --certificate-authority=/var/lib/openshift/openshift.local.config/master/ca.crt -u openshift-dev -p devel
$ cat /home/vagrant/.kube/config
apiVersion: v1
clusters:
- cluster:
certificate-authority: /var/lib/openshift/openshift.local.config/master/ca.crt
server: https://10.1.2.2:8443
name: 10-1-2-2:8443
contexts:
- context:
cluster: 10-1-2-2:8443
namespace: cap
user: openshift-dev/10-1-2-2:8443
name: cap/10-1-2-2:8443/openshift-dev
current-context: cap/10-1-2-2:8443/openshift-dev
kind: Config
preferences: {}
users:
- name: openshift-dev/10-1-2-2:8443
user:
token: UPeqQGxzSOkXq9Pwwg430qCJKJMTGycHp48ZUzb-rW4
$ cat answers.conf
[etherpad-app]
image = centos/etherpad
db_port = 3306
db_pass = sample_pass
db_name = sample_name
db_user = sample_user
db_host = mariadb
hostport = 9001
[mariadb-atomicapp]
db_pass = sample_pass
image = centos/mariadb
db_user = sample_user
root_pass = MySQLPass
db_name = sample_name
[general]
namespace = cap
provider = openshift
provider-config = /home/vagrant/.kube/config
$ time atomic run projectatomic/etherpad-centos7-atomicapp . -v
docker run -it --rm --privileged -v /home/vagrant/etherpad-centos7-atomicapp:/atomicapp -v /run:/run -v /:/host --net=host --name etherpad-centos7-atomicapp -e USER -e SUDO_USER -e NAME=etherpad-centos7-atomicapp -e IMAGE=projectatomic/etherpad-centos7-atomicapp projectatomic/etherpad-centos7-atomicapp run . -v
This container uses privileged security switches:
INFO: --net=host
Processes in this container can listen to ports (and possibly rawip traffic) on the host's network.
INFO: --privileged
This container runs without separation and should be considered the same as root on your system.
For more information on these switches and their security implications, consult the manpage for 'docker run'.
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 :: - utils.py :: Loading answers from file: ./answers.conf
DEBUG :: - nulecule/main.py :: Request to unpack to None to .
INFO :: - nulecule/base.py :: Found existing external application: mariadb-centos7-atomicapp Loading:
DEBUG :: - providers/openshift.py :: Given config: {u'root_pass': u'MySQLPass', u'provider-config': u'/home/vagrant/.kube/config', u'image': u'centos/mariadb', u'namespace': u'cap', u'db_pass': u'sample_pass', u'db_name': u'sample_name', u'db_user': u'sample_user', u'provider': u'openshift'}
INFO :: - providers/openshift.py :: Using namespace cap
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 root. Using home directory /root for configuration data
DEBUG :: - providers/openshift.py :: Provider configuration provided
DEBUG :: - providers/lib/kubeshift/kubebase.py :: Verification will be required for all API calls
ERROR :: - cli/main.py :: [Errno 2] No such file or directory
Traceback (most recent call last):
File "/opt/atomicapp/atomicapp/cli/main.py", line 143, in cli_func_exec
cli_func(cli_func_args)
File "/opt/atomicapp/atomicapp/cli/main.py", line 85, in cli_run
nm.run(**argdict)
File "/opt/atomicapp/atomicapp/nulecule/main.py", line 322, in run
self.nulecule.run(cli_provider, dryrun)
File "/opt/atomicapp/atomicapp/nulecule/base.py", line 206, in run
component.run(provider_key, dryrun)
File "/opt/atomicapp/atomicapp/nulecule/base.py", line 336, in run
self._app.run(provider_key, dryrun)
File "/opt/atomicapp/atomicapp/nulecule/base.py", line 206, in run
component.run(provider_key, dryrun)
File "/opt/atomicapp/atomicapp/nulecule/base.py", line 340, in run
provider.init()
File "/opt/atomicapp/atomicapp/providers/openshift.py", line 101, in init
self.api = Client(KubeConfig.from_file(self.config_file), "openshift")
File "/opt/atomicapp/atomicapp/providers/lib/kubeshift/client.py", line 46, in __init__
self.connection = KubeOpenshiftClient(config)
File "/opt/atomicapp/atomicapp/providers/lib/kubeshift/openshift.py", line 60, in __init__
self.api.test_connection(self.k8s_api)
File "/opt/atomicapp/atomicapp/providers/lib/kubeshift/kubebase.py", line 180, in test_connection
self.api.request("get", url)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 464, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 431, in send
raise SSLError(e, request=request)
SSLError: [Errno 2] No such file or directory
real 0m1.642s
user 0m0.206s
sys 0m0.064s
# Issue looks like we can't hit the kubernetes API from the docker container.
# Looking in the source for release 0.6.3 I see the kubernetes API is expected at: api/v1/
https://github.com/projectatomic/atomicapp/blob/0.6.3/atomicapp/providers/lib/kubeshift/kubernetes.py#L51
$ grep server ~/.kube/config
server: https://10.1.2.2:8443
$ oc status
In project cap on server https://10.1.2.2:8443
You have no services, deployment configs, or build configs.
Run 'oc new-app' to create an application.
$ curl -s -k https://10.1.2.2:8443/api/v1 | head -n 5
{
"kind": "APIResourceList",
"groupVersion": "v1",
"resources": [
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment