Skip to content

Commit

Permalink
Фиксы репозитория (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexey Orlov <[email protected]>
  • Loading branch information
v1km4n and Alexey Orlov authored Nov 11, 2024
1 parent ab94c00 commit 069520a
Show file tree
Hide file tree
Showing 26 changed files with 133 additions and 88 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/manual_destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,40 @@ jobs:
name: 'Manual Destroy'
runs-on: self-hosted
env:
terraform_link: ${{ secrets.TERRAFORM_BINARY }}
TF_VAR_selectel_domain_name: ${{ secrets.SELECTEL_ID }}
TF_VAR_selectel_user_admin_user: ${{ secrets.SERVICE_USER }}
TF_VAR_selectel_user_admin_password: ${{ secrets.SERVICE_PASSWORD }}
TF_VAR_flavor_name: ${{ secrets.FLAVOR_NAME }}

steps:
- name: Checkout the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup NodeJS v20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup Terraform
uses: hashicorp/[email protected]
with:
terraform_version: "1.5.7"
shell: bash
run: |
curl -o terraform.zip $terraform_link
unzip terraform.zip
rm terraform.zip
chmod 755 terraform
mv terraform /usr/local/bin
- name: Add .terraformrc
shell: bash
run: |
cat <<EOS >> $HOME/.terraformrc
provider_installation {
network_mirror {
url = "https://tf-proxy.selectel.ru/mirror/v1/"
}
}
EOS
- name: Init Terraform
run: >
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
TF_VAR_selectel_domain_name: ${{ secrets.SELECTEL_ID }}
TF_VAR_selectel_user_admin_user: ${{ secrets.SERVICE_USER }}
TF_VAR_selectel_user_admin_password: ${{ secrets.SERVICE_PASSWORD }}
TF_VAR_flavor_name: ${{ secrets.FLAVOR_NAME }}
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }}

steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/opentofu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
TF_VAR_selectel_domain_name: ${{ secrets.SELECTEL_ID }}
TF_VAR_selectel_user_admin_user: ${{ secrets.SERVICE_USER }}
TF_VAR_selectel_user_admin_password: ${{ secrets.SERVICE_PASSWORD }}
TF_VAR_flavor_name: ${{ secrets.FLAVOR_NAME }}
if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }}

steps:
Expand Down
9 changes: 6 additions & 3 deletions README_TF.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | '>= 1.0.0, <= 1.5.7' |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0, <= 1.6.2 |
| <a name="requirement_openstack"></a> [openstack](#requirement\_openstack) | 1.53.0 |
| <a name="requirement_selectel"></a> [selectel](#requirement\_selectel) | 5.1.1 |

Expand Down Expand Up @@ -30,13 +31,14 @@

| Name | Type |
|------|------|
| [openstack_networking_floatingip_associate_v2.association_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_floatingip_associate_v2) | resource |
| [selectel_mks_kube_versions_v1.versions](https://registry.terraform.io/providers/selectel/selectel/5.1.1/docs/data-sources/mks_kube_versions_v1) | data source |
| openstack_networking_floatingip_associate_v2.association_1 | resource |
| selectel_mks_kube_versions_v1.versions | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_flavor_name"></a> [flavor\_name](#input\_flavor\_name) | Название флавора | `string` | n/a | yes |
| <a name="input_os_auth_url"></a> [os\_auth\_url](#input\_os\_auth\_url) | URL до openstack api | `string` | `"https://cloud.api.selcloud.ru/identity/v3"` | no |
| <a name="input_selectel_domain_name"></a> [selectel\_domain\_name](#input\_selectel\_domain\_name) | ID Selectel аккаунта | `string` | n/a | yes |
| <a name="input_selectel_user_admin_password"></a> [selectel\_user\_admin\_password](#input\_selectel\_user\_admin\_password) | Пароль от сервисного пользователя | `string` | n/a | yes |
Expand All @@ -45,3 +47,4 @@
## Outputs

No outputs.
<!-- END_TF_DOCS -->
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module "vm" {
source = "./modules/vm"
os_region = "ru-9"
os_zone = "ru-9a"
vm_name = "github-vm"
vm_name = var.flavor_name
server_root_disk_gb = ["10"]
vm_vcpus = 4
vm_ram_mb = 4096
Expand Down Expand Up @@ -124,7 +124,7 @@ module "mks" {
ng_volume_type = ["fast"]
ng_labels = [{ "role" : "cpu" }]

gpu_nodegroups = 1
gpu_nodegroups = 0
gpu_ng_nodes_count = [1]
gpu_ng_volume_gb = [100]
gpu_ng_volume_type = ["fast"]
Expand Down
6 changes: 4 additions & 2 deletions modules/craas/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
Expand All @@ -18,8 +19,8 @@ No modules.

| Name | Type |
|------|------|
| [selectel_craas_registry_v1.registry_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/craas_registry_v1) | resource |
| [selectel_craas_token_v1.token_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/craas_token_v1) | resource |
| selectel_craas_registry_v1.registry_1 | resource |
| selectel_craas_token_v1.token_1 | resource |

## Inputs

Expand All @@ -34,3 +35,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_craas_password"></a> [craas\_password](#output\_craas\_password) | craas token |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/flavor/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_openstack"></a> [openstack](#requirement\_openstack) | 1.53.0 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [openstack_compute_flavor_v2.flavor](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/compute_flavor_v2) | resource |
| openstack_compute_flavor_v2.flavor | resource |

## Inputs

Expand All @@ -37,3 +37,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_flavor_id"></a> [flavor\_id](#output\_flavor\_id) | n/a |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/floatingip/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_openstack"></a> [openstack](#requirement\_openstack) | 1.53.0 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [openstack_networking_floatingip_v2.floatingip_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/networking_floatingip_v2) | resource |
| openstack_networking_floatingip_v2.floatingip_1 | resource |

## Inputs

Expand All @@ -34,3 +34,4 @@ No modules.
|------|-------------|
| <a name="output_floatingip_address"></a> [floatingip\_address](#output\_floatingip\_address) | floating ip |
| <a name="output_floatingip_id"></a> [floatingip\_id](#output\_floatingip\_id) | floating ip id |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/image_datasource/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_openstack"></a> [openstack](#requirement\_openstack) | 1.53.0 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [openstack_images_image_v2.image_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/data-sources/images_image_v2) | data source |
| openstack_images_image_v2.image_1 | data source |

## Inputs

Expand All @@ -34,3 +34,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_image_id"></a> [image\_id](#output\_image\_id) | ID созданного image |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/keypair/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_openstack"></a> [openstack](#requirement\_openstack) | 1.53.0 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [openstack_compute_keypair_v2.keypair_1](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/1.53.0/docs/resources/compute_keypair_v2) | resource |
| openstack_compute_keypair_v2.keypair_1 | resource |

## Inputs

Expand All @@ -35,3 +35,4 @@ No modules.
|------|-------------|
| <a name="output_keypair_id"></a> [keypair\_id](#output\_keypair\_id) | ID созданной KeyPair |
| <a name="output_keypair_name"></a> [keypair\_name](#output\_keypair\_name) | Имя созданной KeyPair |
<!-- END_TF_DOCS -->
31 changes: 16 additions & 15 deletions modules/mks/k8s-cluster-standalone/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_openstack"></a> [openstack](#requirement\_openstack) | 1.53.0 |
| <a name="requirement_selectel"></a> [selectel](#requirement\_selectel) | >=5.0.2 |

Expand All @@ -25,7 +25,7 @@

| Name | Type |
|------|------|
| [selectel_mks_kubeconfig_v1.kubeconfig](https://registry.terraform.io/providers/selectel/selectel/latest/docs/data-sources/mks_kubeconfig_v1) | data source |
| selectel_mks_kubeconfig_v1.kubeconfig | data source |

## Inputs

Expand All @@ -34,27 +34,27 @@
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | n/a | `string` | n/a | yes |
| <a name="input_enable_autorepair"></a> [enable\_autorepair](#input\_enable\_autorepair) | n/a | `bool` | `false` | no |
| <a name="input_enable_patch_version_auto_upgrade"></a> [enable\_patch\_version\_auto\_upgrade](#input\_enable\_patch\_version\_auto\_upgrade) | n/a | `bool` | `false` | no |
| <a name="input_gpu_ng_flavor"></a> [gpu\_ng\_flavor](#input\_gpu\_ng\_flavor) | n/a | `list(string)` | <pre>[<br> "2"<br>]</pre> | no |
| <a name="input_gpu_ng_labels"></a> [gpu\_ng\_labels](#input\_gpu\_ng\_labels) | n/a | `list(map(any))` | <pre>[<br> {<br> "role": "gpu"<br> }<br>]</pre> | no |
| <a name="input_gpu_ng_nodes_count"></a> [gpu\_ng\_nodes\_count](#input\_gpu\_ng\_nodes\_count) | n/a | `list(number)` | <pre>[<br> 2<br>]</pre> | no |
| <a name="input_gpu_ng_taints"></a> [gpu\_ng\_taints](#input\_gpu\_ng\_taints) | n/a | <pre>list(object({<br> key = string<br> value = string<br> effect = string<br> }))</pre> | `[]` | no |
| <a name="input_gpu_ng_volume_gb"></a> [gpu\_ng\_volume\_gb](#input\_gpu\_ng\_volume\_gb) | n/a | `list(number)` | <pre>[<br> 32<br>]</pre> | no |
| <a name="input_gpu_ng_volume_type"></a> [gpu\_ng\_volume\_type](#input\_gpu\_ng\_volume\_type) | n/a | `list(string)` | <pre>[<br> "fast"<br>]</pre> | no |
| <a name="input_gpu_ng_flavor"></a> [gpu\_ng\_flavor](#input\_gpu\_ng\_flavor) | n/a | `list(string)` | <pre>[<br/> "2"<br/>]</pre> | no |
| <a name="input_gpu_ng_labels"></a> [gpu\_ng\_labels](#input\_gpu\_ng\_labels) | n/a | `list(map(any))` | <pre>[<br/> {<br/> "role": "gpu"<br/> }<br/>]</pre> | no |
| <a name="input_gpu_ng_nodes_count"></a> [gpu\_ng\_nodes\_count](#input\_gpu\_ng\_nodes\_count) | n/a | `list(number)` | <pre>[<br/> 2<br/>]</pre> | no |
| <a name="input_gpu_ng_taints"></a> [gpu\_ng\_taints](#input\_gpu\_ng\_taints) | n/a | <pre>list(object({<br/> key = string<br/> value = string<br/> effect = string<br/> }))</pre> | `[]` | no |
| <a name="input_gpu_ng_volume_gb"></a> [gpu\_ng\_volume\_gb](#input\_gpu\_ng\_volume\_gb) | n/a | `list(number)` | <pre>[<br/> 32<br/>]</pre> | no |
| <a name="input_gpu_ng_volume_type"></a> [gpu\_ng\_volume\_type](#input\_gpu\_ng\_volume\_type) | n/a | `list(string)` | <pre>[<br/> "fast"<br/>]</pre> | no |
| <a name="input_gpu_nodegroups"></a> [gpu\_nodegroups](#input\_gpu\_nodegroups) | n/a | `number` | `0` | no |
| <a name="input_kube_version"></a> [kube\_version](#input\_kube\_version) | n/a | `string` | n/a | yes |
| <a name="input_maintenance_window_end"></a> [maintenance\_window\_end](#input\_maintenance\_window\_end) | n/a | `string` | `"04:00:00"` | no |
| <a name="input_maintenance_window_start"></a> [maintenance\_window\_start](#input\_maintenance\_window\_start) | n/a | `string` | `"03:00:00"` | no |
| <a name="input_nat_subnet_cidr"></a> [nat\_subnet\_cidr](#input\_nat\_subnet\_cidr) | n/a | `string` | `"10.222.0.0/16"` | no |
| <a name="input_network_id"></a> [network\_id](#input\_network\_id) | n/a | `string` | `""` | no |
| <a name="input_ng_affinity_policy"></a> [ng\_affinity\_policy](#input\_ng\_affinity\_policy) | n/a | `string` | `""` | no |
| <a name="input_ng_cpus"></a> [ng\_cpus](#input\_ng\_cpus) | n/a | `list(number)` | <pre>[<br> 2<br>]</pre> | no |
| <a name="input_ng_cpus"></a> [ng\_cpus](#input\_ng\_cpus) | n/a | `list(number)` | <pre>[<br/> 2<br/>]</pre> | no |
| <a name="input_ng_keypair_name"></a> [ng\_keypair\_name](#input\_ng\_keypair\_name) | n/a | `string` | `""` | no |
| <a name="input_ng_labels"></a> [ng\_labels](#input\_ng\_labels) | n/a | `list(map(any))` | <pre>[<br> {<br> "role": "system"<br> }<br>]</pre> | no |
| <a name="input_ng_nodes_count"></a> [ng\_nodes\_count](#input\_ng\_nodes\_count) | n/a | `list(number)` | <pre>[<br> 2<br>]</pre> | no |
| <a name="input_ng_ram_mb"></a> [ng\_ram\_mb](#input\_ng\_ram\_mb) | n/a | `list(number)` | <pre>[<br> 4096<br>]</pre> | no |
| <a name="input_ng_taints"></a> [ng\_taints](#input\_ng\_taints) | n/a | <pre>list(object({<br> key = string<br> value = string<br> effect = string<br> }))</pre> | `[]` | no |
| <a name="input_ng_volume_gb"></a> [ng\_volume\_gb](#input\_ng\_volume\_gb) | n/a | `list(number)` | <pre>[<br> 32<br>]</pre> | no |
| <a name="input_ng_volume_type"></a> [ng\_volume\_type](#input\_ng\_volume\_type) | n/a | `list(string)` | <pre>[<br> "fast"<br>]</pre> | no |
| <a name="input_ng_labels"></a> [ng\_labels](#input\_ng\_labels) | n/a | `list(map(any))` | <pre>[<br/> {<br/> "role": "system"<br/> }<br/>]</pre> | no |
| <a name="input_ng_nodes_count"></a> [ng\_nodes\_count](#input\_ng\_nodes\_count) | n/a | `list(number)` | <pre>[<br/> 2<br/>]</pre> | no |
| <a name="input_ng_ram_mb"></a> [ng\_ram\_mb](#input\_ng\_ram\_mb) | n/a | `list(number)` | <pre>[<br/> 4096<br/>]</pre> | no |
| <a name="input_ng_taints"></a> [ng\_taints](#input\_ng\_taints) | n/a | <pre>list(object({<br/> key = string<br/> value = string<br/> effect = string<br/> }))</pre> | `[]` | no |
| <a name="input_ng_volume_gb"></a> [ng\_volume\_gb](#input\_ng\_volume\_gb) | n/a | `list(number)` | <pre>[<br/> 32<br/>]</pre> | no |
| <a name="input_ng_volume_type"></a> [ng\_volume\_type](#input\_ng\_volume\_type) | n/a | `list(string)` | <pre>[<br/> "fast"<br/>]</pre> | no |
| <a name="input_no_gateway"></a> [no\_gateway](#input\_no\_gateway) | Sets whether a network should have a gateway | `string` | `false` | no |
| <a name="input_nodegroups"></a> [nodegroups](#input\_nodegroups) | n/a | `string` | `1` | no |
| <a name="input_os_auth_url"></a> [os\_auth\_url](#input\_os\_auth\_url) | n/a | `string` | `"https://api.selvpc.ru/identity/v3/auth/"` | no |
Expand All @@ -69,3 +69,4 @@
| <a name="output_kube_config"></a> [kube\_config](#output\_kube\_config) | n/a |
| <a name="output_nat_network_id"></a> [nat\_network\_id](#output\_nat\_network\_id) | n/a |
| <a name="output_nat_subnet_id"></a> [nat\_subnet\_id](#output\_nat\_subnet\_id) | n/a |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/mks/k8s-cluster/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_selectel"></a> [selectel](#requirement\_selectel) | >=5.0.2 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [selectel_mks_cluster_v1.cluster_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/mks_cluster_v1) | resource |
| selectel_mks_cluster_v1.cluster_1 | resource |

## Inputs

Expand All @@ -40,3 +40,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_cluster_id"></a> [cluster\_id](#output\_cluster\_id) | ID созданного кластера |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/mks/k8s-nodegroup-gpu/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_selectel"></a> [selectel](#requirement\_selectel) | >=5.0.2 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [selectel_mks_nodegroup_v1.nodegroup_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/mks_nodegroup_v1) | resource |
| selectel_mks_nodegroup_v1.nodegroup_1 | resource |

## Inputs

Expand All @@ -45,3 +45,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_nodegroup_id"></a> [nodegroup\_id](#output\_nodegroup\_id) | ID созданной группы нод |
<!-- END_TF_DOCS -->
5 changes: 3 additions & 2 deletions modules/mks/k8s-nodegroup/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |
| <a name="requirement_selectel"></a> [selectel](#requirement\_selectel) | >=5.0.2 |

## Providers
Expand All @@ -19,7 +19,7 @@ No modules.

| Name | Type |
|------|------|
| [selectel_mks_nodegroup_v1.nodegroup_1](https://registry.terraform.io/providers/selectel/selectel/latest/docs/resources/mks_nodegroup_v1) | resource |
| selectel_mks_nodegroup_v1.nodegroup_1 | resource |

## Inputs

Expand All @@ -45,3 +45,4 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_nodegroup_id"></a> [nodegroup\_id](#output\_nodegroup\_id) | n/a |
<!-- END_TF_DOCS -->
Loading

0 comments on commit 069520a

Please sign in to comment.