Can't you use an internal load balancer to communicate?

To answer the original question

On Tuesday, December 12, 2017, <[email protected]> wrote:

> I have a situation like this:
>
> - a cluster of web machines
> - a cluster of db machines and other services
>
> The question is how put in communication the 2 clusters in order to use
> some hostnames in /etc/hosts of web machines.
>
> To protect your data, is it safe create an ingress service to make visible
> the db from the external? I tried with a nodePort service (so using
> internal ip addresses) but I'm not able to put in contact db-web between
> different clusters
>
> At the moment my temporary solution is:
>
> a) define a public static ip with the command:
> gcloud compute addresses create my-public-static-ip --global
>
>
> b) use an ingress configuration for my db service where I set the static
> ip with the option:
>
>     apiVersion: extensions/v1beta1
>     kind: Ingress
>     metadata:
>       name: my-ingress
>       annotations:
>         kubernetes.io/ingress.global-static-ip-name: my-public-static-ip
>
> c) in my daemonset.yaml I define a hostAliases:
>
>     apiVersion: extensions/v1beta1
>     kind: DaemonSet
>     metadata:
>       name: my-daemonset
>
>     spec:
>       updateStrategy:
>         type: RollingUpdate
>
>       template:
>         spec:
>           nodeSelector:
>             app: frontend-node
>
>           terminationGracePeriodSeconds: 30
>
>           hostAliases:
>           - ip: <public_ip_addr>
>             hostnames:
>             - "my-db-service"
>
>
> and it's working. But I'm not too convinced that this solution is the best
> or however correct on a live environment...
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to