piątek, 28 stycznia 2022

Terraform, DigitalOcean, Failed to query available provider packages

There is slight chance that during getting started with Digital Ocean tutorial you encountered the following error
$ terraform init                

Initializing the backend...

Initializing provider plugins...
- Finding latest version of hashicorp/digitalocean...
│ Error: Failed to query available provider packages
The solution to that is deliver required_providers section into your main.tf
terraform {
    required_providers {
        digitalocean = {
            source = "digitalocean/digitalocean"
            version = ">= 2.4.0"
        kubernetes = {
            source = "hashicorp/kubernetes"
            version = ">= 2.0.0"
Now the terraform init command should be executed successfully

piątek, 14 stycznia 2022

Minikube - Failed to pull image - connection refused

Failed to pull image "nginx": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on read udp> read: connection refused
Below yuo can find a sequence of commands that worked for me. First go to minicube shell and try to re the registry-1.docker.io
$ minikube ssh
$ nslookup registry-1.docker.io
If it does not show the list of ips we've got the culprit.
$ su - root
# vi /etc/resolv.conf
# put a your favourite public DNS instead the one its defined
One extra thing you need to do is stop the systemd-resolved process
# systemctl stop systemd-resolved
Now there should fine, kuberetes will be able to download images.