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

Disable helm installation when deploying a non-K8s cluster #1349

Closed
przemyslavic opened this issue Jun 10, 2020 · 2 comments · Fixed by #1360
Closed

Disable helm installation when deploying a non-K8s cluster #1349

przemyslavic opened this issue Jun 10, 2020 · 2 comments · Fixed by #1360
Assignees
Labels

Comments

@przemyslavic
Copy link
Collaborator

Adjusting the feature-mapping configuration I had to add the helm role to the repository host to be able to deploy a non-k8s cluster. Otherwise the installation fails on the helm: Unpack Helm binary task.

2020-06-09T16:08:14.2331424Z 16:08:14 INFO cli.engine.ansible.AnsibleCommand - TASK [helm : Unpack Helm binary] ***********************************************
2020-06-09T16:08:14.2507270Z 16:08:14 INFO cli.engine.ansible.AnsibleCommand - fatal: [ci-fixazurrhelflannel-load-balancer-vm-0]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'dict object' has no attribute 'version'\n\nThe error appears to be in '/shared/build/fixazurrhelflannel/ansible/roles/helm/tasks/install-bin.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Unpack Helm binary\n  ^ here\n"}

There is no reason to install helm if we don't have kubernetes.

@mkyc
Copy link
Contributor

mkyc commented Jun 22, 2020

@sk4zuzu this bug should go to "DoD Check"

@sk4zuzu
Copy link
Contributor

sk4zuzu commented Jun 25, 2020

Couple of issues fixed here:

  1. The helm inventory group has been reused, that allowed skipping all role tasks in ansible, when the helm role is absent from all features inside the feature-mapping.

  2. The fix from 1. above did not completely solve the problem, there was an issue with installation of helm binary. Despite the disabling of the helm role, the helm binary is still being installed in the repository role. The repository role borrows code that installs helm binary and originally version string of the binary was defined in role vars of the helm role, which in turn were not available when helm role was disabled. This has been corrected.

  3. Problem stated in 2. above is more of a general kind. We usually put some package in repository and define some version in config defaults (those things must match so there is no mistake). So the download role has been extended with the method to get the latest file from the repository and make definition of the artifact version in config defaults redundant (this code can be reused not only from the helm role).

  4. Execution of the role has been narrowed to minimal number of hosts in the cluster.

  5. Extra ability to install helm chart without custom values.yaml has been added.

  6. Some minor refactor and cleanups like removing trailing witespace and restructuring code to improve readability has been done as well.

Here's an example how to disable helm and kubernetes and still deploy Epiphany:

kind: epiphany-cluster
title: "Epiphany cluster Config"
name: any2
specification:
  name: any2
  admin_user:
    name: ubuntu
    key_path: /workspaces/epiphany/core/src/epicli/clusters/id_rsa
  components:
    kubernetes_master:
      count: 0
    kubernetes_node:
      count: 0
    logging:
      count: 0
    monitoring:
      count: 0
    kafka:
      count: 0
    postgresql:
      count: 0
    load_balancer:
      count: 0
    standalone_repository:
      count: 1
      configuration: default
      machines:
        - default-repo1
    rabbitmq:
      count: 3
      machines:
        - default-rmq1
        - default-rmq2
        - default-rmq3
provider: any
---
kind: configuration/feature-mapping
title: Feature mapping to roles
name: any2
specification:
  roles_mapping:
    standalone_repository:
      - repository
      - image-registry
      #- helm
      - firewall
provider: any
---
kind: configuration/rabbitmq
title: "RabbitMQ"
name: default
specification:
  version: 3.7.10
  rabbitmq_user: rabbitmq
  rabbitmq_group: rabbitmq
  logrotate_period: weekly
  logrotate_number: 10
  ulimit_open_files: 65535
  amqp_port: 5672
  rabbitmq_use_longname: true
  rabbitmq_policies: []
  rabbitmq_plugins: []
  custom_configurations: []
  cluster:
    is_clustered: true
provider: any
---
kind: infrastructure/machine
provider: any
name: default-repo1
specification:
  hostname: y1a1
  ip: 10.30.2.10
---
kind: infrastructure/machine
provider: any
name: default-rmq1
specification:
  hostname: y1b1
  ip: 10.30.2.20
---
kind: infrastructure/machine
provider: any
name: default-rmq2
specification:
  hostname: y1b2
  ip: 10.30.2.21
---
kind: infrastructure/machine
provider: any
name: default-rmq3
specification:
  hostname: y1b3
  ip: 10.30.2.22

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

Successfully merging a pull request may close this issue.

3 participants