Skip to content

Commit

Permalink
allow extending flux runtime ui beyond flux to create gitops runtime (#…
Browse files Browse the repository at this point in the history
…4162)

* added gitopsruntime test for extending runtime ui ...

* added feature flag for runtime ui

Signed-off-by: Eneko Fernandez <[email protected]>

* adding unit flux runtime

Signed-off-by: Eneko Fernandez <[email protected]>

* can set configuration via feature flag

Signed-off-by: Eneko Fernandez <[email protected]>

* refactor file names

Signed-off-by: Eneko Fernandez <[email protected]>

* added integration for flux runtime api

Signed-off-by: Eneko Fernandez <[email protected]>

* added to listcrds

Signed-off-by: Eneko Fernandez <[email protected]>

* not required

Signed-off-by: Eneko Fernandez <[email protected]>

* refactored label value

Signed-off-by: Eneko Fernandez <[email protected]>

* not required

Signed-off-by: Eneko Fernandez <[email protected]>

* linted

Signed-off-by: Eneko Fernandez <[email protected]>

* gitops runtime visible in the ui and flux version only renders flux

Signed-off-by: Eneko Fernandez <[email protected]>

* renamed flux runtime to runtime to be able to accomodate both flux and weave gitops controllers

Signed-off-by: Eneko Fernandez <[email protected]>

* linted

Signed-off-by: Eneko Fernandez <[email protected]>

* extending api with listruntime* operations

Signed-off-by: Eneko Fernandez <[email protected]>

* implemented runtime api endpoint

Signed-off-by: Eneko Fernandez <[email protected]>

* restore flux runtime endpoint

Signed-off-by: Eneko Fernandez <[email protected]>

* implemented runtime crds api handler

Signed-off-by: Eneko Fernandez <[email protected]>

* added ui support to runtime

Signed-off-by: Eneko Fernandez <[email protected]>

* review pr

Signed-off-by: Eneko Fernandez <[email protected]>

* fix style

Signed-off-by: Eneko Fernandez <[email protected]>

* prettified

Signed-off-by: Eneko Fernandez <[email protected]>

* ran proto

Signed-off-by: Eneko Fernandez <[email protected]>

* Smth. like that should work.

* just my grain of salt of the pr

Signed-off-by: Eneko Fernandez <[email protected]>

* review PR

Signed-off-by: Eneko Fernandez <[email protected]>

* review PR

Signed-off-by: Eneko Fernandez <[email protected]>

* added documentation

Signed-off-by: Eneko Fernandez <[email protected]>

* review pr

Signed-off-by: Eneko Fernandez <[email protected]>

* review pr

Signed-off-by: Eneko Fernandez <[email protected]>

* added documentation on how to decorate manifests
Signed-off-by: Eneko Fernandez <[email protected]>

Signed-off-by: Eneko Fernandez <[email protected]>

* some more docs refactoring

Signed-off-by: Eneko Fernandez <[email protected]>

* pr review

Signed-off-by: Eneko Fernandez <[email protected]>

* removed as not expected refactoring but replacement

Signed-off-by: Eneko Fernandez <[email protected]>

* removed multiple flux detection and test version logic for consistency between oss and ee

Signed-off-by: Eneko Fernandez <[email protected]>

* Apply suggestions from code review

Co-authored-by: Olga Pudrovska <[email protected]>

* Update website/docs/open-source/getting-started/install-OSS.mdx

Co-authored-by: Yiannis Triantafyllopoulos <[email protected]>

* exporting runtime components

Signed-off-by: Eneko Fernandez <[email protected]>

* Update website/docs/open-source/getting-started/ui-OSS.mdx

Co-authored-by: Olga Pudrovska <[email protected]>

* Update website/docs/open-source/getting-started/ui-OSS.mdx

Co-authored-by: Olga Pudrovska <[email protected]>

* pr review comments

Signed-off-by: Eneko Fernandez <[email protected]>

* Update website/docs/open-source/getting-started/ui-OSS.mdx

Co-authored-by: Olga Pudrovska <[email protected]>

* better wording

Signed-off-by: Eneko Fernandez <[email protected]>

---------

Signed-off-by: Eneko Fernandez <[email protected]>
Co-authored-by: Olga Pudrovska <[email protected]>
Co-authored-by: Yiannis Triantafyllopoulos <[email protected]>
  • Loading branch information
3 people authored Dec 22, 2023
1 parent 78d5f6d commit 0af2f4f
Show file tree
Hide file tree
Showing 22 changed files with 1,620 additions and 568 deletions.
43 changes: 43 additions & 0 deletions api/core/core.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,30 @@ service Core {
};
}

/*
* ListRuntimeObjects lists Weave GitOps runtime components.
* Weave GitOps runtime is composed of Flux runtime but also other components
* in the ecosystem like TF-controller or Policy Agent.
*/
rpc ListRuntimeObjects(ListRuntimeObjectsRequest)
returns (ListRuntimeObjectsResponse) {
option (google.api.http) = {
get: "/v1/runtime_objects"
};
}

/*
* ListRuntimeCrds lists Weave GitOps runtime components CRDs.
* Weave GitOps runtime is composed of Flux runtime but also other components
* in the ecosystem like TF-controller or Policy Agent.
*/
rpc ListRuntimeCrds(ListRuntimeCrdsRequest)
returns (ListRuntimeCrdsResponse) {
option (google.api.http) = {
get: "/v1/runtime_crds"
};
}

/*
* GetReconciledObjects returns a list of objects that were created
* as a result of reconciling a Flux automation.
Expand Down Expand Up @@ -318,6 +342,16 @@ message ListFluxRuntimeObjectsResponse {
repeated ListError errors = 2;
}

message ListRuntimeObjectsRequest {
string namespace = 1;
string clusterName = 2;
}

message ListRuntimeObjectsResponse {
repeated Deployment deployments = 1;
repeated ListError errors = 2;
}

message ListFluxCrdsRequest {
string clusterName = 1;
}
Expand All @@ -327,6 +361,15 @@ message ListFluxCrdsResponse {
repeated ListError errors = 2;
}

message ListRuntimeCrdsRequest {
string clusterName = 1;
}

message ListRuntimeCrdsResponse {
repeated Crd crds = 1;
repeated ListError errors = 2;
}

message GetObjectRequest {
string name = 1;
string namespace = 2;
Expand Down
102 changes: 102 additions & 0 deletions api/core/core.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,74 @@
]
}
},
"/v1/runtime_crds": {
"get": {
"summary": "ListRuntimeCrds lists Weave GitOps runtime components CRDs.\nWeave GitOps runtime is composed of Flux runtime but also other components\nin the ecosystem like TF-controller or Policy Agent.",
"operationId": "Core_ListRuntimeCrds",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1ListRuntimeCrdsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "clusterName",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Core"
]
}
},
"/v1/runtime_objects": {
"get": {
"summary": "ListRuntimeObjects lists Weave GitOps runtime components.\nWeave GitOps runtime is composed of Flux runtime but also other components\nin the ecosystem like TF-controller or Policy Agent.",
"operationId": "Core_ListRuntimeObjects",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1ListRuntimeObjectsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "namespace",
"in": "query",
"required": false,
"type": "string"
},
{
"name": "clusterName",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
"Core"
]
}
},
"/v1/session_logs": {
"post": {
"summary": "GetSessionLogs returns the logs for a given session",
Expand Down Expand Up @@ -1319,6 +1387,40 @@
}
}
},
"v1ListRuntimeCrdsResponse": {
"type": "object",
"properties": {
"crds": {
"type": "array",
"items": {
"$ref": "#/definitions/v1Crd"
}
},
"errors": {
"type": "array",
"items": {
"$ref": "#/definitions/v1ListError"
}
}
}
},
"v1ListRuntimeObjectsResponse": {
"type": "object",
"properties": {
"deployments": {
"type": "array",
"items": {
"$ref": "#/definitions/v1Deployment"
}
},
"errors": {
"type": "array",
"items": {
"$ref": "#/definitions/v1ListError"
}
}
}
},
"v1LogEntry": {
"type": "object",
"properties": {
Expand Down
5 changes: 5 additions & 0 deletions charts/gitops-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ envVars:
value: "true"
- name: WEAVE_GITOPS_FEATURE_CLUSTER
value: "false"
# -- Enable this feature flag if you want to expand Flux Runtime UI with other Weave GitOps components like Policy Agent or TF-Controller.
# Ensure that Weave GitOps Deployment and CRDs have the label 'app.kubernetes.io/part-of=weave-gitops'. See https://docs.gitops.weave.works/docs/open-source/getting-started/install-OSS for more info.
- name: WEAVE_GITOPS_FEATURE_GITOPS_RUNTIME
value: "false"

# -- Annotations to add to the deployment
annotations: {}
# Should the 'oidc-auth' secret be created. For a detailed
Expand Down
Loading

0 comments on commit 0af2f4f

Please sign in to comment.