Skip to content

Commit

Permalink
feat: ✨ add missing microks provider for Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
darkweaver87 committed Jan 29, 2025
1 parent c3f28c7 commit 165ecb4
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 0 deletions.
12 changes: 12 additions & 0 deletions traefik/VALUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ Kubernetes: `>=1.22.0-0`
| hub.apimanagement.enabled | bool | `false` | Set to true in order to enable API Management. Requires a valid license token. |
| hub.apimanagement.openApi.validateRequestMethodAndPath | bool | `false` | When set to true, it will only accept paths and methods that are explicitly defined in its OpenAPI specification |
| hub.experimental.aigateway | bool | `false` | Set to true in order to enable AI Gateway. Requires a valid license token. |
| hub.providers.microcks.auth.clientId | string | `""` | Microcks API client ID. |
| hub.providers.microcks.auth.clientSecret | string | `""` | Microcks API client secret. |
| hub.providers.microcks.auth.endpoint | string | `""` | Microcks API endpoint. |
| hub.providers.microcks.auth.token | string | `""` | Microcks API token. |
| hub.providers.microcks.enabled | bool | `false` | Enable Microcks provider. |
| hub.providers.microcks.endpoint | string | `""` | Microcks API endpoint. |
| hub.providers.microcks.pollInterval | int | `30` | Polling interval for Microcks API. |
| hub.providers.microcks.pollTimeout | int | `5` | Polling timeout for Microcks API. |
| hub.providers.microcks.tls.ca | string | `""` | TLS CA |
| hub.providers.microcks.tls.cert | string | `""` | TLS cert |
| hub.providers.microcks.tls.insecureSkipVerify | bool | `false` | TLS insecure skip verify |
| hub.providers.microcks.tls.key | string | `""` | TLS key |
| hub.redis.cluster | string | `nil` | Enable Redis Cluster. Default: true. |
| hub.redis.database | string | `nil` | Database used to store information. Default: "0". |
| hub.redis.endpoints | string | `""` | Endpoints of the Redis instances to connect to. Default: "". |
Expand Down
3 changes: 3 additions & 0 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@
{{- if and $.Values.tracing.otlp.enabled .tracing.additionalTraceHeaders.enabled }}
{{- include "traefik.yaml2CommandLineArgs" (dict "path" "hub.tracing.additionalTraceHeaders.traceContext" "content" $.Values.hub.tracing.additionalTraceHeaders.traceContext) | nindent 10 }}
{{- end }}
{{- if .providers.microcks.enabled }}
{{- include "traefik.yaml2CommandLineArgs" (dict "path" "hub.providers.microcks" "content" (omit $.Values.hub.providers.microcks "enabled")) | nindent 10 }}
{{- end }}
{{- end }}
{{- end }}
env:
Expand Down
4 changes: 4 additions & 0 deletions traefik/templates/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@
{{- if and (not $.Values.tracing.otlp.enabled) .Values.hub.tracing.additionalTraceHeaders.enabled }}
{{ fail "ERROR: additionalTraceHeaders needs tracing.otlp to be enabled."}}
{{- end }}

{{- if and (semverCompare "<v3.7.0" $hubVersion) .Values.hub.providers.microcks.enabled }}
{{ fail "ERROR: microcks provider is a feature only available for traefik-hub >= v3.7.0."}}
{{- end }}
{{- end }}
12 changes: 12 additions & 0 deletions traefik/tests/requirements-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,15 @@ tests:
asserts:
- failedTemplate:
errorMessage: "ERROR: additionalTraceHeaders needs tracing.otlp to be enabled."
- it: should fail when using consulCatalogEnterprise provider on hub < 3.6.0
set:
image:
tag: v3.6.0
hub:
token: "xxx"
providers:
microcks:
enabled: true
asserts:
- failedTemplate:
errorMessage: "ERROR: microcks provider is a feature only available for traefik-hub >= v3.7.0."
17 changes: 17 additions & 0 deletions traefik/tests/traefik-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -812,3 +812,20 @@ tests:
- contains:
path: spec.template.spec.containers[0].args
content: "--hub.tracing.additionalTraceHeaders.traceContext.traceState=traceState"
- it: should be possible to configure Traefik Hub microcks provider
set:
image:
tag: v3.7.0
tracing:
otlp:
enabled: true
hub:
token: "xxx"
providers:
microcks:
enabled: true
endpoint: "http://microcks.svc"
asserts:
- contains:
path: spec.template.spec.containers[0].args
content: "--hub.providers.microcks.endpoint=http://microcks.svc"
56 changes: 56 additions & 0 deletions traefik/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,62 @@
},
"type": "object"
},
"providers": {
"properties": {
"microcks": {
"properties": {
"auth": {
"properties": {
"clientId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
"endpoint": {
"type": "string"
},
"token": {
"type": "string"
}
},
"type": "object"
},
"enabled": {
"type": "boolean"
},
"endpoint": {
"type": "string"
},
"pollInterval": {
"type": "integer"
},
"pollTimeout": {
"type": "integer"
},
"tls": {
"properties": {
"ca": {
"type": "string"
},
"cert": {
"type": "string"
},
"insecureSkipVerify": {
"type": "boolean"
},
"key": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
}
},
"type": "object"
},
"redis": {
"properties": {
"cluster": {
Expand Down
28 changes: 28 additions & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,34 @@ hub:
experimental:
# -- Set to true in order to enable AI Gateway. Requires a valid license token.
aigateway: false
providers:
microcks:
# -- Enable Microcks provider.
enabled: false
auth:
# -- Microcks API client ID.
clientId: ""
# -- Microcks API client secret.
clientSecret: ""
# -- Microcks API endpoint.
endpoint: ""
# -- Microcks API token.
token: ""
# -- Microcks API endpoint.
endpoint: ""
# -- Polling interval for Microcks API.
pollInterval: 30
# -- Polling timeout for Microcks API.
pollTimeout: 5
tls:
# -- TLS CA
ca: ""
# -- TLS cert
cert: ""
# -- TLS insecure skip verify
insecureSkipVerify: false
# -- TLS key
key: ""
redis:
# -- Enable Redis Cluster. Default: true.
cluster: # @schema type:[boolean, null]
Expand Down

0 comments on commit 165ecb4

Please sign in to comment.