Comments (5)
main.tf provider.tf versions.tf
[ec2-user@ip-172-31-24-202 TF]$ cat provider.tf
provider "aws" {
profile = "default"
region = "eu-central-1"
}
provider "k0s" {
}
[ec2-user@ip-172-31-24-202 TF]$ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding latest version of hashicorp/aws...
- Finding latest version of hashicorp/k0s...
- Installing hashicorp/aws v5.0.1...
- Installed hashicorp/aws v5.0.1 (signed by HashiCorp)
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/k0s: provider registry
│ registry.terraform.io does not have a provider named registry.terraform.io/hashicorp/k0s
│
│ All modules should specify their required_providers so that external consumers will get the correct providers when
│ using a module. To see which modules are currently depending on hashicorp/k0s, run the following command:
│ terraform providers
╵
from terraform-provider-k0s.
It seems that you have not correctly specified the provider in the required_providers
block.
You should do like this:
terraform {
required_providers {
k0s = {
source = "alessiodionisi/k0s"
version = "0.1.0"
}
}
}
from terraform-provider-k0s.
Hi Alessio,
Thanks that helped me, but I have hit the next challenge...
k0s_cluster.MyK0sCluster: Creating...
╷
│ Error: k0sctl Error
│
│ with k0s_cluster.MyK0sCluster,
│ on main.tf line 212, in resource "k0s_cluster" "MyK0sCluster":
│ 212: resource "k0s_cluster" "MyK0sCluster" {
│
│ Unable to create cluster, got error: failed on 3 hosts:
│ - [SSH] 3.70.187.131: not connected: client connect: can't connect: create config: can't connect: no usable authentication method found
│ - [SSH] 3.71.5.113: not connected: client connect: can't connect: create config: can't connect: no usable authentication method found
│ - [SSH] 3.75.208.22: not connected: client connect: can't connect: create config: can't connect: no usable authentication method found
[ec2-user@ip-172-31-26-150 K0s_provider]$ ssh [email protected] -i /home/ec2-user/.ssh/roha_account2.pem
The authenticity of host '3.70.187.131 (3.70.187.131)' can't be established.
ECDSA key fingerprint is SHA256:UXOakZLxLxzUeouVBbiUBcAmzQP9/8t086sHssoC55w.
ECDSA key fingerprint is MD5:71:cd:eb:2e:c7:ac:e1:b5:b6:36:17:11:e6:c7:66:0e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '3.70.187.131' (ECDSA) to the list of known hosts.
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-1038-aws x86_64)
Connection is not a problem. But it needs a fingerprint (that should be a problem hopefully...?).
resource "k0s_cluster" "MyK0sCluster" {
name = "RoHaCluster"
version = "1.23.8+k0s.0"
hosts = [
{
role = "controller+worker"
ssh = {
address = aws_instance.server1.public_ip
port = 22
user = "ubuntu"
key_path = "/home/ec2-user/.ssh/roha_account2.pem"
}
},
{
role = "worker"
ssh = {
address = aws_instance.server2.public_ip
port = 22
user = "ubuntu"
key_path = "/home/ec2-user/.ssh/roha_account2.pem"
}
},
{
role = "worker"
ssh = {
address = aws_instance.server3.public_ip
port = 22
user = "ubuntu"
key_path = "/home/ec2-user/.ssh/roha_account2.pem"
}
} ]
depends_on = [time_sleep.wait_30_seconds]
}
As you can tell, I have already introduced a 60 (says 30) second time to build the EC2 instance and be ready for connections.
Any ideas, where I messed up?
from terraform-provider-k0s.
Hi,
It appears that key_path
isn't honored. In your paste above you supply one though. So it defaults to whatever is the default key for your installation.
#51 should fix this one (although I met more down the road)
from terraform-provider-k0s.
Waiting feedbacks from @RobertMirantis
from terraform-provider-k0s.
Related Issues (10)
- init fails HOT 1
- Provider fails with more than 1 host without a private address
- plugin panics when the architecture is ARM64 HOT 7
- How do I specify the `--no-wait` flag? HOT 7
- Export an output variable with the full k0sctl.yml file content HOT 2
- Get access data (kubeconfig or equivalent) HOT 3
- Feature Request: Ability to pass ssh key value directly instead of `key_path`
- Node removal not supported, however it "works" in unexpected manner HOT 1
- Add support for SSH password instead of keys
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-provider-k0s.