Skip to content

Commit 1f1cfcb

Browse files
authored
Feat/traefik3 (#48)
* fix router name * update traefik to v3 * update list for NKP 2.14 * update readme
1 parent 16d3c96 commit 1f1cfcb

File tree

7 files changed

+23
-17
lines changed

7 files changed

+23
-17
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
FROM traefik:v2.10
1+
FROM traefik:v3.3.4
22

33
ENV TRAEFIK_PROVIDERS_FILE_DIRECTORY="/etc/traefik/traefik.d/"
44
ENV TRAEFIK_ENTRYPOINTS_proxy_ADDRESS=":9440"
55
ENV TRAEFIK_LOG_LEVEL="INFO"
66
ENV TRAEFIK_ACCESSLOG=true
7+
ENV TRAEFIK_ACCESSLOG_ADDINTERNALS=true
78
ENV TRAEFIK_API=true
89

910
COPY traefik.d/* /etc/traefik/traefik.d/

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
build:
2-
docker build -t nxlab.fr/tuxtof/ntnx-api-proxy --platform linux/amd64 .
3-
docker push nxlab.fr/tuxtof/ntnx-api-proxy
2+
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

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,11 @@ This tool allows the concentration of Prism Central API calls to a single point
1818

1919
This tool has been tested with the following components:
2020

21-
PC v1 & v2 API
22-
- CSI 3.0
23-
24-
PC v3 API:
25-
- CAPX v1.2.3
26-
- CCM v0.3.2
21+
- CSI v3.0.0, v3.2.0
22+
- CAPX v1.2.3, v1.5.3
23+
- CCM v0.3.2, v0.5.0
2724
- Openshift IPI 4.13
28-
- CSI 3.0
29-
30-
PC v4 API:
31-
- CSI 3.0ea
25+
- NKP 2.14
3226

3327
Tools and APIs call may evolve over time, which may require updating the proxy configuration before upgrading any dependent solutions.
3428

traefik.d/pc-v1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}}
1717

1818
{{define "route"}}
19-
{{ randAlphaNum 10 }}:
19+
{{ .Method | lower }}-{{ .Prefix | replace "/PrismGateway/services/rest/" "" | replace "/" "-" }}:
2020
entryPoints:
2121
- "proxy"
2222
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"

traefik.d/pc-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}}
1717

1818
{{define "route"}}
19-
{{ randAlphaNum 10 }}:
19+
{{ .Method | lower }}-{{ .Prefix | replace "/api/nutanix/" "" | replace "/" "-" }}:
2020
entryPoints:
2121
- "proxy"
2222
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"

traefik.d/pc-v3.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"/api/nutanix/v3/subnets"
1010
"/api/nutanix/v3/images"
1111
"/api/nutanix/v3/tasks"
12+
"/api/nutanix/v3/categories/KubernetesClusterName"
1213
}}
1314

1415
# POST url
@@ -22,6 +23,7 @@
2223
"/api/nutanix/v3/vms"
2324
"/api/nutanix/v3/images"
2425
"/api/nutanix/v3/categories/kubernetes-io-cluster"
26+
"/api/nutanix/v3/categories/KubernetesClusterName"
2527
"/api/nutanix/v3/groups"
2628
}}
2729

@@ -41,7 +43,7 @@
4143
}}
4244

4345
{{define "route"}}
44-
{{ randAlphaNum 10 }}:
46+
{{ .Method | lower }}-{{ .Prefix | replace "/api/nutanix/" "" | replace "/" "-" }}:
4547
entryPoints:
4648
- "proxy"
4749
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"

traefik.d/pc-v4.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# GET url
22
{{ $GETendpoints := list
33
"/api/prism/v4.0.a1/config/tasks"
4+
"/api/prism/v4.0.b1/config/tasks"
45
"/api/storage/v4.0.a3/config/volume-groups/"
6+
"/api/volumes/v4.0.b1/config/volume-groups"
57
"/api/prism/v4.0.a1/config/categories"
8+
"/api/prism/v4.0.b1/config/categories"
69
"/api/dataprotection/v4.0.a3/config/recovery-points"
710
"/api/clustermgmt/v4.0.a2/config/clusters"
11+
"/api/clustermgmt/v4.0.b2/config/clusters"
812
"/api/networking/v4.0.a1/config/subnets"
913
"/api/vmm/v4.0.a1/images"
1014
"/api/vmm/v4.0.a1/ahv/config/vms"
15+
"/api/vmm/v4.0.b1/ahv/config/vms"
16+
"/api/clustermgmt/v4.0.b2/config/storage-containers"
1117
}}
1218

1319
# POST url
1420
{{ $POSTendpoints := list
1521
"/api/storage/v4.0.a3/config/volume-groups"
22+
"/api/volumes/v4.0.b1/config/volume-groups"
1623
"/api/prism/v4.0.a1/config/categories"
24+
"/api/prism/v4.0.b1/config/categories"
1725
"/api/dataprotection/v4.0.a3/config/recovery-points"
1826
"/api/vmm/v4.0.a1/ahv/config/vms"
1927
"/api/vmm/v4.0.a1/images"
@@ -27,6 +35,7 @@
2735
# PATCH url
2836
{{ $PATCHendpoints := list
2937
"/api/storage/v4.0.a3/config/volume-groups"
38+
"/api/volumes/v4.0.b1/config/volume-groups"
3039
}}
3140

3241
# DELETE url
@@ -37,7 +46,7 @@
3746
}}
3847

3948
{{define "route"}}
40-
{{ randAlphaNum 10 }}:
49+
{{ .Method | lower }}-{{ .Prefix | replace "/api/" "" | replace "/" "-" }}::
4150
entryPoints:
4251
- "proxy"
4352
rule: "Host(`{{ default "FQDN_not_configured" (env "FQDN") }}`) && PathPrefix(`{{.Prefix}}`) && Method(`{{.Method}}`)"

0 commit comments

Comments
 (0)