Coder Social home page Coder Social logo

Comments (5)

leifmadsen avatar leifmadsen commented on June 18, 2024

Should be pretty straight forward now that feature/ipv6 is merged. Will start working on building this out as I'll need it for a development box. We don't want all our VMs to be provisioned with 24GB of RAM :)

from kube-ansible.

leifmadsen avatar leifmadsen commented on June 18, 2024

@dougbtv @fepan @s1061123, so I have a design question about what I want to do here.

We currently have this:

virtual_machines:                                                               
  - name: kube-master                                                           
    node_type: master                                                              
  - name: kube-node-1                                                                                                                                                                                                                          
    node_type: nodes                                                               
  - name: kube-node-2                                                              
    node_type: nodes                                                               
  - name: kube-node-3                                                              
    node_type: nodes                                                               
# - name: my-support-node                                                          
#   node_type: other                                                               
vm_parameters_ram_mb: 2048                                                         
vm_parameters_cpus: 4      

What I want to do is move the values of the vm_parameters_... to be available to the virtual_machines so that I can specify different RAM and CPU values for the machines.

I was just thinking of doing something like this:

virtual_machines:
  - name: kube-master
    node_type: master
    vm_parameters_ram_mb: 2048
    vm_parameters_cpus: 4

But then I was thinking, that maybe we'll just keep adding more and more things here... so maybe we should have a parameters dictionary?

virtual_machines:
  - name: kube-master
    node_type: master
    parameters:
        ram_mb: 2048
        cpus: 4

I'd also want to set a default, so I'd be replacing vm_parameters_... with something like:

default_parameter_ram_mb: 2048

Then if the individual dictionaries were missing, then I'd just consume the default values. Thoughts?

from kube-ansible.

dougbtv avatar dougbtv commented on June 18, 2024

I, for one, really like this design. particularly the replacing the vm_parameters_* with a default_vm_parameter_* and then having the virtual_machines list of hashes with an extra param dictionary. That looks great.

The logic for weaving in the defaults doesn't come to me easily, but, it sounds fun to slang (if it's not painful, lol)

from kube-ansible.

leifmadsen avatar leifmadsen commented on June 18, 2024

Yea, I'm worried a bit about the default values, but I think I might know how to tackle that. We shall see! Thanks for the feedback. Going to work on this today.

from kube-ansible.

leifmadsen avatar leifmadsen commented on June 18, 2024

OK so I had to flatten the dictionary because of these problems:

ansible/ansible#30944 (comment)

That's why things are flat in the PR.

from kube-ansible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.