Skip to content

Commit

Permalink
docs: update KSM config and quickstart (#197)
Browse files Browse the repository at this point in the history
fixes #171

---------

Signed-off-by: Mario Constanti <[email protected]>
  • Loading branch information
bavarianbidi authored Oct 25, 2024
1 parent ef5de70 commit 6902f6f
Show file tree
Hide file tree
Showing 20 changed files with 550 additions and 356 deletions.
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ linters-settings:
alias:
- pkg: github.com/mercedes-benz/garm-operator/api/v1alpha1
alias: garmoperatorv1alpha1
- pkg: github.com/mercedes-benz/garm-operator/api/v1beta1
alias: garmoperatorv1beta1
- pkg: k8s.io/api/core/v1
alias: corev1
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
Expand Down
12 changes: 6 additions & 6 deletions api/v1alpha1/organization_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ import (
apiconversion "k8s.io/apimachinery/pkg/conversion"
"sigs.k8s.io/controller-runtime/pkg/conversion"

v1beta1 "github.com/mercedes-benz/garm-operator/api/v1beta1"
garmoperatorv1beta1 "github.com/mercedes-benz/garm-operator/api/v1beta1"
)

func (o *Organization) ConvertTo(dstRaw conversion.Hub) error {
return Convert_v1alpha1_Organization_To_v1beta1_Organization(o, dstRaw.(*v1beta1.Organization), nil)
return Convert_v1alpha1_Organization_To_v1beta1_Organization(o, dstRaw.(*garmoperatorv1beta1.Organization), nil)
}

func (o *Organization) ConvertFrom(dstRaw conversion.Hub) error {
return Convert_v1beta1_Organization_To_v1alpha1_Organization(dstRaw.(*v1beta1.Organization), o, nil)
return Convert_v1beta1_Organization_To_v1alpha1_Organization(dstRaw.(*garmoperatorv1beta1.Organization), o, nil)
}

func Convert_v1alpha1_OrganizationSpec_To_v1beta1_OrganizationSpec(in *OrganizationSpec, out *v1beta1.OrganizationSpec, s apiconversion.Scope) error {
func Convert_v1alpha1_OrganizationSpec_To_v1beta1_OrganizationSpec(in *OrganizationSpec, out *garmoperatorv1beta1.OrganizationSpec, s apiconversion.Scope) error {
out.CredentialsRef = corev1.TypedLocalObjectReference{
Name: in.CredentialsName,
Kind: "GitHubCredential",
APIGroup: &v1beta1.GroupVersion.Group,
APIGroup: &garmoperatorv1beta1.GroupVersion.Group,
}

return autoConvert_v1alpha1_OrganizationSpec_To_v1beta1_OrganizationSpec(in, out, s)
}

func Convert_v1beta1_OrganizationSpec_To_v1alpha1_OrganizationSpec(in *v1beta1.OrganizationSpec, out *OrganizationSpec, s apiconversion.Scope) error {
func Convert_v1beta1_OrganizationSpec_To_v1alpha1_OrganizationSpec(in *garmoperatorv1beta1.OrganizationSpec, out *OrganizationSpec, s apiconversion.Scope) error {
out.CredentialsName = in.CredentialsRef.Name

return autoConvert_v1beta1_OrganizationSpec_To_v1alpha1_OrganizationSpec(in, out, s)
Expand Down
151 changes: 143 additions & 8 deletions config/kube-state-metrics/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ data:
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Enterprise"
version: "v1alpha1"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "enterprise"
Expand All @@ -40,7 +40,7 @@ data:
type: Info
info:
labelsFromPath:
credentialsName: [ spec, credentialsName ]
credentialsRefName: [ spec, credentialsRef, name ]
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
webhookSecretRefName: [ spec, webhookSecretRef, name ]
id: [ status, id ]
Expand Down Expand Up @@ -77,7 +77,7 @@ data:
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Organization"
version: "v1alpha1"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "organization"
Expand All @@ -100,7 +100,7 @@ data:
type: Info
info:
labelsFromPath:
credentialsName: [ spec, credentialsName ]
credentialsRefName: [ spec, credentialsRef, name ]
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
webhookSecretRefName: [ spec, webhookSecretRef, name ]
id: [ status, id ]
Expand Down Expand Up @@ -137,7 +137,7 @@ data:
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Repository"
version: "v1alpha1"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "repository"
Expand All @@ -161,7 +161,7 @@ data:
info:
labelsFromPath:
owner: [ spec, owner ]
credentialsName: [ spec, credentialsName ]
credentialsRefName: [ spec, credentialsRef, name ]
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
webhookSecretRefName: [ spec, webhookSecretRef, name ]
id: [ status, id ]
Expand Down Expand Up @@ -198,7 +198,7 @@ data:
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Pool"
version: "v1alpha1"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "pool"
Expand Down Expand Up @@ -302,7 +302,7 @@ data:
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "Image"
version: "v1alpha1"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "image"
Expand All @@ -326,3 +326,138 @@ data:
info:
labelsFromPath:
tag: [spec, tag]
############################
# GarmServerConfig #
############################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "GarmServerConfig"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "garmserverconfig"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: garmserverconfig_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge
- name: garmserverconfig_info
help: Information about a garm server config.
each:
type: Info
info:
labelsFromPath:
callbackUrl: [spec, callbackUrl]
metadataUrl: [spec, metadataUrl]
webhookUrl: [spec, webhookUrl]
controllerId: [status, controllerId]
minimumJobAgeBackoff: [status, minimumJobAgeBackoff]
version: [status, version]
############################
# GitHubEndpoint #
############################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "GitHubEndpoint"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "githubendpoint"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: githubendpoint_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge
- name: githubendpoint_info
help: Information about a githubendpoint config.
each:
type: Info
info:
labelsFromPath:
apiBaseUrl: [spec, apiBaseUrl]
baseUrl: [spec, baseUrl]
uploadBaseUrl: [spec, uploadBaseUrl]
- name: githubendpoint_status_conditions
help: Displays whether status of each possible condition is True or False.
each:
type: Gauge
gauge:
path:
- status
- conditions
valueFrom:
- status
labelFromKey: reason
labelsFromPath:
type: [ type ]
############################
# GitHubCredential #
############################
- groupVersionKind:
group: garm-operator.mercedes-benz.com
kind: "GitHubCredential"
version: "v1beta1"
metricNamePrefix: garm_operator
commonLabels:
crd_type: "githubcredential"
labelsFromPath:
name: [ metadata, name ]
namespace: [ metadata, namespace ]
metrics:
- name: githubcredential_created
help: Unix creation timestamp.
each:
gauge:
path:
- metadata
- creationTimestamp
type: Gauge
- name: githubcredential_info
help: Information about a githubcredential config.
each:
type: Info
info:
labelsFromPath:
authType: [spec, authType]
secretRefKey: [ spec, secretRef, key ]
secretRefName: [ spec, secretRef, name ]
endpointRefName: [ spec, endpointRef, name ]
apiBaseUrl: [status, apiBaseUrl]
baseUrl: [status, baseUrl]
uploadBaseUrl: [status, uploadBaseUrl]
id: [status, id]
- name: githubcredential_status_conditions
help: Displays whether status of each possible condition is True or False.
each:
type: Gauge
gauge:
path:
- status
- conditions
valueFrom:
- status
labelFromKey: reason
labelsFromPath:
type: [ type ]
27 changes: 0 additions & 27 deletions config/samples/garm-operator_v1alpha1_enterprise.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions config/samples/garm-operator_v1alpha1_image.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions config/samples/garm-operator_v1alpha1_organization.yaml

This file was deleted.

Loading

0 comments on commit 6902f6f

Please sign in to comment.