Use flat source insted of submodule in envoy cos module (#72)
* use fabric format for in/out table in cos-generic-metadata module's README * switch to flat modulespace in envoy cos module
This commit is contained in:
parent
78b0d6a9e7
commit
f1924914af
|
@ -21,9 +21,7 @@ module "cos-envoy" {
|
|||
container_args = "-c /etc/envoy/envoy.yaml --log-level info --allow-unknown-static-fields"
|
||||
|
||||
container_volumes = [
|
||||
{ host = "/etc/envoy/envoy.yaml",
|
||||
container = "/etc/envoy/envoy.yaml"
|
||||
}
|
||||
{ host = "/etc/envoy/envoy.yaml", container = "/etc/envoy/envoy.yaml" }
|
||||
]
|
||||
|
||||
docker_args = "--network host --pid host"
|
||||
|
@ -63,25 +61,25 @@ module "cos-envoy" {
|
|||
<!-- BEGIN TFDOC -->
|
||||
## Variables
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|------|---------|:--------:|
|
||||
| container\_image | Container image. | `string` | n/a | yes |
|
||||
| boot\_commands | List of cloud-init `bootcmd`s | `list(string)` | `[]` | no |
|
||||
| cloud\_config | Cloud config template path. If provided, takes precedence over all other arguments. | `string` | `null` | no |
|
||||
| config\_variables | Additional variables used to render the template passed via `cloud_config` | `map(any)` | `{}` | no |
|
||||
| container\_args | Arguments for container | `string` | `""` | no |
|
||||
| container\_name | Name of the container to be run | `string` | `"container"` | no |
|
||||
| container\_volumes | List of volumes | <pre>list(object({<br> host = string,<br> container = string<br> }))</pre> | `[]` | no |
|
||||
| docker\_args | Extra arguments to be passed for docker | `string` | `null` | no |
|
||||
| file\_defaults | Default owner and permissions for files. | <pre>object({<br> owner = string<br> permissions = string<br> })</pre> | <pre>{<br> "owner": "root",<br> "permissions": "0644"<br>}</pre> | no |
|
||||
| files | Map of extra files to create on the instance, path as key. Owner and permissions will use defaults if null. | <pre>map(object({<br> content = string<br> owner = string<br> permissions = string<br> }))</pre> | `{}` | no |
|
||||
| gcp\_logging | Should container logs be sent to Google Cloud Logging | `bool` | `true` | no |
|
||||
| run\_commands | List of cloud-init `runcmd`s | `list(string)` | `[]` | no |
|
||||
| users | List of usernames to be created. If provided, first user will be used to run the container. | <pre>list(object({<br> username = string,<br> uid = number,<br> }))</pre> | `[]` | no |
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---: |:---:|:---:|
|
||||
| container_image | Container image. | <code title="">string</code> | ✓ | |
|
||||
| *boot_commands* | List of cloud-init `bootcmd`s | <code title="list(string)">list(string)</code> | | <code title="">[]</code> |
|
||||
| *cloud_config* | Cloud config template path. If provided, takes precedence over all other arguments. | <code title="">string</code> | | <code title="">null</code> |
|
||||
| *config_variables* | Additional variables used to render the template passed via `cloud_config` | <code title="map(any)">map(any)</code> | | <code title="">{}</code> |
|
||||
| *container_args* | Arguments for container | <code title="">string</code> | | <code title=""></code> |
|
||||
| *container_name* | Name of the container to be run | <code title="">string</code> | | <code title="">container</code> |
|
||||
| *container_volumes* | List of volumes | <code title="list(object({ host = string, container = string }))">list(object({...}))</code> | | <code title="">[]</code> |
|
||||
| *docker_args* | Extra arguments to be passed for docker | <code title="">string</code> | | <code title="">null</code> |
|
||||
| *file_defaults* | Default owner and permissions for files. | <code title="object({ owner = string permissions = string })">object({...})</code> | | <code title="{ owner = "root" permissions = "0644" }">...</code> |
|
||||
| *files* | Map of extra files to create on the instance, path as key. Owner and permissions will use defaults if null. | <code title="map(object({ content = string owner = string permissions = string }))">map(object({...}))</code> | | <code title="">{}</code> |
|
||||
| *gcp_logging* | Should container logs be sent to Google Cloud Logging | <code title="">bool</code> | | <code title="">true</code> |
|
||||
| *run_commands* | List of cloud-init `runcmd`s | <code title="list(string)">list(string)</code> | | <code title="">[]</code> |
|
||||
| *users* | List of usernames to be created. If provided, first user will be used to run the container. | <code title="list(object({ username = string, uid = number, }))">list(object({...}))</code> | | <code title="[ ]">...</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| cloud\_config | Rendered cloud-config file to be passed as user-data instance metadata. |
|
||||
| name | description | sensitive |
|
||||
|---|---|:---:|
|
||||
| cloud_config | Rendered cloud-config file to be passed as user-data instance metadata. | |
|
||||
<!-- END TFDOC -->
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
This module manages a `cloud-config` configuration that starts a containerized Envoy Proxy on Container Optimized OS connected to Traffic Director. The default configuration creates a reverse proxy exposed on the node's port 80. Traffic routing policies and management should be managed by other means via Traffic Director.
|
||||
|
||||
The generated cloud config is rendered in the `cloud_config` output, and is meant to be used in instances or instance templates via the `user-data` metadata.
|
||||
|
||||
This module depends on the [`cos-generic-metadata` module](../cos-generic-metadata) being the parent folder. If you change its location be sure to adjust the `source` attribute in `main.tf`.
|
||||
|
||||
## Examples
|
||||
|
||||
### Default configuration
|
||||
|
@ -46,14 +50,14 @@ module "vm-cos" {
|
|||
<!-- BEGIN TFDOC -->
|
||||
## Variables
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|------|---------|:--------:|
|
||||
| envoy\_image | Envoy Proxy container image to use. | `string` | `"envoyproxy/envoy:v1.14.1"` | no |
|
||||
| gcp\_logging | Should container logs be sent to Google Cloud Logging | `bool` | `true` | no |
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---: |:---:|:---:|
|
||||
| *envoy_image* | Envoy Proxy container image to use. | <code title="">string</code> | | <code title="">envoyproxy/envoy:v1.14.1</code> |
|
||||
| *gcp_logging* | Should container logs be sent to Google Cloud Logging | <code title="">bool</code> | | <code title="">true</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| cloud\_config | Rendered cloud-config file to be passed as user-data instance metadata. |
|
||||
| name | description | sensitive |
|
||||
|---|---|:---:|
|
||||
| cloud_config | Rendered cloud-config file to be passed as user-data instance metadata. | |
|
||||
<!-- END TFDOC -->
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
module "cos-envoy-td" {
|
||||
source = "./modules/cos-generic-metadata"
|
||||
source = "../cos-generic-metadata"
|
||||
|
||||
boot_commands = [
|
||||
"systemctl start node-problem-detector",
|
||||
|
@ -26,9 +26,7 @@ module "cos-envoy-td" {
|
|||
container_args = "-c /etc/envoy/envoy.yaml --log-level info --allow-unknown-static-fields"
|
||||
|
||||
container_volumes = [
|
||||
{ host = "/etc/envoy/envoy.yaml",
|
||||
container = "/etc/envoy/envoy.yaml"
|
||||
}
|
||||
{ host = "/etc/envoy/envoy.yaml", container = "/etc/envoy/envoy.yaml" }
|
||||
]
|
||||
|
||||
docker_args = "--network host --pid host"
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
../../cos-generic-metadata
|
Loading…
Reference in New Issue