k8s-proxmox / cluster-api-provider-proxmox

Cluster API provider implementation for Proxmox VE
Apache License 2.0
94 stars 11 forks source link

The failure in running clusterctl init command #103

Closed Rwatana closed 8 months ago

Rwatana commented 8 months ago

/kind bug

What steps did you take and what happened: I simply run the command according to the read.md file

clusterctl init --infrastructure=proxmox:v0.3.1 --config https://raw.githubusercontent.com/sp-yduck/cluster-api-provider-proxmox/main/clusterctl.yaml

What did you expect to happen: I expect to happen that the sentence that show the success messages.

Anything else you would like to add: I am a beginner of infrastructure engineer. So the failure may result in small problem. But I couldn't solve. Please help me with this issue.

Environment: I run this command in VM created by using cloud-init template

sp-yduck commented 8 months ago

could you share some error messages returned from clusterctl command ?

Rwatana commented 8 months ago

Sorry, I forgot to add the error sentence.

clusterctl init --infrastructure=proxmox:v0.3.1 --config https://raw.githubusercontent.com/sp-yduck/cluster-api-provider-proxmox/main/clusterctl.yaml
Fetching providers
Error: failed to get provider components for the "proxmox:v0.3.1" provider: failed to get configuration for the InfrastructureProvider with name proxmox. Please check the provider name and/or add configuration for new providers using the .clusterctl config file

this is the result of message. Please check.

sp-yduck commented 8 months ago

It's completely working fine for me. please check your connectivity for github and its api. for further investigation, you can use -v=5 flags to see more detailed logs. possible cause is you were reaching rate limit of github api. like

Error: failed to get provider components for the "proxmox:v0.3.1" provider: failed to read "infrastructure-components.yaml" from provider's repository "infrastructure-proxmox": failed to download files from GitHub release v0.3.1: rate limit for github api has been reached. Please wait one hour or get a personal API token and assign it to the GITHUB_TOKEN environment variable
Rwatana commented 8 months ago

My try

Thanks for helping me.

  1. this is the result when I add -v=5 line
    Fetching providers
    Fetching File="core-components.yaml" Provider="cluster-api" Version="v1.5.2"
    Fetching File="bootstrap-components.yaml" Provider="bootstrap-kubeadm" Version="v1.5.2"
    Fetching File="control-plane-components.yaml" Provider="control-plane-kubeadm" Version="v1.5.2"
    Error: failed to get provider components for the "proxmox:v0.3.1" provider: failed to get configuration for the InfrastructureProvider with name proxmox. Please check the provider name and/or add configuration for new providers using the .clusterctl config file
  2. this is the result of checking GitHub api connectivity by using curl command. here is the result.
    *   Trying 20.27.177.116:443...
    * TCP_NODELAY set
    * Connected to api.github.com (20.27.177.116) port 443 (#0)
    * ALPN, offering h2
    * ALPN, offering http/1.1
    * successfully set certificate verify locations:
    *   CAfile: /etc/ssl/certs/ca-certificates.crt
    CApath: /etc/ssl/certs
    * TLSv1.3 (OUT), TLS handshake, Client hello (1):
    * TLSv1.3 (IN), TLS handshake, Server hello (2):
    * TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
    * TLSv1.3 (IN), TLS handshake, Certificate (11):
    * TLSv1.3 (IN), TLS handshake, CERT verify (15):
    * TLSv1.3 (IN), TLS handshake, Finished (20):
    * TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
    * TLSv1.3 (OUT), TLS handshake, Finished (20):
    * SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
    * ALPN, server accepted to use h2
    * Server certificate:
    *  subject: C=US; ST=California; L=San Francisco; O=GitHub, Inc.; CN=*.github.com
    *  start date: Feb 16 00:00:00 2023 GMT
    *  expire date: Mar 15 23:59:59 2024 GMT
    *  subjectAltName: host "api.github.com" matched cert's "*.github.com"
    *  issuer: C=US; O=DigiCert Inc; CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1
    *  SSL certificate verify ok.
    * Using HTTP2, server supports multi-use
    * Connection state changed (HTTP/2 confirmed)
    * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
    * Using Stream ID: 1 (easy handle 0x5573f7834b30)
    > GET / HTTP/2
    > Host: api.github.com
    > user-agent: curl/7.68.0
    > accept: */*
    >
    * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
    * TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
    * old SSL session ID is stale, removing
    * Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
    < HTTP/2 200
    < server: GitHub.com
    < date: Wed, 18 Oct 2023 04:20:47 GMT
    < content-type: application/json; charset=utf-8
    < cache-control: public, max-age=60, s-maxage=60
    < vary: Accept, Accept-Encoding, Accept, X-Requested-With
    < etag: W/"4f825cc84e1c733059d46e76e6df9db557ae5254f9625dfe8e1b09499c449438"
    < x-github-media-type: github.v3; format=json
    < x-github-api-version-selected: 2022-11-28
    < access-control-expose-headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset
    < access-control-allow-origin: *
    < strict-transport-security: max-age=31536000; includeSubdomains; preload
    < x-frame-options: deny
    < x-content-type-options: nosniff
    < x-xss-protection: 0
    < referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
    < content-security-policy: default-src 'none'
    < x-ratelimit-limit: 60
    < x-ratelimit-remaining: 48
    < x-ratelimit-reset: 1697605488
    < x-ratelimit-resource: core
    < x-ratelimit-used: 12
    < accept-ranges: bytes
    < content-length: 2396
    < x-github-request-id: EB46:2ED650:2C7F2C:2E37E6:652F5D1F
    <
    {
    "current_user_url": "https://api.github.com/user",
    "current_user_authorizations_html_url": "https://github.com/settings/connections/applications{/client_id}",
    "authorizations_url": "https://api.github.com/authorizations",
    "code_search_url": "https://api.github.com/search/code?q={query}{&page,per_page,sort,order}",
    "commit_search_url": "https://api.github.com/search/commits?q={query}{&page,per_page,sort,order}",
    "emails_url": "https://api.github.com/user/emails",
    "emojis_url": "https://api.github.com/emojis",
    "events_url": "https://api.github.com/events",
    "feeds_url": "https://api.github.com/feeds",
    "followers_url": "https://api.github.com/user/followers",
    "following_url": "https://api.github.com/user/following{/target}",
    "gists_url": "https://api.github.com/gists{/gist_id}",
    "hub_url": "https://api.github.com/hub",
    "issue_search_url": "https://api.github.com/search/issues?q={query}{&page,per_page,sort,order}",
    "issues_url": "https://api.github.com/issues",
    "keys_url": "https://api.github.com/user/keys",
    "label_search_url": "https://api.github.com/search/labels?q={query}&repository_id={repository_id}{&page,per_page}",
    "notifications_url": "https://api.github.com/notifications",
    "organization_url": "https://api.github.com/orgs/{org}",
    "organization_repositories_url": "https://api.github.com/orgs/{org}/repos{?type,page,per_page,sort}",
    "organization_teams_url": "https://api.github.com/orgs/{org}/teams",
    "public_gists_url": "https://api.github.com/gists/public",
    "rate_limit_url": "https://api.github.com/rate_limit",
    "repository_url": "https://api.github.com/repos/{owner}/{repo}",
    "repository_search_url": "https://api.github.com/search/repositories?q={query}{&page,per_page,sort,order}",
    "current_user_repositories_url": "https://api.github.com/user/repos{?type,page,per_page,sort}",
    "starred_url": "https://api.github.com/user/starred{/owner}{/repo}",
    "starred_gists_url": "https://api.github.com/gists/starred",
    "topic_search_url": "https://api.github.com/search/topics?q={query}{&page,per_page}",
    "user_url": "https://api.github.com/users/{user}",
    "user_organizations_url": "https://api.github.com/user/orgs",
    "user_repositories_url": "https://api.github.com/users/{user}/repos{?type,page,per_page,sort}",
    "user_search_url": "https://api.github.com/search/users?q={query}{&page,per_page,sort,order}"
    }
    * Connection #0 to host api.github.com left intact

    it seems that status is good.

    Question

    Are there any factors that cause the error.

sp-yduck commented 8 months ago

could you try

clusterctl config repositories --config https://raw.githubusercontent.com/sp-yduck/cluster-api-provider-proxmox/main/clusterctl.yaml

and check if you can see this following line

proxmox        InfrastructureProvider   https://github.com/sp-yduck/cluster-api-provider-proxmox/releases/latest/                 infrastructure-components.yaml
Rwatana commented 8 months ago

I tried the command and the results are below


NAME          TYPE                     URL
cluster-api   CoreProvider             https://github.com/kubernetes-sigs/cluster-api/releases/latest/core-components.yaml
kubeadm       BootstrapProvider        https://github.com/kubernetes-sigs/cluster-api/releases/latest/bootstrap-components.yaml
kubeadm       ControlPlaneProvider     https://github.com/kubernetes-sigs/cluster-api/releases/latest/control-plane-components.yaml
aws           InfrastructureProvider   https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/latest/infrastructure-components.yaml
azure         InfrastructureProvider   https://github.com/kubernetes-sigs/cluster-api-provider-azure/releases/latest/infrastructure-components.yaml
metal3        InfrastructureProvider   https://github.com/metal3-io/cluster-api-provider-metal3/releases/latest/infrastructure-components.yaml
openstack     InfrastructureProvider   https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/latest/infrastructure-components.yaml
vsphere       InfrastructureProvider   https://github.com/kubernetes-sigs/cluster-api-provider-vsphere/releases/latest/infrastructure-components.yaml

I couldn't see the line that you provide.

what causes this problem. I really reboot by using Proxmox os file and made vm.

sp-yduck commented 8 months ago

the problem might be in your clusterctl and its configuration. please make sure to use latest clusterctl and use https://raw.githubusercontent.com/sp-yduck/cluster-api-provider-proxmox/main/clusterctl.yaml this configuration. I am not sure how your clusterctl override the configuration though,

  1. you can check your config file (by default ~/cluster-api/clusterctl.yaml)
  2. you can check your env var (there might be some env var to set config file path)
  3. you can check official doc for how clusterctl finds each provider
Rwatana commented 8 months ago

If I uninstall and delete the file related to clusterctl and reinstall it, I could succeed. this problem my because of the failure in installing it.

Thanks for your help