Skip to content

Docs/targetsource userguide push#91

Open
Janooski wants to merge 18 commits into
docs/targetsource-userguidefrom
docs/targetsource-userguide-push
Open

Docs/targetsource userguide push#91
Janooski wants to merge 18 commits into
docs/targetsource-userguidefrom
docs/targetsource-userguide-push

Conversation

@Janooski

@Janooski Janooski commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Add documentation for push-interface

@Janooski Janooski self-assigned this Jun 8, 2026
@Janooski Janooski marked this pull request as draft June 8, 2026 09:33
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deploying gnmic-operator with  Cloudflare Pages  Cloudflare Pages

Latest commit: a9ad35f
Status: ✅  Deploy successful!
Preview URL: https://cdd21b28.gnmic-operator2.pages.dev
Branch Preview URL: https://docs-targetsource-userguide-9cut.gnmic-operator2.pages.dev

View logs

@Janooski Janooski requested a review from denyost June 8, 2026 22:25
@Janooski Janooski marked this pull request as ready for review June 8, 2026 22:25
@Janooski

Janooski commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator Author

Hey @denyost,

I have added the push-interface documentation. It is split up the following way:

  • Push mode: Kuberntes config push interface
  • REST API interface: openAPI contract generated markdown
  • Push mode with webhook: tutorial

Please rename and adjust thing if you think it is needed. I've review your chapters too, I think they are good and I've changed some smaller things here and there.

I am unsure if it is worth to have TargetSourceProvider as a separate site with only http as an option. Feels like we can get rid of that site, until more TargetSource are implemented 🤔 .

Cheers, Roman


> Namespace is `default`, the name of the TargetSource is `netbox`. These values will be in the URL in step 3.

### 2. Create Kubernetes Secrets

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Janooski I would create the Kubernetes Secrets and the TargetProfile first and then apply the TargetSource

- Use `name` and `key` values that match the TargetSource spec.

```bash
kubectl create secret generic gnmic-api-auth --from-literal=bearer-token=thisIsASecureToken -n default

@denyost denyost Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Janooski probably replace thisIsASecureToken with <thisIsASecureToken> to make it more clear that this has to be changed (same for SecretSignature)

In NetBox, go to `Operations > Webhooks` and create a webhook with the following settings:

- *Name*: GNMIc operator push
- *URL*: `http://gnmic-controller-manager-api.gnmic-system.svc.cluster.local:8082/api/v1/default/target-source/netbox/applyTargets`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Janooski maybe also mention how the URL gets constructed and mention possibility of exposing the service via proxy, I think at least you have to mention that this URL you show only works if netbox is inside the cluster else the name won't be resolvable

- *HTTP method*: POST
- *HTTP content type*: application/json
- *SSL Verification*: true
- *Additional headers:* `Authorization: Bearer thisIsASecureToken`

@denyost denyost Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Janooski
thisIsASecureToken -> <thisIsASecureToken>

"operation": "{{ event }}",
"targetProfile": "{{ data.custom_fields.target_profile | default('', true) }}",
"port": {{ data.custom_fields.gnmic_port | default(57400, true) }},
"labels": [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Janooski adjust to the new way of key-value definition

Enables REST API interface that accepts real-time target updates.
---

## Basic configuration

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name: targetsource-1
spec:
provider:
http:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention in a comment that the provider may be different

- Must be in the same namespace the gNMIc controller runs in.
- `name`: refers to the secret name
- `key`: key of the secret
- Example: `kubectl create secret generic gnmic-api-auth --from-literal=bearer-token=Secret...`

@denyost denyost Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret... -> <Secret>

HTTP request must contain the Bearer token in the header in the format:

```yaml
Authorization: Bearer Secret...

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Secret... -> <Secret>

| `signature` | object | No | - | HTTP body verification using HMAC |
| `algorithm` | string | No | sha512 | Algorithm for signature verification(`sha256`or`sha512`) |

## Address

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mention how you can find out this address (kubectl command to get the service)

| **address** | **String** | IPv4/IPv6 address or hostname. | [default to null] |
| **port** | **Integer** | gNMIc port. | [optional] [default to null] |
| **targetProfile** | **String** | TargetProfile applied to apply to this router. | [optional] [default to null] |
| **labels** | [**List**](map.md) | Input of labels as key:value pair. | [optional] [default to null] |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

404 not found -> labels should be a map of string string -> map[string]string

description is not that helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants