8000 [POC] Add ignite configuration file support by darkowlzz · Pull Request #555 · weaveworks/ignite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 7, 2023. It is now read-only.

[POC] Add ignite configuration file support #555

Closed
wants to merge 1 commit into from

Conversation

darkowlzz
Copy link
Contributor

Defines APIs for ignite configurations with Configuration object.

Adds a new persistent flag at the root command, ignite-config.
This flag can be used to set the file path of an ignite config file.

An ignite config file contains the ignite Configuration object. It can
be used to set the default configurations of various ignite components.
By default, if a config file is found in /etc/ignite/config.yaml, it is
used to configure ignite. --ignite-config flag can be used to override
any default config path.

Example of a config file:

apiVersion: ignite.weave.works/v1alpha2
kind: Configuration
metadata:
  name: production-config
spec:
  runtime: containerd
  networkPlugin: cni
  sandbox:
    oci: "docker.io/darkowlzz/ignite:dev"
  vm:
    cpus: 1
    memory: "2GB"
    diskSize: "1GB"
    image:
      oci: "weaveworks/ignite-ubuntu"
    kernel:
      oci: "darkowlzz/ignite-kernel:5.3"

When a config file is used, ignite command execution logs the name of the config file being used:

# ignite run weaveworks/ignite-ubuntu:latest --ssh --name my-vm1
INFO[0000] Using ignite configuration file: /etc/ignite/config.yaml 
INFO[0001] Created VM with ID "258fc2e5ff2c1c75" and name "my-vm1" 
INFO[0001] Networking is handled by "cni"               
INFO[0001] Started Firecracker VM "258fc2e5ff2c1c75" in a container with ID "ignite-258fc2e5ff2c1c75" 

A local config file can be passed as:

# ignite run weaveworks/ignite-ubuntu --name my-vm1 --ignite-config=ignite-config.yaml

Related to #315

Defines APIs for ignite configurations with `Configuration` object.

Adds a new persistent flag at the root command, `ignite-config`.
This flag can be used to set the file path of an ignite config file.

An ignite config file contains the ignite Configuration object. It can
be used to set the default configurations of various ignite components.
By default, if a config file is found in /etc/ignite/config.yaml, it is
used to configure ignite. `--ignite-config` flag can be used to override
any default global config.
@darkowlzz
Copy link
Contributor Author
darkowlzz commented Mar 9, 2020

This supports a subset of the configurations discussed in #315 . Will add more options based on the feedback. The default config file path may also change based on the feedback.
Will add tests after discussing this approach.

// be created without setting a valid value. Need zero valued variable to
// know if the flag was set or not.
KernelOCI string
VMStorage api.VMStorageSpec
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaced the VM object with individual elements to be able to know if a flag is set or not. When using a VM object, the VM properties are set to the defaults. Using that as flag variables makes it hard to know if a flag was set or empty. With this, these properties are set on the base VM configuration only when the value of these flag variables are non-zero.

@darkowlzz
Copy link
Contributor Author

New implementation in #601 . Closing this.

@darkowlzz darkowlzz closed this Jun 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0