On Wed, Mar 2, 2016 at 11:41 AM, Aaron Weitekamp <aweit...@redhat.com>
wrote:

> On Wed, Mar 2, 2016 at 9:05 AM, Ben Parees <bpar...@redhat.com> wrote:
>
>> Take a look at this template which deploys mysql:
>>
>> https://github.com/openshift/origin/blob/master/examples/db-templates/mysql-ephemeral-template.json
>> (or this one which uses persistent storage:
>> https://github.com/openshift/origin/blob/master/examples/db-templates/mysql-persistent-template.json
>> )
>>
>> And this application which deploys both a DB and an application that
>> communicates with that DB:
>>
>> https://github.com/openshift/origin/blob/master/examples/quickstarts/cakephp-mysql.json
>> (source for the application is here:
>> https://github.com/openshift/cakephp-ex)
>>
>> I would not necessarily expect you to deploy a single mysql instance and
>> have each app create its own DB in that instance.  I'd expect each app to
>> just deploy its own mysql instance for testing.  I think you will find that
>> easier to setup.
>>
>>
> While one db per app is straightforward and there​
> ​ are many examples of this, aren't there benefits to hosting a single DB​
> ​ service that apps can use? This is the enterprise model. It seems to me
> the question is how to share a service across projects. Once that's in
> place it should "just work" but I couldn't figure out how that might be
> done. oc policy ... ?
> ​
>
>

​by default, a service is accessible to all other projects, no policy
needed.  the challenge you have is creating the additional DBs in the mysql
instance.  Our image creates one DB for you, if you want to create more,
its up to you to exec into the DB container and run mysql commands to
create more databases.
​



>
>>
>> On Wed, Mar 2, 2016 at 4:13 AM, David Balakirev <
>> david.balaki...@adnovum.hu> wrote:
>>
>>> Hi,
>>>
>>> I am trying to host MySQL containers inside OpenShift. The goal would be
>>> that projects could connect to a given container, setup a database for
>>> themselves remotely and execute their integration tests.
>>>
>>> The first question could be: is this something OpenShift could be used
>>> for or not?
>>>
>>> For my installation I created a project with a single MySQL app
>>> (mysql:latest).
>>>
>>> On the server, I can connect to the database via TCP (--protocol=tcp):
>>> * via the IP of the pod
>>> * via the IP of the service (that was auto created for me)
>>>
>>> Of course the goal would be to access the database from our corporate
>>> network.
>>>
>>> After digesting many threads on Stackoverflow, especially [1] and [2] I
>>> think the conclusion is that only port 80/443/8000/8443 could be
>>> accessed externally.
>>>
>>> I know of services, routes and port-forwarding, but probably I did not
>>> yet understand when they should be used.
>>>
>>> I can use port-forwarding to map 3306 to a local port, then I access the
>>> database via "-h localhost".
>>>
>>> I0302 09:20:01.133388    9195 portforward.go:213] Forwarding from
>>> 127.0.0.1:49220 -> 3306
>>> I0302 09:20:01.133516    9195 portforward.go:213] Forwarding from
>>> [::1]:49220 -> 3306
>>>
>>> But I assume I cannot use this to expose the port because of what I have
>>> found in [1] and [2].
>>>
>>> Routes I learned could be used to match a path, but I think that is
>>> better used for HTTP services.
>>>
>>> Frankly I did not yet understand the role of a Router in this context.
>>>
>>> Could someone please let me know if it is possible to do what I want or
>>> not? RTFM is perfect for me, provided I can see a specific example for
>>> exposing a TCP port somehow. It is possible the solution is there but I did
>>> not realize.
>>>
>>> I am using Origin: 1.1.3.
>>>
>>> Thanks in advance,
>>> Dave
>>>
>>> [1]
>>> <http://stackoverflow.com/questions/33985138/how-to-host-and-access-murmur-mumble-server-on-openshift-without-port-forwardi?rq=1>
>>> http://stackoverflow.com/
>>> questions/33985138/how-to-host-and-access-murmur-mumble-server-on-openshift-without-port-forwardi?rq=1
>>> [2]
>>> <http://stackoverflow.com/questions/33838765/openshift-v3-confusion-on-services-and-routes>
>>> http://stackoverflow.com/
>>> questions/33838765/openshift-v3-confusion-on-services-and-routes
>>>
>>> _______________________________________________
>>> dev mailing list
>>> dev@lists.openshift.redhat.com
>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Ben Parees | OpenShift
>>
>>
>> _______________________________________________
>> dev mailing list
>> dev@lists.openshift.redhat.com
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
>>
>>
>


-- 
Ben Parees | OpenShift
_______________________________________________
dev mailing list
dev@lists.openshift.redhat.com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev

Reply via email to