Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Add validation to check hostnames for on-prem deployment #2644

Closed
7 of 10 tasks
rafzei opened this issue Sep 30, 2021 · 2 comments
Closed
7 of 10 tasks

[BUG] Add validation to check hostnames for on-prem deployment #2644

rafzei opened this issue Sep 30, 2021 · 2 comments
Assignees
Labels

Comments

@rafzei
Copy link
Contributor

rafzei commented Sep 30, 2021

Describe the bug
Deployment on-prem cluster failed due to the wrong hostname format.

kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]\\nnodeRegistration.name: 
Invalid value: \\\"apm_master\\\": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')\\n

Check validations for provider: any
currently, we have (https://github.com/epiphany-platform/epiphany/blob/develop/schema/any/validation/infrastructure/machine.yml):

  properties:
    hostname:
      type: string
    ip:
      type: string

Proposal is to use the above regex as a pattern

Expected behavior
Validation should find wrong hostnames just before cluster setup

Environment

  • Found during on-prem deployment
  • OS: Ubuntu 18.04

epicli version: [epicli --version]
Found in v0.8.3 version but as I see in develop is still the same
K8s 1.18.6


DoD checklist

  • Changelog updated (if affected version was released)
  • COMPONENTS.md updated / doesn't need to be updated
  • Automated tests passed (QA pipelines)
    • apply
    • upgrade
  • Case covered by automated test (if possible)
  • Idempotency tested
  • Documentation updated / doesn't need to be updated
  • All conversations in PR resolved
  • Backport tasks created / doesn't need to be backported
@atsikham
Copy link
Contributor

atsikham commented Oct 8, 2021

There are already similar validations that can be used as example. I remember that I did something similar and it worked for sure - https://github.com/epiphany-platform/epiphany/pull/1814/files.

Also check this doc.

@atsikham atsikham self-assigned this Oct 14, 2021
@atsikham atsikham changed the title [BUG] Add validation to check hostnames when on-prem deployment [BUG] Add validation to check hostnames for on-prem deployment Oct 14, 2021
@przemyslavic przemyslavic self-assigned this Oct 20, 2021
@przemyslavic
Copy link
Collaborator

✔️ Hostname validation for any provider has been added.
A DNS-1123 subdomain must consist of lower case alphanumeric characters, - or ., and must start and end with an alphanumeric character.

@mkyc mkyc closed this as completed Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants