Skip to content

Commit 3972b7f

Browse files
feat(nautobot-target-proxy): Include nautobot-target-proxy chart in understack
1 parent 855b2a2 commit 3972b7f

13 files changed

Lines changed: 68 additions & 10 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{{- if eq (include "understack.isEnabled" (list $.Values.site "nautobot_target_proxy")) "true" }}
2+
---
3+
apiVersion: argoproj.io/v1alpha1
4+
kind: Application
5+
metadata:
6+
name: {{ printf "%s-%s" $.Release.Name "nautobot-target-proxy" }}
7+
finalizers:
8+
- resources-finalizer.argocd.argoproj.io
9+
annotations:
10+
argocd.argoproj.io/compare-options: ServerSideDiff=true,IncludeMutationWebhook=true
11+
{{- include "understack.appLabelsBlock" $ | nindent 2 }}
12+
spec:
13+
destination:
14+
namespace: nautobot
15+
server: {{ $.Values.cluster_server }}
16+
project: understack
17+
sources:
18+
- ref: understack
19+
path: charts/nautobot-target-proxy
20+
repoURL: {{ include "understack.understack_url" $ }}
21+
targetRevision: {{ include "understack.understack_ref" $ }}
22+
helm:
23+
releaseName: nautobot-target-proxy
24+
valueFiles:
25+
- $understack/charts/nautobot-target-proxy/values.yaml
26+
- $deploy/{{ include "understack.deploy_path" $ }}/nautobot-target-proxy/values.yaml
27+
ignoreMissingValueFiles: true
28+
- ref: deploy
29+
repoURL: {{ include "understack.deploy_url" $ }}
30+
targetRevision: {{ include "understack.deploy_ref" $ }}
31+
path: {{ include "understack.deploy_path" $ }}/nautobot-target-proxy
32+
syncPolicy:
33+
automated:
34+
prune: true
35+
selfHeal: true
36+
managedNamespaceMetadata:
37+
annotations:
38+
argocd.argoproj.io/sync-options: Delete=false
39+
syncOptions:
40+
- CreateNamespace=true
41+
- ServerSideApply=true
42+
- RespectIgnoreDifferences=true
43+
- ApplyOutOfSyncOnly=true
44+
{{- end }}

charts/argocd-understack/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,12 @@ site:
499499
# @default -- false
500500
enabled: false
501501

502+
# -- Nautobot target proxy service
503+
nautobot_target_proxy:
504+
# -- Enable/disable deploying nautobot-target-proxy
505+
# @default -- false
506+
enabled: false
507+
502508
# -- OpenEBS
503509
openebs:
504510
# -- Enable/disable deploying OpenEBS

charts/nautobot-target-proxy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Helm chart that deploys the `nautobot_target_proxy` FastAPI service.
66

77
- Runs the proxy as a Kubernetes `Deployment`.
88
- Exposes the app internally with a Kubernetes `Service`.
9-
- Starts the container with `uvicorn app:app --host 0.0.0.0 --port 8000`.
9+
- Starts the container with `uvicorn nautobot_target_proxy.app:app --host 0.0.0.0 --port 8000`.
1010
- Injects `NAUTOBOT_URL` directly from values.
1111
- Injects `UNDERSTACK_PARTITION` from the shared `cluster-data` ConfigMap.
1212
- Injects `NAUTOBOT_TOKEN` from a referenced Kubernetes Secret.

charts/nautobot-target-proxy/values.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"type": "string"
129129
},
130130
"default": [
131-
"app:app",
131+
"nautobot_target_proxy.app:app",
132132
"--host",
133133
"0.0.0.0",
134134
"--port",

charts/nautobot-target-proxy/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ command:
3838
- uvicorn
3939

4040
args:
41-
- app:app
41+
- nautobot_target_proxy.app:app
4242
- --host
4343
- 0.0.0.0
4444
- --port

containers/nautobot-target-proxy/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ RUN pip3 install -U pip setuptools wheel
1616
COPY --from=builder /tmp/requirements.txt /tmp/requirements.txt
1717
RUN pip3 install -r /tmp/requirements.txt
1818

19-
COPY python/nautobot_target_proxy/src /src
19+
COPY python/nautobot_target_proxy /app
20+
RUN pip3 install --no-deps /app
2021

21-
WORKDIR /src
22+
WORKDIR /app
2223
EXPOSE 8000
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Installable package for the Nautobot target proxy service.
3+
"""

python/nautobot_target_proxy/src/app.py renamed to python/nautobot_target_proxy/nautobot_target_proxy/app.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
An API to obtain data from Nautobot, and format it for use in various external
3-
systems
3+
systems.
44
"""
55

66
# Standard Library
@@ -12,9 +12,9 @@
1212
from fastapi.responses import JSONResponse
1313

1414
# First Party
15-
from helpers.graphql import query_nautobot_graphql
16-
from helpers.queries import OOB_TARGET_QUERY
17-
from helpers.schemas import TargetResponse
15+
from nautobot_target_proxy.helpers.graphql import query_nautobot_graphql
16+
from nautobot_target_proxy.helpers.queries import OOB_TARGET_QUERY
17+
from nautobot_target_proxy.helpers.schemas import TargetResponse
1818

1919
app = FastAPI()
2020

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Helper utilities for the Nautobot target proxy service.
3+
"""

python/nautobot_target_proxy/src/helpers/graphql.py renamed to python/nautobot_target_proxy/nautobot_target_proxy/helpers/graphql.py

File renamed without changes.

0 commit comments

Comments
 (0)