Skip to content

Commit 4f9faec

Browse files
feat(nautobot-target-proxy): package, build, and test updates
1 parent 3972b7f commit 4f9faec

15 files changed

Lines changed: 977 additions & 1850 deletions

File tree

.yamllint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ignore:
44
- components/etcdbackup/templates/
55
- charts/argocd-understack/templates/
66
- charts/nautobot-api-tokens/templates/
7+
- charts/nautobot-target-proxy/templates/
78
- charts/site-workflows/templates/
89
- charts/undersync/templates/
910

charts/argocd-understack/templates/application-nautobot-target-proxy.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@ spec:
1515
server: {{ $.Values.cluster_server }}
1616
project: understack
1717
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
18+
- helm:
19+
releaseName: nautobot-target-proxy
20+
ignoreMissingValueFiles: true
21+
valueFiles:
22+
- $understack/components/nautobot-target-proxy/values.yaml
23+
- $deploy/{{ include "understack.deploy_path" $ }}/nautobot-target-proxy/values.yaml
24+
path: charts/nautobot-target-proxy
25+
ref: understack
26+
repoURL: {{ include "understack.understack_url" $ }}
27+
targetRevision: {{ include "understack.understack_ref" $ }}
28+
- path: {{ include "understack.deploy_path" $ }}/nautobot-target-proxy
29+
ref: deploy
30+
repoURL: {{ include "understack.deploy_url" $ }}
31+
targetRevision: {{ include "understack.deploy_ref" $ }}
3232
syncPolicy:
3333
automated:
3434
prune: true

charts/argocd-understack/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ site:
501501

502502
# -- Nautobot target proxy service
503503
nautobot_target_proxy:
504-
# -- Enable/disable deploying nautobot-target-proxy
504+
# -- Enable/disable deploying the nautobot-target-proxy Helm chart
505505
# @default -- false
506506
enabled: false
507507

charts/nautobot-target-proxy/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ args:
4646

4747
nautobot:
4848
# -- Base URL for the Nautobot instance queried by the proxy.
49-
url: ""
49+
url: "http://nautobot-default.nautobot.svc.cluster.local"
5050

5151
clusterDataConfigMapRef:
5252
# -- ConfigMap name containing the UNDERSTACK_PARTITION key.
@@ -56,9 +56,9 @@ nautobot:
5656

5757
tokenSecretRef:
5858
# -- Secret name containing the Nautobot API token.
59-
name: ""
59+
name: nautobot-token
6060
# -- Secret key containing the Nautobot API token.
61-
key: NAUTOBOT_TOKEN
61+
key: apitoken
6262

6363
resources: {}
6464

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources: []

components/nautobot-target-proxy/values.yaml

Whitespace-only changes.
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
FROM python:3.12.13-alpine AS builder
1+
FROM python:3.12.13-slim AS builder
2+
ENV UV_PYTHON_DOWNLOADS=never
3+
ENV UV_COMPILE_BYTECODE=1
4+
ENV PATH="/app/.venv/bin:$PATH"
25

3-
RUN pip install --upgrade poetry poetry-plugin-export
4-
5-
COPY python/nautobot_target_proxy/pyproject.toml \
6-
python/nautobot_target_proxy/poetry.lock \
7-
/tmp/nautobot_target_proxy/
8-
9-
RUN cd /tmp/nautobot_target_proxy && \
10-
poetry export --only main -o /tmp/requirements.txt --without-hashes
11-
12-
FROM python:3.12.13-alpine AS prod
13-
14-
RUN pip3 install -U pip setuptools wheel
6+
WORKDIR /app
7+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
158

16-
COPY --from=builder /tmp/requirements.txt /tmp/requirements.txt
17-
RUN pip3 install -r /tmp/requirements.txt
9+
COPY python/nautobot_target_proxy/pyproject.toml /app/pyproject.toml
10+
COPY python/nautobot_target_proxy/uv.lock /app/uv.lock
11+
RUN --mount=type=cache,target=/root/.cache/uv \
12+
uv sync --locked --no-dev --no-install-project
1813

1914
COPY python/nautobot_target_proxy /app
20-
RUN pip3 install --no-deps /app
15+
RUN --mount=type=cache,target=/root/.cache/uv \
16+
uv sync --locked --no-dev
17+
18+
FROM python:3.12.13-slim AS prod
19+
ENV PATH="/app/.venv/bin:$PATH"
2120

2221
WORKDIR /app
22+
COPY --from=builder /app /app
23+
2324
EXPOSE 8000

docs/deploy-guide/components/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ enablement defaults, validation, and troubleshooting notes.
9191
| [nautobot](./nautobot.md) | global |
9292
| [nautobot-api-tokens](./nautobot-api-tokens.md) | global |
9393
| [nautobot-site](./nautobot-site.md) | site |
94+
| [nautobot-target-proxy](./nautobot-target-proxy.md) | site |
9495
| [nautobotop](./nautobotop.md) | global |
9596
| [openebs](./openebs.md) | global, site |
9697
| [openstack](./openstack.md) | site |
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
charts:
3+
- nautobot-target-proxy
4+
deploy_overrides:
5+
helm:
6+
mode: values
7+
kustomize:
8+
mode: second_source
9+
---
10+
11+
# nautobot-target-proxy
12+
13+
FastAPI proxy service that fronts Nautobot target lookups for site deployments.
14+
15+
## Deployment Scope
16+
17+
- Cluster scope: site
18+
- Values key: `site.nautobot_target_proxy`
19+
- ArgoCD Application template: `charts/argocd-understack/templates/application-nautobot-target-proxy.yaml`
20+
21+
## How ArgoCD Builds It
22+
23+
{{ component_argocd_builds() }}
24+
25+
## How to Enable
26+
27+
Enable this component under the scope that matches your deployment model:
28+
29+
```yaml title="$CLUSTER_NAME/deploy.yaml"
30+
site:
31+
nautobot_target_proxy:
32+
enabled: true
33+
```
34+
35+
## Deployment Repo Content
36+
37+
{{ secrets_disclaimer }}
38+
39+
Required or commonly required items:
40+
41+
- `values.yaml`: Provide deployment-specific overrides such as the Nautobot base URL, image settings, and any scheduling or resource changes for this environment.
42+
- `nautobot-token` Secret: Provide the key referenced by `nautobot.tokenSecretRef` so the proxy can authenticate to the Nautobot API.
43+
- `cluster-data` ConfigMap: Provide the key referenced by `nautobot.clusterDataConfigMapRef` so the proxy receives `UNDERSTACK_PARTITION`.
44+
45+
Optional additions:
46+
47+
- `dockerconfigjson-github-com` Secret: Provide `.dockerconfigjson` if this deployment pulls the proxy image from a private registry and reference it through `imagePullSecrets`.
48+
- `Deployment override manifest`: Add patches or extra manifests in the component overlay directory if this site needs pod-level changes that are clearer to manage as Kubernetes resources instead of Helm values alone.
49+
50+
## Notes
51+
52+
- The chart deploys the proxy in the `nautobot` namespace and exposes it with a ClusterIP Service on port `8000` by default.
53+
- The ArgoCD template consumes both `$CLUSTER_NAME/nautobot-target-proxy/values.yaml` and the matching component directory as its second source, so you can keep simple configuration in values and reserve the overlay for Kubernetes-native additions.

docs/deploy-guide/deploy-repo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ understackctl deploy update my-site
5858
This creates `<component>/` directories with `kustomization.yaml` and
5959
`values.yaml` files for each enabled component.
6060

61-
### component directories
61+
### Component directories
6262

6363
Inside of the `manifests` directory you'll have child directories named after
6464
each component (using hyphens, e.g., `cert-manager`, `argo-workflows`). These
@@ -130,7 +130,7 @@ disabled components.
130130
(e.g., `cert-manager`, `argo-workflows`). The `understackctl` tool
131131
handles this conversion automatically.
132132

133-
### inventory directory
133+
### Inventory directory
134134

135135
This directory contains an Ansible inventory file along with Ansible
136136
group_vars that are used as data by Ansible executions within the cluster

0 commit comments

Comments
 (0)