Skip to content

Commit 3e4fc20

Browse files
authored
clean v4api-ga (#50)
1 parent 1d083c6 commit 3e4fc20

File tree

8 files changed

+50
-19
lines changed

8 files changed

+50
-19
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ terraform.tfvars
66
tofu/cert/tls.*
77
tofu/cert/ca.*
88
tofu/cert/additional_ca.crt
9-
files/docker.config
9+
files/docker.config
10+
tofu/tofu.tfvars

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
build:
22
docker build -t ghcr.io/nutanix-cloud-native/ntnx-api-proxy:dev --platform linux/amd64 .
3-
docker push ghcr.io/nutanix-cloud-native/ntnx-api-proxy:dev
3+
docker push ghcr.io/nutanix-cloud-native/ntnx-api-proxy:dev

tofu/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
- Collect static IP for the API-Proxy
66
- Create a DNS-record pointing to that IP
77
- put necessary SSL-Certs as `tls.crt`, `tls.key` and `ca.crt` in `cert` Subfolder
8-
- Download, extract and upload flatcar-image into Nutanix Image Service
9-
(https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img.gz)
8+
- Upload flatcar-image into Nutanix Image Service
9+
(https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img)
1010

1111
## Deployment
1212

tofu/compute.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ data "nutanix_cluster" "cluster" {
88
name = var.nutanix_cluster
99
}
1010

11-
data "nutanix_image" "flatcar" {
12-
13-
image_name = var.flatcar_image
11+
resource "nutanix_image" "flatcar" {
1412

13+
source_uri = var.flatcar_image
14+
name = "flatcar_production_openstack_image"
1515
}
16-
1716
resource "nutanix_virtual_machine" "ntnx-api-proxy" {
1817

1918
name = var.vm_name
@@ -35,7 +34,7 @@ resource "nutanix_virtual_machine" "ntnx-api-proxy" {
3534
disk_size_mib = 10000
3635
data_source_reference = {
3736
kind = "image"
38-
uuid = data.nutanix_image.flatcar.id
37+
uuid = nutanix_image.flatcar.id
3938
}
4039

4140
device_properties {
@@ -63,6 +62,7 @@ data "ct_config" "ignition" {
6362
key = indent(10,file("${path.module}/cert/tls.key"))
6463
traefik_log_level = var.traefik_log_level
6564
traefik_serverstransport_rootcas = var.traefik_serverstransport_rootcas
65+
traefik_serverstransport_insecureskipverify = var.traefik_serverstransport_insecureskipverify
6666
auth_proxy = var.auth_proxy
6767
nutanix_username = var.nutanix_username
6868
nutanix_password = var.nutanix_password

tofu/ignition.tftpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ storage:
1515
NUTANIX_ENDPOINT=${nutanix_endpoint}
1616
TRAEFIK_LOG_LEVEL=${traefik_log_level}
1717
TRAEFIK_SERVERSTRANSPORT_ROOTCAS=${traefik_serverstransport_rootcas}
18+
TRAEFIK_SERVERSTRANSPORT_INSECURESKIPVERIFY=${traefik_serverstransport_insecureskipverify}
1819
AUTH_PROXY=${auth_proxy}
1920
NUTANIX_USERNAME=${nutanix_username}
2021
NUTANIX_PASSWORD=${nutanix_password}
2122
DASHBOARD=${dashboard}
2223
TRAEFIK_METRICS_PROMETHEUS=${metrics}
24+
TRAEFIK_METRICS_PROMETHEUS_ADDROUTERSLABELS=${metrics}
2325
- path: /etc/ssl/certs/additional_ca.pem
2426
mode: 0644
2527
contents:

tofu/tofu.tfvars_example

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ nutanix_endpoint = "existing PC FQDN"
44
nutanix_insecure = false
55
nutanix_subnet = "subnet"
66
nutanix_cluster = "pe-cluster"
7-
flatcar_image = "flatcar_production_openstack.img"
7+
flatcar_image = "https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_openstack_image.img"
88
ssh_key = "PATH TO SSH PUB KEY"
99
vm_name = "ntnx-api-proxy"
1010
vm_ip = "IP address"
@@ -13,8 +13,9 @@ container_image = "nutanix-cloud-native/ntnx-api-proxy"
1313
registry_user = ""
1414
registry_pass = ""
1515

16-
fqdn = "PROXY FQDN"
17-
traefik_serverstransport_rootcas = "/etc/traefik/cert/ca.crt"
18-
traefik_log_level = "info" # #possible values info / error
19-
dashboard = "enable" #possible values enable / disable
20-
metrics = "true" #enable Prometheus Metrics
16+
fqdn = "PROXY FQDN"
17+
traefik_serverstransport_insecureskipverify = "false"
18+
traefik_serverstransport_rootcas = "/etc/traefik/cert/ca.crt"
19+
traefik_log_level = "info" # #possible values info / error
20+
dashboard = "enable" #possible values enable / disable
21+
metrics = "true" #enable Prometheus Metrics

tofu/variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ variable "traefik_serverstransport_rootcas" {
5252
default = ""
5353
}
5454

55+
variable "traefik_serverstransport_insecureskipverify" {
56+
type = string
57+
default = ""
58+
}
5559
variable "traefik_log_level" {
5660
type = string
5761
}

traefik.d/pc-v4.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@
1414
"/api/vmm/v4.0.a1/ahv/config/vms"
1515
"/api/vmm/v4.0.b1/ahv/config/vms"
1616
"/api/clustermgmt/v4.0.b2/config/storage-containers"
17+
"/api/prism/v4.0/config/tasks"
18+
"/api/volumes/v4.0/config/volume-groups/"
19+
"/api/prism/v4.0/config/categories"
20+
"/api/dataprotection/v4.0/config/recovery-points"
21+
"/api/clustermgmt/v4.0/config/clusters"
22+
"/api/clustermgmt/v4.0/config/storage-containers"
23+
"/api/networking/v4.0/config/subnets"
24+
"/api/vmm/v4.0/content/images"
25+
"/api/vmm/v4.0/ahv/config/vms"
26+
"/api/clustermgmt/v4.0.b2/config/clusters"
27+
"/api/dataprotection/v4.0.b1/config/recovery-points"
28+
"/api/files/v4.0/config/file-servers"
1729
}}
1830

1931
# POST url
@@ -25,24 +37,35 @@
2537
"/api/dataprotection/v4.0.a3/config/recovery-points"
2638
"/api/vmm/v4.0.a1/ahv/config/vms"
2739
"/api/vmm/v4.0.a1/images"
40+
"/api/volumes/v4.0/config/volume-groups"
41+
"/api/prism/v4.0/config/categories"
42+
"/api/dataprotection/v4.0/config/recovery-points"
43+
"/api/vmm/v4.0/ahv/config/vms"
44+
"/api/vmm/v4.0/content/images"
45+
"/api/dataprotection/v4.0.b1/config/recovery-points"
46+
"/api/files/v4.0/config/file-servers"
2847
}}
2948

3049
# PUT url
3150
{{ $PUTendpoints := list
32-
"/api/vmm/v4.0.a1/ahv/config/vms"
51+
"/api/vmm/v4.0/ahv/config/vms"
52+
"/api/files/v4.0/config/file-servers"
3353
}}
3454

3555
# PATCH url
3656
{{ $PATCHendpoints := list
3757
"/api/storage/v4.0.a3/config/volume-groups"
3858
"/api/volumes/v4.0.b1/config/volume-groups"
59+
"/api/volumes/v4.0/config/volume-groups"
3960
}}
4061

4162
# DELETE url
4263
{{ $DELETEendpoints := list
43-
"/api/storage/v4.0.a3/config/volume-groups"
44-
"/api/vmm/v4.0.a1/ahv/config/vms"
45-
"/api/vmm/v4.0.a1/images"
64+
"/api/volumes/v4.0/config/volume-groups"
65+
"/api/vmm/v4.0/ahv/config/vms"
66+
"/api/vmm/v4.0/content/images"
67+
"/api/volumes/v4.0.b1/config/volume-groups"
68+
"/api/files/v4.0.b1/config/file-servers"
4669
}}
4770

4871
{{define "route"}}

0 commit comments

Comments
 (0)