<p>I've created clusters using kops command. For each cluster I've to create a hosted zone and add namespaces to DNS provider. To create a hosted zone, I've created a sub-domain in the hosted zone in aws(example.com) by using the following command :</p>

<pre><code>ID=$(uuidgen) &amp;&amp; aws route53 create-hosted-zone --name subdomain1.example.com --caller-reference $ID | jq .DelegationSet.NameServers
</code></pre>

<p>The nameservers I get by executing above command are included in a newly created file subdomain1.json with the following content.</p>

<pre><code>{
  "Comment": "Create a subdomain NS record in the parent domain",
  "Changes": [
    {
      "Action": "CREATE",
      "ResourceRecordSet": {
        "Name": "subdomain1.example.com",
        "Type": "NS",
        "TTL": 300,
        "ResourceRecords": [
          {
            "Value": "ns-1.awsdns-1.co.uk"
          },
          {
            "Value": "ns-2.awsdns-2.org"
          },
          {
            "Value": "ns-3.awsdns-3.com"
          },
          {
            "Value": "ns-4.awsdns-4.net"
          }
        ]
      }
    }
  ]
}
</code></pre>

<p>To get the parent-zone-id, I've used the following command:</p>

<pre><code>aws route53 list-hosted-zones | jq '.HostedZones[] | select(.Name=="example.com.") | .Id'
</code></pre>

<p>To apply the subdomain NS records to the parent hosted zone-</p>

<pre><code>aws route53 change-resource-record-sets --hosted-zone-id &lt;parent-zone-id&gt; --change-batch file://subdomain1.json
</code></pre>

<p>then I created a cluster using kops command-</p>

<pre><code>kops create cluster --name=subdomain1.example.com --master-count=1 --master-zones ap-southeast-1a --node-count=1 --zones=ap-southeast-1a --authorization=rbac --state=s3://example.com --kubernetes-version=1.11.0 --yes
</code></pre>

<p>I'm able to create a cluster, validate it and get its nodes. By using the same procedure, I created one more cluster (subdomain2.example.com).</p>

<p>I've set aliases for the two clusters using these commands-</p>

<pre><code>kubectl config set-context subdomain1 --cluster=subdomain1.example.com --user=subdomain1.example.com

kubectl config set-context subdomain2 --cluster=subdomain2.example.com --user=subdomain2.example.com
</code></pre>

<p>To set up federation between these two clusters, I've used these commands- 
    kubectl config use-context subdomain1</p>

<pre><code>kubectl create clusterrolebinding admin-to-cluster-admin-binding --clusterrole=cluster-admin --user=admin

kubefed init interstellar --host-cluster-context=subdomain1 --dns-provider=aws-route53 --dns-zone-name=example.com
</code></pre>

<p>-<a href="https://i.stack.imgur.com/EUsBN.png" rel="nofollow noreferrer">The output of kubefed init command should be</a></p>

<p>But for me it's showing as "waiting for the federation control plane to come up...", but it does not come up. What might be the error?</p>

<p>I've followed the following tutorial to create 2 clusters.</p>

<p><a href="https://gist.github.com/arun-gupta/02f534c7720c8e9c9a875681b430441a" rel="nofollow noreferrer">https://gist.github.com/arun-gupta/02f534c7720c8e9c9a875681b430441a</a></p>

<p>There was a problem with the default image used for federation api server and controller manager binaries. By default, the below mentioned image is considered for the kubefed init command-
 "gcr.io/k8s-jkns-e2e-gce-federation/fcp-amd64:v0.0.0-master_$Format:%h$". </p>

<p>But this image is old and is not available, the federation control plane tries to pull the image but fails. This is the error I was getting. </p>

<p>To rectify it, build a fcp image of your own and push it to some repository and use this image in kubefed init command. Below are the instructions to be executed(Run all of these commands from this path "$GOPATH/src/k8s.io/kubernetes/federation")-</p>

<h1>to create fcp image and push it to a repository -</h1>

<pre><code>docker load -i  _output/release-images/amd64/fcp-amd64.tar

docker tag gcr.io/google_containers/fcp-amd64:v1.9.0-alpha.2.60_430416309f9e58-dirty REGISTRY/REPO/IMAGENAME[:TAG] 

docker push REGISTRY/REPO/IMAGENAME[:TAG]
</code></pre>

<h1>now create a federation control plane with the following command-</h1>

<pre><code>_output/dockerized/bin/linux/amd64/kubefed init myfed --host-cluster-context=HOST_CLUSTER_CONTEXT --image=REGISTRY/REPO/IMAGENAME[:TAG] --dns-provider="PROVIDER" --dns-zone-name="YOUR_ZONE" --dns-provider-config=/path/to/provider.conf
</code></pre>
