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

Kubernetes installation fails for multi-node rke2 cluster #645

Closed
fdegir opened this issue Jan 27, 2025 · 1 comment · Fixed by #646
Closed

Kubernetes installation fails for multi-node rke2 cluster #645

fdegir opened this issue Jan 27, 2025 · 1 comment · Fixed by #646

Comments

@fdegir
Copy link
Contributor

fdegir commented Jan 27, 2025

When deploying a multi-node rke2 cluster using the EIB from main branch with commit 41c61610 together with the included EIB definition file, installation fails during the combustion phase with the error below.

Running 20-k8s-install.sh
Created symlink /etc/systemd/system/multi-user.target.wants/kubernetes-resources-install.service -> /etc/systemd/system/kubernetes-resources-install.service.
./20-k8s-install.sh: line 97: syntax error near unexpected token `fi'

Upon looking at the generated 20-k8s-install.sh script, the issue is identified as the empty if block as below.

if [ "$NODETYPE" = "server" ]; then
fi

This block comes from the template rke2-multi-node-installer.sh.tpl

if [ "$NODETYPE" = "server" ]; then
{{- if .setNodeIPScript }}
sh {{ .setNodeIPScript }}
{{- end }}
fi

Updating the template as below and building EIB with it resolves the issue however this is probably not the correct way to fix the issue.

if [ "$NODETYPE" = "server" ]; then
{{- if .setNodeIPScript }}
sh {{ .setNodeIPScript }}
{{- else }}
:
{{- end }}
fi

The same code block exists in k3s-multi-node-installer.sh.tpl as well.

The EIB definition file is below.

apiVersion: 1.1
image:
  arch: x86_64
  baseImage: SL-Micro.x86_64-6.1-Default-SelfInstall-GM.install.iso
  imageType: iso
  outputImageName: 3xvms-management-eib.iso
kubernetes:
  helm:
    charts:
    - createNamespace: true
      installationNamespace: kube-system
      name: cert-manager
      repositoryName: jetstack
      targetNamespace: cert-manager
      valuesFile: certmanager.yaml
      version: 1.14.2
    - createNamespace: true
      installationNamespace: kube-system
      name: rancher
      repositoryName: rancher-prime
      targetNamespace: cattle-system
      valuesFile: rancher.yaml
      version: 2.10.1
    - createNamespace: true
      installationNamespace: kube-system
      name: elemental-operator-crds-chart
      repositoryName: elemental-operator-crds-chart
      targetNamespace: cattle-elemental-system
      valuesFile: elementalcrd.yaml
      version: 1.6.5
    - createNamespace: true
      installationNamespace: kube-system
      name: elemental-operator-chart
      repositoryName: elemental-operator-chart
      targetNamespace: cattle-elemental-system
      valuesFile: elemental.yaml
      version: 1.6.5
    - createNamespace: true
      installationNamespace: kube-system
      name: elemental
      repositoryName: elementalui
      targetNamespace: cattle-ui-plugin-system
      valuesFile: elementaldashboard.yaml
      version: 3.0.0
    repositories:
    - authentication: {}
      name: jetstack
      plainHTTP: false
      skipTLSVerify: true
      url: https://charts.jetstack.io
    - authentication: {}
      name: rancher-prime
      plainHTTP: false
      skipTLSVerify: true
      url: https://charts.rancher.com/server-charts/prime
    - authentication: {}
      name: elemental-operator-crds-chart
      plainHTTP: false
      skipTLSVerify: false
      url: oci://registry.suse.com/rancher
    - authentication: {}
      name: elemental-operator-chart
      plainHTTP: false
      skipTLSVerify: false
      url: oci://registry.suse.com/rancher
    - authentication: {}
      name: elementalui
      plainHTTP: false
      skipTLSVerify: false
      url: https://github.com/rancher/ui-plugin-charts/raw/main
  network:
    apiHost: 192.168.122.10.sslip.io
    apiVIP: 192.168.122.10
  nodes:
  - hostname: host1rke2
    initializer: true
    type: server
  - hostname: host2rke2
    initializer: false
    type: server
  - hostname: host3rke2
    initializer: false
    type: server
  version: v1.31.3+rke2r1
operatingSystem:
  isoConfiguration:
    installDevice: /dev/vda
  packages:
    additionalRepos:
    - url: http://download.nue.suse.com/ibs/SUSE:/CA/SLE_15/
    packageList:
    - jq
    - ca-certificates-suse
    - qemu-guest-agent
    sccRegistrationCode: <masked>
  systemd:
    disable:
    - rebootmgr.service
    - transactional-update.timer
    - transactional-update-cleanup.timer
    enable:
    - qemu-guest-agent
  users:
  - createHomeDir: true
    encryptedPassword: <masked>
    sshKeys:
    - <masked>
    username: root
@atanasdinov
Copy link
Contributor

@dbw7 Could you please take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants