minikube start
kubectl apply -f crd-foo.example.com.yaml -f crd-bar.example.com.yaml
kubectl apply -f cr-foo.yaml -f cr-bar.yaml
go run main.go --custom-resource-state-only --custom-resource-state-config-file custom-resource-config-file.yaml --kubeconfig ~/.kube/config
Last active
November 3, 2023 17:24
-
-
Save bergerx/adad24dcd7cc360e1f36fbb98407b27b to your computer and use it in GitHub Desktop.
repeated TYPE decleration in kube-state-metrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Bar | |
apiVersion: example.com/v1 | |
metadata: | |
name: mybar | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: Foo | |
apiVersion: example.com/v1 | |
metadata: | |
name: myfoo | |
spec: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: bars.example.com | |
spec: | |
group: example.com | |
scope: Cluster | |
names: | |
kind: Bar | |
singular: bar | |
plural: bars | |
versions: | |
- name: v1 | |
served: true | |
storage: true | |
schema: | |
openAPIV3Schema: | |
type: object | |
properties: | |
spec: | |
x-kubernetes-preserve-unknown-fields: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apiextensions.k8s.io/v1 | |
kind: CustomResourceDefinition | |
metadata: | |
name: foos.example.com | |
spec: | |
group: example.com | |
scope: Cluster | |
names: | |
kind: Foo | |
singular: foo | |
plural: foos | |
versions: | |
- name: v1 | |
served: true | |
storage: true | |
schema: | |
openAPIV3Schema: | |
type: object | |
properties: | |
spec: | |
x-kubernetes-preserve-unknown-fields: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: CustomResourceStateMetrics | |
spec: | |
resources: | |
- groupVersionKind: | |
group: example.com | |
kind: "*" | |
version: v1 | |
labelsFromPath: | |
name: [metadata, name] | |
namespace: [metadata, namespace] | |
metricNamePrefix: "cr" | |
metrics: | |
- name: creationtimestamp | |
each: | |
type: Gauge | |
gauge: | |
path: [metadata, creationTimestamp] | |
- name: resourceversion | |
each: | |
type: Gauge | |
gauge: | |
path: [metadata, resourceVersion] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HELP cr_creationtimestamp | |
2 | |
# TYPE cr_creationtimestamp gauge | |
3 | |
cr_creationtimestamp{customresource_group="example.com",customresource_kind="Bar",customresource_version="v1",name="mybar"} 1.699031755e+09 | |
4 | |
# HELP cr_resourceversion | |
5 | |
# TYPE cr_resourceversion gauge | |
6 | |
cr_resourceversion{customresource_group="example.com",customresource_kind="Bar",customresource_version="v1",name="mybar"} 508820 | |
7 | |
# HELP cr_creationtimestamp | |
8 | |
# TYPE cr_creationtimestamp gauge | |
9 | |
cr_creationtimestamp{customresource_group="example.com",customresource_kind="Foo",customresource_version="v1",name="myfoo"} 1.699031755e+09 | |
10 | |
# HELP cr_resourceversion | |
11 | |
# TYPE cr_resourceversion gauge | |
12 | |
cr_resourceversion{customresource_group="example.com",customresource_kind="Foo",customresource_version="v1",name="myfoo"} 508819 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment