Skip to content

Commit 6902f6f

Browse files
authored
docs: update KSM config and quickstart (#197)
fixes #171 --------- Signed-off-by: Mario Constanti <[email protected]>
1 parent ef5de70 commit 6902f6f

20 files changed

+550
-356
lines changed

.golangci.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ linters-settings:
4545
alias:
4646
- pkg: github.com/mercedes-benz/garm-operator/api/v1alpha1
4747
alias: garmoperatorv1alpha1
48+
- pkg: github.com/mercedes-benz/garm-operator/api/v1beta1
49+
alias: garmoperatorv1beta1
4850
- pkg: k8s.io/api/core/v1
4951
alias: corev1
5052
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1

api/v1alpha1/organization_conversion.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,28 @@ import (
66
apiconversion "k8s.io/apimachinery/pkg/conversion"
77
"sigs.k8s.io/controller-runtime/pkg/conversion"
88

9-
v1beta1 "github.com/mercedes-benz/garm-operator/api/v1beta1"
9+
garmoperatorv1beta1 "github.com/mercedes-benz/garm-operator/api/v1beta1"
1010
)
1111

1212
func (o *Organization) ConvertTo(dstRaw conversion.Hub) error {
13-
return Convert_v1alpha1_Organization_To_v1beta1_Organization(o, dstRaw.(*v1beta1.Organization), nil)
13+
return Convert_v1alpha1_Organization_To_v1beta1_Organization(o, dstRaw.(*garmoperatorv1beta1.Organization), nil)
1414
}
1515

1616
func (o *Organization) ConvertFrom(dstRaw conversion.Hub) error {
17-
return Convert_v1beta1_Organization_To_v1alpha1_Organization(dstRaw.(*v1beta1.Organization), o, nil)
17+
return Convert_v1beta1_Organization_To_v1alpha1_Organization(dstRaw.(*garmoperatorv1beta1.Organization), o, nil)
1818
}
1919

20-
func Convert_v1alpha1_OrganizationSpec_To_v1beta1_OrganizationSpec(in *OrganizationSpec, out *v1beta1.OrganizationSpec, s apiconversion.Scope) error {
20+
func Convert_v1alpha1_OrganizationSpec_To_v1beta1_OrganizationSpec(in *OrganizationSpec, out *garmoperatorv1beta1.OrganizationSpec, s apiconversion.Scope) error {
2121
out.CredentialsRef = corev1.TypedLocalObjectReference{
2222
Name: in.CredentialsName,
2323
Kind: "GitHubCredential",
24-
APIGroup: &v1beta1.GroupVersion.Group,
24+
APIGroup: &garmoperatorv1beta1.GroupVersion.Group,
2525
}
2626

2727
return autoConvert_v1alpha1_OrganizationSpec_To_v1beta1_OrganizationSpec(in, out, s)
2828
}
2929

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

3333
return autoConvert_v1beta1_OrganizationSpec_To_v1alpha1_OrganizationSpec(in, out, s)

config/kube-state-metrics/configmap.yaml

+143-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ data:
1717
- groupVersionKind:
1818
group: garm-operator.mercedes-benz.com
1919
kind: "Enterprise"
20-
version: "v1alpha1"
20+
version: "v1beta1"
2121
metricNamePrefix: garm_operator
2222
commonLabels:
2323
crd_type: "enterprise"
@@ -40,7 +40,7 @@ data:
4040
type: Info
4141
info:
4242
labelsFromPath:
43-
credentialsName: [ spec, credentialsName ]
43+
credentialsRefName: [ spec, credentialsRef, name ]
4444
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
4545
webhookSecretRefName: [ spec, webhookSecretRef, name ]
4646
id: [ status, id ]
@@ -77,7 +77,7 @@ data:
7777
- groupVersionKind:
7878
group: garm-operator.mercedes-benz.com
7979
kind: "Organization"
80-
version: "v1alpha1"
80+
version: "v1beta1"
8181
metricNamePrefix: garm_operator
8282
commonLabels:
8383
crd_type: "organization"
@@ -100,7 +100,7 @@ data:
100100
type: Info
101101
info:
102102
labelsFromPath:
103-
credentialsName: [ spec, credentialsName ]
103+
credentialsRefName: [ spec, credentialsRef, name ]
104104
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
105105
webhookSecretRefName: [ spec, webhookSecretRef, name ]
106106
id: [ status, id ]
@@ -137,7 +137,7 @@ data:
137137
- groupVersionKind:
138138
group: garm-operator.mercedes-benz.com
139139
kind: "Repository"
140-
version: "v1alpha1"
140+
version: "v1beta1"
141141
metricNamePrefix: garm_operator
142142
commonLabels:
143143
crd_type: "repository"
@@ -161,7 +161,7 @@ data:
161161
info:
162162
labelsFromPath:
163163
owner: [ spec, owner ]
164-
credentialsName: [ spec, credentialsName ]
164+
credentialsRefName: [ spec, credentialsRef, name ]
165165
webhookSecretRefKey: [ spec, webhookSecretRef, key ]
166166
webhookSecretRefName: [ spec, webhookSecretRef, name ]
167167
id: [ status, id ]
@@ -198,7 +198,7 @@ data:
198198
- groupVersionKind:
199199
group: garm-operator.mercedes-benz.com
200200
kind: "Pool"
201-
version: "v1alpha1"
201+
version: "v1beta1"
202202
metricNamePrefix: garm_operator
203203
commonLabels:
204204
crd_type: "pool"
@@ -302,7 +302,7 @@ data:
302302
- groupVersionKind:
303303
group: garm-operator.mercedes-benz.com
304304
kind: "Image"
305-
version: "v1alpha1"
305+
version: "v1beta1"
306306
metricNamePrefix: garm_operator
307307
commonLabels:
308308
crd_type: "image"
@@ -326,3 +326,138 @@ data:
326326
info:
327327
labelsFromPath:
328328
tag: [spec, tag]
329+
330+
############################
331+
# GarmServerConfig #
332+
############################
333+
- groupVersionKind:
334+
group: garm-operator.mercedes-benz.com
335+
kind: "GarmServerConfig"
336+
version: "v1beta1"
337+
metricNamePrefix: garm_operator
338+
commonLabels:
339+
crd_type: "garmserverconfig"
340+
labelsFromPath:
341+
name: [ metadata, name ]
342+
namespace: [ metadata, namespace ]
343+
metrics:
344+
- name: garmserverconfig_created
345+
help: Unix creation timestamp.
346+
each:
347+
gauge:
348+
path:
349+
- metadata
350+
- creationTimestamp
351+
type: Gauge
352+
353+
- name: garmserverconfig_info
354+
help: Information about a garm server config.
355+
each:
356+
type: Info
357+
info:
358+
labelsFromPath:
359+
callbackUrl: [spec, callbackUrl]
360+
metadataUrl: [spec, metadataUrl]
361+
webhookUrl: [spec, webhookUrl]
362+
controllerId: [status, controllerId]
363+
minimumJobAgeBackoff: [status, minimumJobAgeBackoff]
364+
version: [status, version]
365+
366+
############################
367+
# GitHubEndpoint #
368+
############################
369+
- groupVersionKind:
370+
group: garm-operator.mercedes-benz.com
371+
kind: "GitHubEndpoint"
372+
version: "v1beta1"
373+
metricNamePrefix: garm_operator
374+
commonLabels:
375+
crd_type: "githubendpoint"
376+
labelsFromPath:
377+
name: [ metadata, name ]
378+
namespace: [ metadata, namespace ]
379+
metrics:
380+
- name: githubendpoint_created
381+
help: Unix creation timestamp.
382+
each:
383+
gauge:
384+
path:
385+
- metadata
386+
- creationTimestamp
387+
type: Gauge
388+
389+
- name: githubendpoint_info
390+
help: Information about a githubendpoint config.
391+
each:
392+
type: Info
393+
info:
394+
labelsFromPath:
395+
apiBaseUrl: [spec, apiBaseUrl]
396+
baseUrl: [spec, baseUrl]
397+
uploadBaseUrl: [spec, uploadBaseUrl]
398+
399+
- name: githubendpoint_status_conditions
400+
help: Displays whether status of each possible condition is True or False.
401+
each:
402+
type: Gauge
403+
gauge:
404+
path:
405+
- status
406+
- conditions
407+
valueFrom:
408+
- status
409+
labelFromKey: reason
410+
labelsFromPath:
411+
type: [ type ]
412+
413+
############################
414+
# GitHubCredential #
415+
############################
416+
- groupVersionKind:
417+
group: garm-operator.mercedes-benz.com
418+
kind: "GitHubCredential"
419+
version: "v1beta1"
420+
metricNamePrefix: garm_operator
421+
commonLabels:
422+
crd_type: "githubcredential"
423+
labelsFromPath:
424+
name: [ metadata, name ]
425+
namespace: [ metadata, namespace ]
426+
metrics:
427+
- name: githubcredential_created
428+
help: Unix creation timestamp.
429+
each:
430+
gauge:
431+
path:
432+
- metadata
433+
- creationTimestamp
434+
type: Gauge
435+
436+
- name: githubcredential_info
437+
help: Information about a githubcredential config.
438+
each:
439+
type: Info
440+
info:
441+
labelsFromPath:
442+
authType: [spec, authType]
443+
secretRefKey: [ spec, secretRef, key ]
444+
secretRefName: [ spec, secretRef, name ]
445+
endpointRefName: [ spec, endpointRef, name ]
446+
apiBaseUrl: [status, apiBaseUrl]
447+
baseUrl: [status, baseUrl]
448+
uploadBaseUrl: [status, uploadBaseUrl]
449+
id: [status, id]
450+
451+
- name: githubcredential_status_conditions
452+
help: Displays whether status of each possible condition is True or False.
453+
each:
454+
type: Gauge
455+
gauge:
456+
path:
457+
- status
458+
- conditions
459+
valueFrom:
460+
- status
461+
labelFromKey: reason
462+
labelsFromPath:
463+
type: [ type ]

config/samples/garm-operator_v1alpha1_enterprise.yaml

-27
This file was deleted.

config/samples/garm-operator_v1alpha1_image.yaml

-14
This file was deleted.

config/samples/garm-operator_v1alpha1_organization.yaml

-27
This file was deleted.

0 commit comments

Comments
 (0)