How Kubernetes connecting external mysql from fix ip

501 views
Skip to first unread message

tweakmy

unread,
Mar 25, 2016, 7:23:40 AM3/25/16
to kubernetes-dev

I know how to create the service abstraction that points to an endpoint to an external database(not within the cluster ip). However, my mysql service (single host mysql) only permits fix ip for access. The obvious reason is security.


And, we all know pod will eventually die and get a new ip.


So, how can one fix this?


kind: "Service"
  apiVersion: "v1"
  metadata:
    name: "example-external-service"
  spec:
    ports:
      -
        name: "mysql"
        protocol: "TCP"
        port: 3306
        targetPort: 3306
        nodePort: 0

end point defintion:

kind: "Endpoints"
apiVersion: "v1"
metadata:
  name: "example-external-service" 
subsets: 
- addresses:
  - ip: "10.10.1.1"
  ports:
  - name: "mysql"
    port: 3306
 
Thanks.

p.s I am using the v1.2 release

David Aronchick

unread,
Mar 25, 2016, 10:15:45 AM3/25/16
to tweakmy, kubernetes-dev
Hi!

Thanks for your questions - would you mind asking these on Stackoverflow.com? We watch the tag "Kubernetes" and answer questions just like these there. Our hope is that if we answer it there, it'll help other people who have the same questions.

Thanks!
Dave
--
You received this message because you are subscribed to the Google Groups "kubernetes-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/e026439c-97f5-44a9-9b55-8ef98c601f2d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages