Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ jobs:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Generate manifests
run: make manifests generate
- name: Generate manifests and sync Helm CRDs
run: make manifests generate helm-crds

- name: Check for uncommitted changes
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::Generated manifests are out of date. Please run 'make manifests generate' and commit the changes."
echo "::error::Generated manifests or Helm CRDs are out of date. Please run 'make manifests generate helm-crds' and commit the changes."
git diff
exit 1
fi
Expand All @@ -126,6 +126,6 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Run integration tests
run: make run-integration-tests IMG=gnmic-operator:ci
run: make run-integration-tests IMG=gnmic-operator:ci
27 changes: 27 additions & 0 deletions helm/crds/operator.gnmic.dev_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
- jsonPath: .status.targetsCount
name: Targets
type: integer
- jsonPath: .status.unassignedTargets
name: Unassigned
type: integer
- jsonPath: .status.subscriptionsCount
name: Subs
type: integer
Expand Down Expand Up @@ -396,6 +399,15 @@ spec:
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
type: object
type: object
targetDistribution:
description: The target distribution configuration
properties:
podCapacity:
description: |-
The capacity per pod for distributing targets
To be used in conjunction with Horizontal Pod Autoscaling (HPA) scaling.
type: integer
type: object
required:
- image
type: object
Expand Down Expand Up @@ -475,6 +487,9 @@ spec:
description: The number of ready replicas
format: int32
type: integer
selector:
description: The selector for the cluster statefulset
type: string
subscriptionsCount:
description: The number of subscriptions referenced by the pipelines
format: int32
Expand All @@ -483,16 +498,28 @@ spec:
description: The number of targets referenced by the pipelines
format: int32
type: integer
unassignedTargets:
description: |-
The number of targets that could not be assigned to any pod due to capacity limits.
Non-zero when total targets exceed numPods × perPodCapacity.
format: int32
type: integer
required:
- inputsCount
- outputsCount
- pipelinesCount
- readyReplicas
- selector
- subscriptionsCount
- targetsCount
- unassignedTargets
type: object
type: object
served: true
storage: true
subresources:
scale:
labelSelectorPath: .status.selector
specReplicasPath: .spec.replicas
statusReplicasPath: .status.readyReplicas
status: {}
17 changes: 15 additions & 2 deletions helm/crds/operator.gnmic.dev_outputs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
serviceRef:
description: |-
ServiceRef references a Kubernetes Service to use as the output address.
Supported for: nats, jetstream, kafka outputs.
Supported for: nats, jetstream, kafka, remote_write, influxdb outputs.
The service address will be resolved and injected into the output config.
properties:
name:
Expand All @@ -89,13 +89,21 @@ spec:
Port is the name or number of the port to use.
If not specified, the first port of the service is used.
type: string
url:
description: |-
URL is an optional path suffix appended after the resolved service address
(scheme, host, and port). A leading slash on the value is optional; the
operator joins the base and suffix with a single '/'. Use this for HTTP(S)
outputs such as prometheus_write (for example api/v1/write or api/v1/push)
or influxdb instead of putting the full URL in config.
type: string
required:
- name
type: object
serviceSelector:
description: |-
ServiceSelector selects Kubernetes Services by labels to use as output addresses.
Supported for: nats, jetstream, kafka outputs.
Supported for: nats, jetstream, kafka, remote_write, influxdb outputs.
All matching service addresses will be resolved and injected into the output config.
properties:
matchLabels:
Expand All @@ -113,6 +121,11 @@ spec:
Port is the name or number of the port to use.
If not specified, the first port of the service is used.
type: string
url:
description: |-
URL is an optional path suffix appended after each resolved service address.
Same semantics as ServiceReference.url (see ServiceReference).
type: string
required:
- matchLabels
type: object
Expand Down
27 changes: 27 additions & 0 deletions helm/crds/operator.gnmic.dev_subscriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,28 @@ spec:
heartbeatInterval:
description: The gNMI Subscription heartbeat interval
type: string
history:
description: The gNMI Subscription history configuration
properties:
end:
description: The gNMI Subscription history end time
format: date-time
type: string
snapshot:
description: The gNMI Subscription history snapshot time
format: date-time
type: string
start:
description: The gNMI Subscription history start time
format: date-time
type: string
type: object
mode:
description: The gNMI SubscriptionList mode (ONCE, STREAM/SAMPLE,
STREAM/ON_CHANGE, STREAM/TARGET_DEFINED or POLL)
enum:
- ONCE
- STREAM
- STREAM/SAMPLE
- STREAM/ON_CHANGE
- STREAM/TARGET_DEFINED
Expand All @@ -84,6 +101,10 @@ spec:
prefix:
description: The gNMI prefix to subscribe to
type: string
qos:
description: The gNMI Subscription QoS (0-9)
format: int32
type: integer
sampleInterval:
description: The gNMI Subscription sample interval
type: string
Expand All @@ -92,6 +113,12 @@ spec:
items:
type: string
type: array
suppressRedundant:
description: Whether to suppress redundant updates
type: boolean
target:
description: The gNMI target to subscribe to
type: string
updatesOnly:
description: Whether to only send updates or all data
type: boolean
Expand Down
2 changes: 2 additions & 0 deletions helm/crds/operator.gnmic.dev_targetprofiles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ spec:
username, password or token keys in the secret referenced by the field
type: string
encoding:
default: JSON
description: The gNMI Subscription encoding (JSON, BYTES, PROTO, ASCII,
JSON_IETF)
enum:
Expand Down Expand Up @@ -94,6 +95,7 @@ spec:
description: The TCP keep-alive interval
type: string
timeout:
default: 10s
description: Target connection timeout
type: string
tls:
Expand Down
69 changes: 55 additions & 14 deletions helm/crds/operator.gnmic.dev_targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ spec:
- jsonPath: .spec.profile
name: Profile
type: string
- jsonPath: .status.clusters
name: Clusters
type: integer
- jsonPath: .status.connectionState
name: State
type: string
name: v1alpha1
schema:
openAPIV3Schema:
Expand Down Expand Up @@ -57,24 +63,59 @@ spec:
- profile
type: object
status:
description: TargetStatus defines the observed state of Target
description: |-
TargetStatus defines the observed state of Target.
A single Target may be collected by multiple Clusters (via different Pipelines),
so the status is reported per-cluster.
properties:
clusterStates:
additionalProperties:
description: ClusterTargetState represents the state of a target
on a specific gNMIc cluster pod.
properties:
connectionState:
description: The gNMI connection state (CONNECTING, READY, TRANSIENT_FAILURE,
etc.).
type: string
failedReason:
description: The reason for failure when state is "failed".
type: string
lastUpdated:
description: When this state was last updated by the gNMIc pod.
format: date-time
type: string
pod:
description: The pod within the cluster that currently owns
this target.
type: string
state:
description: The target's operational state (starting, running,
stopping, stopped, failed).
type: string
subscriptions:
additionalProperties:
type: string
description: Per-subscription state (subscription name -> running/stopped).
type: object
required:
- pod
type: object
description: |-
Per-cluster target state, keyed by Cluster CR name.
A target may be collected by multiple clusters (via different pipelines).
type: object
clusters:
description: Number of clusters currently collecting this target.
format: int32
type: integer
connectionState:
description: The connection state of the target
type: string
lastConnected:
format: date-time
type: string
lastDisconnected:
format: date-time
type: string
lastError:
description: |-
Aggregate state across all clusters.
READY if all clusters report running and READY, DEGRADED if any do not.
Empty when no clusters are collecting this target.
type: string
required:
- connectionState
- lastConnected
- lastDisconnected
- lastError
- clusters
type: object
type: object
served: true
Expand Down
Loading