[V2] Status of GitLab resource v2beta1
Summary
This is the first draft of the status for version v1beta1
of GitLab resource. It provides a generic structure for reporting the state of a GitLab instance.
Required
-
Merge Request Title and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com -
When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Tests added -
Integration tests added to GitLab QA -
Equivalent MR/issue for omnibus-gitlab opened -
Validate potential values for new configuration settings. Formats such as integer10
, duration10s
, URIscheme://user:passwd@host:port
may require quotation or other special handling when rendered in a template and written to a configuration file.
Background
See:
- Calculate status phase based on status conditions (#380)
- Consider using more fields and/or a broader voc... (#316)
- [Spike] Investigate proper/optimal use of Statu... (#1176)
- [Spike] Investigate a structured GitLab resourc... (#1389 - closed)
Key Changes
- A new structure for GitLab resource status that relies on
Condition
- Tagged Go data types that can be serialized into JSON and used with Kubernetes code generation tooling. The CRD specification can be generated with
controller-gen
.
Benefits
- Adhering to Kubernetes convention and best practices of Operator SDK.
- Transparent communication of the state of the GitLab instance and its components
Further Work
- Extending the list of known
Type
s andReason
s for variousCondition
s. - Document Go data types. It is required for documentation of OpenAPI specification.
- Tagging Go data types with CRD validation markers
Overview
GitLab
classDiagram
GitLab --|> TypeMeta
GitLab --> ObjectMeta : metadata
GitLab --> GitLabSpec : spec
GitLab --> GitLabStatus : status
GitLabList --|> TypeMeta
GitLabList --> ListMeta : metadata
GitLabList --o GitLab : items
GitLabStatus
classDiagram
GitLabStatus --o Condition : conditions
GitLabStatus --o ComponentStatus : componentStatuses
ComponentStatus --> "0..1" ComponentStateWaiting : waiting
ComponentStatus --> "0..1" ComponentStateRunning : running
Examples
Example 1
apiVersion: gitlab.com/v2beta1
kind: GitLab
metadata:
name: example-1
spec:
version: 16.10.0
# ...
status:
observedGeneration: 5
version: 16.9.1
conditions:
- type: Initialized
status: True
lastTransitionTime: "2023-03-10T04:12:34Z"
- type: PersistentBackendsReady
status: False
lastTransitionTime: "2023-03-10T04:12:34Z"
- type: GitalyReady
status: False
lastTransitionTime: "2023-03-10T04:12:34Z"
componentStatuses:
- name: ApplicationServer
waiting:
reason: GitalyNotResponding
message: Gitaly is not responding
- name: JobProcessor
running:
startedAt: "2023-03-10T04:12:34Z"
ready: false
Related issues
Edited by Hossein Pursultani