Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 348 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to connect to the server: dial tcp: lookup <Server Location>: no such host

#11
You can simply append "--admin" to the query as seen below.

az aks get-credentials --name <cluster name> --resource-group <resource group name> --admin
Reply

#12
I also hit this after restarting my kubernetes cluster, but it turned out I was just not waiting long enough, after about 10 minutes the "kubectrl" commands started working again.
Reply

#13
If you are using AWS with kops then this might help you

mkdir autoscaler
cd autoscaler/
git clone

[To see links please register here]


create a file called ig-policy.json with the contents

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup"
],
"Resource": "*"
}
]
}

Then you need to create iam policy

aws iam create-policy --policy-name ig-policy --policy-document file://ig-policy.json

And attach the above create iam policy with the user id to the cluster name

aws iam attach-role-policy --policy-arn arn:aws:iam::005935423478650:policy/ig-policy --role-name nodes.testing.k8s.local

Then update the cluster

kops update cluster testing.k8s.local --yes

Then run

kops rolling-update cluster



Reply

#14
Creating private not easy journey, but it has beautiful views so I encourage anyone to get there.
I did it all in terraform, so some names can be little different than they are in portal/azure CLI.

And this is how I did it:

1. Private DNS zone, with name as `privatelink.westeurope.azmk8s.io`
2. VNET where AKS will be placed (let's call it `vnet-access`)
3. Virtual network from which you want to access AKS
4. Private AKS (private_dns_zone_id set to dns zone form first point)
5. Virtual network link (in private DNS zone, pointing to VNET from point 3)
6. Peering between networks from points 2 and 3.

This should allow any machine in `vnet-access` to firstly resolve DNS, and then - to access cluster...

Yet... if you want to get there from your local machine, this is another setup. Fortunately Microsoft have such tutorial [here][1]

---
If you find that something is still not working - put the error in comment and I'll try to adapt my answer to cover this.


[1]:

[To see links please register here]

Reply

#15
For me I had this issue when I was trying to connect a new Linux user to my Elastic Kubernetes Cluster in AWS.

I setup a new user called jenkins-user, then I tried to run the command below to get pods:

kubectl get pods

And then I will run into the error below:

> Unable to connect to the server: dial tcp: lookup 23343445ADFEHGROGMFDFMG.sk1.eu-east-2.eks.amazonaws.com on 198.74.83.506:53: no such host

Here's how I solved it:

The issue was because I had not set the context for the Kubernetes cluster in the kube config file of the new linux user (`jenkins-user`).

All I had to do was either first install the `aws-cli` for this new user (install it into the home directory of this new user). And then run the command `aws configure` to configure the necessary credentials. Although, since I already had the aws-cli setup for the other users on the Linux system I simply copied the `~/.aws` directory from an already existing user to the `jenkins-user` home directory using the command:

sudo cp -R /home/existing-user/.aws/ /home/jenkins-user/

Next, I had to create a context for the Kubernetes configuration which will create a new `~/.kube/config` file for the `jenkins-user` using the command below:

aws eks --region my-aws-region update-kubeconfig --name my-cluster-name

Next, I checked the kube config file to confirm that my context has been added using the command:

sudo nano /.kube/config

This time when I ran the command below, it was successful:

kubectl get pods

Resources: [Create a kubeconfig for Amazon EKS][1]


[1]:

[To see links please register here]

Reply

#16
As of now, the aks run command adds a [fourth option][1] to connect to private clusters extending [@Darius][2]'s [three options][3] posted earlier:

> 4. Use the [AKS Run Command feature][4].

Below are some copy/paste excerpts of a simple command, and one that requires a file. It is possible to chain multiple commands with `&&`.
```shell
az aks command invoke \
--resource-group myResourceGroup \
--name myAKSCluster \
--command "kubectl get pods -n kube-system"

az aks command invoke \
--resource-group myResourceGroup \
--name myAKSCluster \
--command "kubectl apply -f deployment.yaml -n default" \
--file deployment.yaml
```
In case you get a `(ResourceGroupNotFound)` error, try adding the subscription, too

```shell
az aks command invoke \
--resource-group myResourceGroup \
--name myAKSCluster \
--subscription <subscription> \
--command "kubectl get pods -n kube-system"
```
You can also configure the default subscription:
```shell
az account set -s <subscription>
```

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

[4]:

[To see links please register here]

Reply

#17
I faced the same issue and resolved it by deleting `.kube` folder which was under the following path `C:\Users\<your_username>` and then restarting kubernetes cluster.
Reply

#18
After spending many hours just realize that this may be internal bug.

I ran below command and it works:

az aks get-credentials --resource-group resource-group-name --name aks-cluster-name

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through