<p>This is more of a research question. If it does not meet the standards of SO, please let me know and I will ask elsewhere. </p>

<p>I am new to Kubernetes and have a few basic questions. I have read a lot of doc on the internet and was hoping someone can help answer few basic questions. </p>

<p>I am trying to create an integration with Kubernetes (user applications running inside Docker containers to be precise) and my application that would act as a backup for certain data in the containers. </p>

<ol>
<li><p>My application currently runs in AWS. Would the Kube cluster need to run in AWS as well ? Or can it run in any cloud service or even on-prem as long as the APIs are available ?</p></li>
<li><p>My application needs to know the IP of the Master node API server to do POST/GET requests and nothing else ?</p></li>
<li><p>For authentication, can I use AD (my application uses AD today for a few things). That would also give me Role based policies for each user. Or do I have to use the Kube Token Reviewer API for authentication always ?</p></li>
<li><p>Would the applications running in Kubernetes use the APIs I provide to communicate with my application ? </p></li>
<li><p>Would my application use POST/GET to communicate with the Kube Master API server ? Do I need to use kubectl for this and above #4 ?</p></li>
</ol>

<p>Thanks for your help. </p>

maddog2323
<ol>
<li>Your application needn't exist on the same server as k8s. There are several ways to connect to k8s cluster, depending on your use case. Either you can expose the built-in k8s API using <a href="https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api" rel="nofollow noreferrer"><code>kubectl proxy</code></a>, connect directly to the k8s API on the master, or you can expose <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">services</a> via load balancer or node port.</li>
<li>You would only need to know the IP for the master node if you're connecting to the cluster directly through the built-in k8s API, but in most cases you should only be using this API to internally administer your cluster. The preferred way of accessing k8s pods is to expose them via load balancer, which allows you to access a service on any node from a single IP. k8s also allows you to access a service with a <code>nodePort</code> from any k8s node (except the master) through a preassigned port. </li>
<li>TokenReview is only one of the k8s auth strategies. I don't know anything about Active Directory auth, but at a glance <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/#openid-co" rel="nofollow noreferrer">OpenID connect tokens</a> seem to support it. You should review whether or not you need to allow users direct access to the k8s API at all. Consider exposing services via LoadBalancer instead.</li>
<li>I'm not sure what you mean by this, but if you deploy your APIs as <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">k8s deployments</a> you can expose their endpoints through services to communicate with your external application however you like.</li>
<li>Again, the preferred way to communicate with k8s pods from external applications is through services exposed as load balancers, not through the built-in API on the k8s master. In the case of services, it's up to the underlying API to decide which kinds of requests it wants to accept. </li>
</ol>
