diff --git a/pkg/in_out.go b/pkg/in_out.go index d8a120b..05675a2 100644 --- a/pkg/in_out.go +++ b/pkg/in_out.go @@ -32,7 +32,7 @@ type crd struct { func checkFatal(err error) { if err != nil { - fmt.Fprintf(os.Stderr, "%w", err) + fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } } diff --git a/pkg/processor.go b/pkg/processor.go index 5f30255..f66730d 100644 --- a/pkg/processor.go +++ b/pkg/processor.go @@ -2,6 +2,7 @@ package pkg import ( "fmt" + "os" "reflect" "regexp" "sort" @@ -222,7 +223,10 @@ func sortMapKeys(keys []reflect.Value) []reflect.Value { case reflect.String: sorted := make([]string, 0, len(keys)) for _, k := range keys { - sorted = append(sorted, k.Interface().(string)) + // strings are frequently aliased to something else, e.g. v1.ResourceName + // for them to be sortable, this converts them to string and later needs to + // convert back to the underlying type + sorted = append(sorted, fmt.Sprintf("%v", k.Interface())) } sort.Strings(sorted) out := make([]reflect.Value, 0, len(keys)) @@ -249,13 +253,24 @@ func processUnstructured(pc processingContext, onlyMeta bool) { } sort.Strings(keys) for _, k := range keys { - last.lines = append(last.lines, fmt.Sprintf("\"%v\":", k)) - pc2 := pc.new(pathElement{}, "", o[k], reflect.Map) + if o[k] != nil { + last.lines = append(last.lines, fmt.Sprintf("\"%v\":", k)) + pc2 := pc.new(pathElement{}, "", o[k], reflect.Map) + processUnstructured(pc2, onlyMeta) + } + } + last.lines = append(last.lines, fmt.Sprintf("},")) + case []interface{}: + last.lines[len(last.lines)-1] += "[]interface{}{\n" + for _, e := range o { + pc2 := pc.new(pathElement{}, "", e, reflect.Slice) processUnstructured(pc2, onlyMeta) } last.lines = append(last.lines, fmt.Sprintf("},")) + case string: + last.lines[len(last.lines)-1] += fmt.Sprintf("%q,", pc.o) default: - last.lines[len(last.lines)-1] += fmt.Sprintf("\"%v\",", pc.o) + last.lines[len(last.lines)-1] += fmt.Sprintf("%v,", pc.o) } } @@ -309,8 +324,9 @@ func processKubernetes(pc processingContext) { varName := fmt.Sprintf("%q", ve.Interface()) last := &(*pc.rawVars)[len((*pc.rawVars))-1] if ptrDeref != "" { - varName = sanitize(fmt.Sprintf("%v-%v-%v", pc.un.GetName(), pc.name, ve.Interface())) - last.helpers[varName] = fmt.Sprintf("%v %v = %q", varName, teType, ve.Interface()) + var varLine string + varName, varLine = helperLine(pc, teType, kind, ve.Interface()) + last.helpers[varName] = varLine } last.lines = append(last.lines, fmt.Sprintf("%v%v%v,", ltype, ptrDeref, varName)) case reflect.Map: @@ -327,8 +343,10 @@ func processKubernetes(pc processingContext) { last := &(*pc.rawVars)[len((*pc.rawVars))-1] last.lines = append(last.lines, fmt.Sprintf("%v: map[%v%v]%v%v{", pc.name, keyNi, keyElem.Name(), valNi, valElem.Name())) keys := sortMapKeys(ve.MapKeys()) - for _, key := range keys { + for _, keyTyped := range keys { last := &(*pc.rawVars)[len((*pc.rawVars))-1] + // convert back the sorted key to the underlying type + key := keyTyped.Convert(keyElem) val := ve.MapIndex(key) pcKey := pc.new(pathElement{kind: "map"}, pc.name, key.Interface(), te.Kind()) last = &(*pc.rawVars)[len((*pc.rawVars))-1] @@ -363,8 +381,9 @@ func processKubernetes(pc processingContext) { varName := fmt.Sprintf("%v", ve.Interface()) last := &(*pc.rawVars)[len((*pc.rawVars))-1] if ptrDeref != "" { - varName = sanitize(fmt.Sprintf("%v-%v-%v", pc.un.GetName(), pc.name, ve.Interface())) - last.helpers[varName] = fmt.Sprintf("%v %v = %v", varName, teType, ve.Interface()) + var varLine string + varName, varLine = helperLine(pc, teType, kind, ve.Interface()) + last.helpers[varName] = varLine } last.lines = append(last.lines, fmt.Sprintf("%v%v%v,", ltype, ptrDeref, varName)) } @@ -372,6 +391,17 @@ func processKubernetes(pc processingContext) { return } +func helperLine(pc processingContext, typeName string, kind reflect.Kind, ifc interface{}) (string, string) { + name := sanitize(fmt.Sprintf("%v-%v-%v-%v", pc.un.GetName(), pc.un.GetKind(), pc.name, ifc)) + var line string + if kind == reflect.String { + line = fmt.Sprintf("%v %v = %q", name, typeName, ifc) + } else { + line = fmt.Sprintf("%v %v = %v", name, typeName, ifc) + } + return name, line +} + func process(o runtime.Object, un *unstructured.Unstructured, kubermatic, onlyMeta bool) (imports []Import, rawVars []RawVar) { ve := reflect.ValueOf(o).Elem() te := reflect.TypeOf(o).Elem() @@ -476,7 +506,11 @@ func ProcessObjects(obj []object, kubermatic, onlyMeta bool) (allImports []Impor func getRuntimeObject(data []byte, codecs serializer.CodecFactory) runtime.Object { obj, _, err := codecs.UniversalDeserializer().Decode(data, nil, nil) - checkFatal(err) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to decode using codecs, trying unstructured instead\n") + fmt.Fprintf(os.Stderr, "%v\n", err) + return getUnstructuredObject(data) + } return obj } diff --git a/tests/output/cinder-csi-resources.yaml_basic.go b/tests/output/cinder-csi-resources.yaml_basic.go index 4e2274c..c5859da 100644 --- a/tests/output/cinder-csi-resources.yaml_basic.go +++ b/tests/output/cinder-csi-resources.yaml_basic.go @@ -29,29 +29,29 @@ var ( } // StorageClass "csi-cinder-sc-delete" - csiCinderScDeleteAllowVolumeExpansionTrue bool = true - csiCinderScDeleteReclaimPolicyDelete corev1.PersistentVolumeReclaimPolicy = "Delete" + csiCinderScDeleteStorageClassAllowVolumeExpansionTrue bool = true + csiCinderScDeleteStorageClassReclaimPolicyDelete corev1.PersistentVolumeReclaimPolicy = "Delete" csiCinderScDeleteStorageClass = storagev1.StorageClass{ ObjectMeta: metav1.ObjectMeta{ Name: "csi-cinder-sc-delete", }, Provisioner: "cinder.csi.openstack.org", - ReclaimPolicy: &csiCinderScDeleteReclaimPolicyDelete, - AllowVolumeExpansion: &csiCinderScDeleteAllowVolumeExpansionTrue, + ReclaimPolicy: &csiCinderScDeleteStorageClassReclaimPolicyDelete, + AllowVolumeExpansion: &csiCinderScDeleteStorageClassAllowVolumeExpansionTrue, } // StorageClass "csi-cinder-sc-retain" - csiCinderScRetainAllowVolumeExpansionTrue bool = true - csiCinderScRetainReclaimPolicyRetain corev1.PersistentVolumeReclaimPolicy = "Retain" + csiCinderScRetainStorageClassAllowVolumeExpansionTrue bool = true + csiCinderScRetainStorageClassReclaimPolicyRetain corev1.PersistentVolumeReclaimPolicy = "Retain" csiCinderScRetainStorageClass = storagev1.StorageClass{ ObjectMeta: metav1.ObjectMeta{ Name: "csi-cinder-sc-retain", }, Provisioner: "cinder.csi.openstack.org", - ReclaimPolicy: &csiCinderScRetainReclaimPolicyRetain, - AllowVolumeExpansion: &csiCinderScRetainAllowVolumeExpansionTrue, + ReclaimPolicy: &csiCinderScRetainStorageClassReclaimPolicyRetain, + AllowVolumeExpansion: &csiCinderScRetainStorageClassAllowVolumeExpansionTrue, } // ClusterRole "csi-attacher-role" @@ -554,12 +554,12 @@ var ( } // DaemonSet "openstack-cinder-csi-nodeplugin" - openstackCinderCsiNodepluginAllowPrivilegeEscalationTrue bool = true - openstackCinderCsiNodepluginMountPropagationBidirectional corev1.MountPropagationMode = "Bidirectional" - openstackCinderCsiNodepluginMountPropagationHostToContainer corev1.MountPropagationMode = "HostToContainer" - openstackCinderCsiNodepluginPrivilegedTrue bool = true - openstackCinderCsiNodepluginTypeDirectory corev1.HostPathType = "Directory" - openstackCinderCsiNodepluginTypeDirectoryOrCreate corev1.HostPathType = "DirectoryOrCreate" + openstackCinderCsiNodepluginDaemonSetAllowPrivilegeEscalationTrue bool = true + openstackCinderCsiNodepluginDaemonSetMountPropagationBidirectional corev1.MountPropagationMode = "Bidirectional" + openstackCinderCsiNodepluginDaemonSetMountPropagationHostToContainer corev1.MountPropagationMode = "HostToContainer" + openstackCinderCsiNodepluginDaemonSetPrivilegedTrue bool = true + openstackCinderCsiNodepluginDaemonSetTypeDirectory corev1.HostPathType = "Directory" + openstackCinderCsiNodepluginDaemonSetTypeDirectoryOrCreate corev1.HostPathType = "DirectoryOrCreate" openstackCinderCsiNodepluginDaemonSet = appsv1.DaemonSet{ ObjectMeta: metav1.ObjectMeta{ @@ -597,7 +597,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/var/lib/kubelet/plugins/cinder.csi.openstack.org", - Type: &openstackCinderCsiNodepluginTypeDirectoryOrCreate, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectoryOrCreate, }, }, }, @@ -606,7 +606,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/var/lib/kubelet/plugins_registry/", - Type: &openstackCinderCsiNodepluginTypeDirectory, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectory, }, }, }, @@ -615,7 +615,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/var/lib/kubelet", - Type: &openstackCinderCsiNodepluginTypeDirectory, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectory, }, }, }, @@ -624,7 +624,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/dev", - Type: &openstackCinderCsiNodepluginTypeDirectory, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectory, }, }, }, @@ -750,12 +750,12 @@ var ( corev1.VolumeMount{ Name: "kubelet-dir", MountPath: "/var/lib/kubelet", - MountPropagation: &openstackCinderCsiNodepluginMountPropagationBidirectional, + MountPropagation: &openstackCinderCsiNodepluginDaemonSetMountPropagationBidirectional, }, corev1.VolumeMount{ Name: "pods-probe-dir", MountPath: "/dev", - MountPropagation: &openstackCinderCsiNodepluginMountPropagationHostToContainer, + MountPropagation: &openstackCinderCsiNodepluginDaemonSetMountPropagationHostToContainer, }, corev1.VolumeMount{ Name: "cacert", @@ -791,8 +791,8 @@ var ( "SYS_ADMIN", }, }, - Privileged: &openstackCinderCsiNodepluginPrivilegedTrue, - AllowPrivilegeEscalation: &openstackCinderCsiNodepluginAllowPrivilegeEscalationTrue, + Privileged: &openstackCinderCsiNodepluginDaemonSetPrivilegedTrue, + AllowPrivilegeEscalation: &openstackCinderCsiNodepluginDaemonSetAllowPrivilegeEscalationTrue, }, }, }, @@ -809,7 +809,7 @@ var ( } // StatefulSet "openstack-cinder-csi-controllerplugin" - openstackCinderCsiControllerpluginReplicas1 int32 = 1 + openstackCinderCsiControllerpluginStatefulSetReplicas1 int32 = 1 openstackCinderCsiControllerpluginStatefulSet = appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ @@ -823,7 +823,7 @@ var ( }, }, Spec: appsv1.StatefulSetSpec{ - Replicas: &openstackCinderCsiControllerpluginReplicas1, + Replicas: &openstackCinderCsiControllerpluginStatefulSetReplicas1, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "openstack-cinder-csi", @@ -1057,16 +1057,16 @@ var ( } // CSIDriver "cinder.csi.openstack.org" - cinderCsiOpenstackOrgAttachRequiredTrue bool = true - cinderCsiOpenstackOrgPodInfoOnMountTrue bool = true + cinderCsiOpenstackOrgCSIDriverAttachRequiredTrue bool = true + cinderCsiOpenstackOrgCSIDriverPodInfoOnMountTrue bool = true cinderCsiOpenstackOrgCSIDriver = storagev1.CSIDriver{ ObjectMeta: metav1.ObjectMeta{ Name: "cinder.csi.openstack.org", }, Spec: storagev1.CSIDriverSpec{ - AttachRequired: &cinderCsiOpenstackOrgAttachRequiredTrue, - PodInfoOnMount: &cinderCsiOpenstackOrgPodInfoOnMountTrue, + AttachRequired: &cinderCsiOpenstackOrgCSIDriverAttachRequiredTrue, + PodInfoOnMount: &cinderCsiOpenstackOrgCSIDriverPodInfoOnMountTrue, VolumeLifecycleModes: []storagev1.VolumeLifecycleMode{ "Persistent", "Ephemeral", diff --git a/tests/output/cinder-csi-resources.yaml_boilerplate.go b/tests/output/cinder-csi-resources.yaml_boilerplate.go index edae6a7..e943d7e 100644 --- a/tests/output/cinder-csi-resources.yaml_boilerplate.go +++ b/tests/output/cinder-csi-resources.yaml_boilerplate.go @@ -33,29 +33,29 @@ var ( } // StorageClass "csi-cinder-sc-delete" - csiCinderScDeleteAllowVolumeExpansionTrue bool = true - csiCinderScDeleteReclaimPolicyDelete corev1.PersistentVolumeReclaimPolicy = "Delete" + csiCinderScDeleteStorageClassAllowVolumeExpansionTrue bool = true + csiCinderScDeleteStorageClassReclaimPolicyDelete corev1.PersistentVolumeReclaimPolicy = "Delete" csiCinderScDeleteStorageClass = storagev1.StorageClass{ ObjectMeta: metav1.ObjectMeta{ Name: "csi-cinder-sc-delete", }, Provisioner: "cinder.csi.openstack.org", - ReclaimPolicy: &csiCinderScDeleteReclaimPolicyDelete, - AllowVolumeExpansion: &csiCinderScDeleteAllowVolumeExpansionTrue, + ReclaimPolicy: &csiCinderScDeleteStorageClassReclaimPolicyDelete, + AllowVolumeExpansion: &csiCinderScDeleteStorageClassAllowVolumeExpansionTrue, } // StorageClass "csi-cinder-sc-retain" - csiCinderScRetainAllowVolumeExpansionTrue bool = true - csiCinderScRetainReclaimPolicyRetain corev1.PersistentVolumeReclaimPolicy = "Retain" + csiCinderScRetainStorageClassAllowVolumeExpansionTrue bool = true + csiCinderScRetainStorageClassReclaimPolicyRetain corev1.PersistentVolumeReclaimPolicy = "Retain" csiCinderScRetainStorageClass = storagev1.StorageClass{ ObjectMeta: metav1.ObjectMeta{ Name: "csi-cinder-sc-retain", }, Provisioner: "cinder.csi.openstack.org", - ReclaimPolicy: &csiCinderScRetainReclaimPolicyRetain, - AllowVolumeExpansion: &csiCinderScRetainAllowVolumeExpansionTrue, + ReclaimPolicy: &csiCinderScRetainStorageClassReclaimPolicyRetain, + AllowVolumeExpansion: &csiCinderScRetainStorageClassAllowVolumeExpansionTrue, } // ClusterRole "csi-attacher-role" @@ -558,12 +558,12 @@ var ( } // DaemonSet "openstack-cinder-csi-nodeplugin" - openstackCinderCsiNodepluginAllowPrivilegeEscalationTrue bool = true - openstackCinderCsiNodepluginMountPropagationBidirectional corev1.MountPropagationMode = "Bidirectional" - openstackCinderCsiNodepluginMountPropagationHostToContainer corev1.MountPropagationMode = "HostToContainer" - openstackCinderCsiNodepluginPrivilegedTrue bool = true - openstackCinderCsiNodepluginTypeDirectory corev1.HostPathType = "Directory" - openstackCinderCsiNodepluginTypeDirectoryOrCreate corev1.HostPathType = "DirectoryOrCreate" + openstackCinderCsiNodepluginDaemonSetAllowPrivilegeEscalationTrue bool = true + openstackCinderCsiNodepluginDaemonSetMountPropagationBidirectional corev1.MountPropagationMode = "Bidirectional" + openstackCinderCsiNodepluginDaemonSetMountPropagationHostToContainer corev1.MountPropagationMode = "HostToContainer" + openstackCinderCsiNodepluginDaemonSetPrivilegedTrue bool = true + openstackCinderCsiNodepluginDaemonSetTypeDirectory corev1.HostPathType = "Directory" + openstackCinderCsiNodepluginDaemonSetTypeDirectoryOrCreate corev1.HostPathType = "DirectoryOrCreate" openstackCinderCsiNodepluginDaemonSet = appsv1.DaemonSet{ ObjectMeta: metav1.ObjectMeta{ @@ -601,7 +601,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/var/lib/kubelet/plugins/cinder.csi.openstack.org", - Type: &openstackCinderCsiNodepluginTypeDirectoryOrCreate, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectoryOrCreate, }, }, }, @@ -610,7 +610,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/var/lib/kubelet/plugins_registry/", - Type: &openstackCinderCsiNodepluginTypeDirectory, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectory, }, }, }, @@ -619,7 +619,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/var/lib/kubelet", - Type: &openstackCinderCsiNodepluginTypeDirectory, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectory, }, }, }, @@ -628,7 +628,7 @@ var ( VolumeSource: corev1.VolumeSource{ HostPath: &corev1.HostPathVolumeSource{ Path: "/dev", - Type: &openstackCinderCsiNodepluginTypeDirectory, + Type: &openstackCinderCsiNodepluginDaemonSetTypeDirectory, }, }, }, @@ -754,12 +754,12 @@ var ( corev1.VolumeMount{ Name: "kubelet-dir", MountPath: "/var/lib/kubelet", - MountPropagation: &openstackCinderCsiNodepluginMountPropagationBidirectional, + MountPropagation: &openstackCinderCsiNodepluginDaemonSetMountPropagationBidirectional, }, corev1.VolumeMount{ Name: "pods-probe-dir", MountPath: "/dev", - MountPropagation: &openstackCinderCsiNodepluginMountPropagationHostToContainer, + MountPropagation: &openstackCinderCsiNodepluginDaemonSetMountPropagationHostToContainer, }, corev1.VolumeMount{ Name: "cacert", @@ -795,8 +795,8 @@ var ( "SYS_ADMIN", }, }, - Privileged: &openstackCinderCsiNodepluginPrivilegedTrue, - AllowPrivilegeEscalation: &openstackCinderCsiNodepluginAllowPrivilegeEscalationTrue, + Privileged: &openstackCinderCsiNodepluginDaemonSetPrivilegedTrue, + AllowPrivilegeEscalation: &openstackCinderCsiNodepluginDaemonSetAllowPrivilegeEscalationTrue, }, }, }, @@ -813,7 +813,7 @@ var ( } // StatefulSet "openstack-cinder-csi-controllerplugin" - openstackCinderCsiControllerpluginReplicas1 int32 = 1 + openstackCinderCsiControllerpluginStatefulSetReplicas1 int32 = 1 openstackCinderCsiControllerpluginStatefulSet = appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{ @@ -827,7 +827,7 @@ var ( }, }, Spec: appsv1.StatefulSetSpec{ - Replicas: &openstackCinderCsiControllerpluginReplicas1, + Replicas: &openstackCinderCsiControllerpluginStatefulSetReplicas1, Selector: &metav1.LabelSelector{ MatchLabels: map[string]string{ "app": "openstack-cinder-csi", @@ -1061,16 +1061,16 @@ var ( } // CSIDriver "cinder.csi.openstack.org" - cinderCsiOpenstackOrgAttachRequiredTrue bool = true - cinderCsiOpenstackOrgPodInfoOnMountTrue bool = true + cinderCsiOpenstackOrgCSIDriverAttachRequiredTrue bool = true + cinderCsiOpenstackOrgCSIDriverPodInfoOnMountTrue bool = true cinderCsiOpenstackOrgCSIDriver = storagev1.CSIDriver{ ObjectMeta: metav1.ObjectMeta{ Name: "cinder.csi.openstack.org", }, Spec: storagev1.CSIDriverSpec{ - AttachRequired: &cinderCsiOpenstackOrgAttachRequiredTrue, - PodInfoOnMount: &cinderCsiOpenstackOrgPodInfoOnMountTrue, + AttachRequired: &cinderCsiOpenstackOrgCSIDriverAttachRequiredTrue, + PodInfoOnMount: &cinderCsiOpenstackOrgCSIDriverPodInfoOnMountTrue, VolumeLifecycleModes: []storagev1.VolumeLifecycleMode{ "Persistent", "Ephemeral", diff --git a/tests/output/cinder-csi-resources.yaml_unstructured.go b/tests/output/cinder-csi-resources.yaml_unstructured.go index a236a9c..ecf70c3 100644 --- a/tests/output/cinder-csi-resources.yaml_unstructured.go +++ b/tests/output/cinder-csi-resources.yaml_unstructured.go @@ -32,7 +32,7 @@ var ( // Unstructured "csi-cinder-sc-delete" csiCinderScDeleteUnstructuredStorageClass = v1unstructured.Unstructured{ Object: map[string]interface{}{ - "allowVolumeExpansion": "true", + "allowVolumeExpansion": true, "apiVersion": "storage.k8s.io/v1", "kind": "StorageClass", "metadata": map[string]interface{}{ @@ -46,7 +46,7 @@ var ( // Unstructured "csi-cinder-sc-retain" csiCinderScRetainUnstructuredStorageClass = v1unstructured.Unstructured{ Object: map[string]interface{}{ - "allowVolumeExpansion": "true", + "allowVolumeExpansion": true, "apiVersion": "storage.k8s.io/v1", "kind": "StorageClass", "metadata": map[string]interface{}{ @@ -65,7 +65,49 @@ var ( "metadata": map[string]interface{}{ "name": "csi-attacher-role", }, - "rules": "[map[apiGroups:[] resources:[persistentvolumes] verbs:[get list watch patch]] map[apiGroups:[storage.k8s.io] resources:[csinodes] verbs:[get list watch]] map[apiGroups:[storage.k8s.io] resources:[volumeattachments] verbs:[get list watch patch]] map[apiGroups:[storage.k8s.io] resources:[volumeattachments/status] verbs:[patch]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumes", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "csinodes", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "volumeattachments", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "volumeattachments/status", + }, + "verbs": []interface{}{ + "patch", + }, + }, + }, }, } @@ -77,7 +119,89 @@ var ( "metadata": map[string]interface{}{ "name": "csi-provisioner-role", }, - "rules": "[map[apiGroups:[] resources:[persistentvolumes] verbs:[get list watch create delete]] map[apiGroups:[] resources:[persistentvolumeclaims] verbs:[get list watch update]] map[apiGroups:[storage.k8s.io] resources:[storageclasses] verbs:[get list watch]] map[apiGroups:[] resources:[nodes] verbs:[get list watch]] map[apiGroups:[storage.k8s.io] resources:[csinodes] verbs:[get list watch]] map[apiGroups:[] resources:[events] verbs:[list watch create update patch]] map[apiGroups:[snapshot.storage.k8s.io] resources:[volumesnapshots] verbs:[get list]] map[apiGroups:[snapshot.storage.k8s.io] resources:[volumesnapshotcontents] verbs:[get list]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumes", + }, + "verbs": []interface{}{ + "get", "list", "watch", "create", "delete", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumeclaims", + }, + "verbs": []interface{}{ + "get", "list", "watch", "update", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "storageclasses", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "nodes", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "csinodes", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "events", + }, + "verbs": []interface{}{ + "list", "watch", "create", "update", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "snapshot.storage.k8s.io", + }, + "resources": []interface{}{ + "volumesnapshots", + }, + "verbs": []interface{}{ + "get", "list", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "snapshot.storage.k8s.io", + }, + "resources": []interface{}{ + "volumesnapshotcontents", + }, + "verbs": []interface{}{ + "get", "list", + }, + }, + }, }, } @@ -89,7 +213,49 @@ var ( "metadata": map[string]interface{}{ "name": "csi-snapshotter-role", }, - "rules": "[map[apiGroups:[] resources:[events] verbs:[list watch create update patch]] map[apiGroups:[snapshot.storage.k8s.io] resources:[volumesnapshotclasses] verbs:[get list watch]] map[apiGroups:[snapshot.storage.k8s.io] resources:[volumesnapshotcontents] verbs:[create get list watch update delete]] map[apiGroups:[snapshot.storage.k8s.io] resources:[volumesnapshotcontents/status] verbs:[update]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "events", + }, + "verbs": []interface{}{ + "list", "watch", "create", "update", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "snapshot.storage.k8s.io", + }, + "resources": []interface{}{ + "volumesnapshotclasses", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "snapshot.storage.k8s.io", + }, + "resources": []interface{}{ + "volumesnapshotcontents", + }, + "verbs": []interface{}{ + "create", "get", "list", "watch", "update", "delete", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "snapshot.storage.k8s.io", + }, + "resources": []interface{}{ + "volumesnapshotcontents/status", + }, + "verbs": []interface{}{ + "update", + }, + }, + }, }, } @@ -101,7 +267,59 @@ var ( "metadata": map[string]interface{}{ "name": "csi-resizer-role", }, - "rules": "[map[apiGroups:[] resources:[persistentvolumes] verbs:[get list watch patch]] map[apiGroups:[] resources:[persistentvolumeclaims] verbs:[get list watch]] map[apiGroups:[] resources:[pods] verbs:[get list watch]] map[apiGroups:[] resources:[persistentvolumeclaims/status] verbs:[patch]] map[apiGroups:[] resources:[events] verbs:[list watch create update patch]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumes", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumeclaims", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "pods", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumeclaims/status", + }, + "verbs": []interface{}{ + "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "events", + }, + "verbs": []interface{}{ + "list", "watch", "create", "update", "patch", + }, + }, + }, }, } @@ -113,7 +331,19 @@ var ( "metadata": map[string]interface{}{ "name": "csi-nodeplugin-role", }, - "rules": "[map[apiGroups:[] resources:[events] verbs:[get list watch create update patch]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "events", + }, + "verbs": []interface{}{ + "get", "list", "watch", "create", "update", "patch", + }, + }, + }, }, } @@ -130,7 +360,13 @@ var ( "kind": "ClusterRole", "name": "csi-attacher-role", }, - "subjects": "[map[kind:ServiceAccount name:csi-cinder-controller-sa namespace:kube-system]]", + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "csi-cinder-controller-sa", + "namespace": "kube-system", + }, + }, }, } @@ -147,7 +383,13 @@ var ( "kind": "ClusterRole", "name": "csi-provisioner-role", }, - "subjects": "[map[kind:ServiceAccount name:csi-cinder-controller-sa namespace:kube-system]]", + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "csi-cinder-controller-sa", + "namespace": "kube-system", + }, + }, }, } @@ -164,7 +406,13 @@ var ( "kind": "ClusterRole", "name": "csi-snapshotter-role", }, - "subjects": "[map[kind:ServiceAccount name:csi-cinder-controller-sa namespace:kube-system]]", + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "csi-cinder-controller-sa", + "namespace": "kube-system", + }, + }, }, } @@ -181,7 +429,13 @@ var ( "kind": "ClusterRole", "name": "csi-resizer-role", }, - "subjects": "[map[kind:ServiceAccount name:csi-cinder-controller-sa namespace:kube-system]]", + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "csi-cinder-controller-sa", + "namespace": "kube-system", + }, + }, }, } @@ -198,7 +452,13 @@ var ( "kind": "ClusterRole", "name": "csi-nodeplugin-role", }, - "subjects": "[map[kind:ServiceAccount name:csi-cinder-node-sa namespace:kube-system]]", + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "csi-cinder-node-sa", + "namespace": "kube-system", + }, + }, }, } @@ -211,7 +471,19 @@ var ( "name": "external-resizer-cfg", "namespace": "kube-system", }, - "rules": "[map[apiGroups:[coordination.k8s.io] resources:[leases] verbs:[get watch list delete update create]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "coordination.k8s.io", + }, + "resources": []interface{}{ + "leases", + }, + "verbs": []interface{}{ + "get", "watch", "list", "delete", "update", "create", + }, + }, + }, }, } @@ -229,7 +501,13 @@ var ( "kind": "Role", "name": "external-resizer-cfg", }, - "subjects": "[map[kind:ServiceAccount name:csi-cinder-controller-sa namespace:kube-system]]", + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "csi-cinder-controller-sa", + "namespace": "kube-system", + }, + }, }, } @@ -288,11 +566,178 @@ var ( }, }, "spec": map[string]interface{}{ - "containers": "[map[args:[--csi-address=$(ADDRESS) --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)] env:[map[name:ADDRESS value:/csi/csi.sock] map[name:DRIVER_REG_SOCK_PATH value:/var/lib/kubelet/plugins/cinder.csi.openstack.org/csi.sock] map[name:KUBE_NODE_NAME valueFrom:map[fieldRef:map[fieldPath:spec.nodeName]]]] image:k8s.gcr.io/sig-storage/csi-node-driver-registrar:v1.3.0 imagePullPolicy:IfNotPresent lifecycle:map[preStop:map[exec:map[command:[/bin/sh -c rm -rf /registration/cinder.csi.openstack.org /registration/cinder.csi.openstack.org-reg.sock]]]] name:node-driver-registrar volumeMounts:[map[mountPath:/csi name:socket-dir] map[mountPath:/registration name:registration-dir]]] map[args:[--csi-address=/csi/csi.sock] image:k8s.gcr.io/sig-storage/livenessprobe:v2.1.0 imagePullPolicy:IfNotPresent name:liveness-probe volumeMounts:[map[mountPath:/csi name:socket-dir]]] map[args:[/bin/cinder-csi-plugin --nodeid=$(NODE_ID) --endpoint=$(CSI_ENDPOINT) --cloud-config=$(CLOUD_CONFIG)] env:[map[name:NODE_ID valueFrom:map[fieldRef:map[fieldPath:spec.nodeName]]] map[name:CSI_ENDPOINT value:unix://csi/csi.sock] map[name:CLOUD_CONFIG value:/etc/kubernetes/cloud-config]] image:docker.io/k8scloudprovider/cinder-csi-plugin:v1.21.0 imagePullPolicy:IfNotPresent livenessProbe:map[failureThreshold:5 httpGet:map[path:/healthz port:healthz] initialDelaySeconds:10 periodSeconds:60 timeoutSeconds:10] name:cinder-csi-plugin ports:[map[containerPort:9808 name:healthz protocol:TCP]] securityContext:map[allowPrivilegeEscalation:true capabilities:map[add:[SYS_ADMIN]] privileged:true] volumeMounts:[map[mountPath:/csi name:socket-dir] map[mountPath:/var/lib/kubelet mountPropagation:Bidirectional name:kubelet-dir] map[mountPath:/dev mountPropagation:HostToContainer name:pods-probe-dir] map[mountPath:/etc/cacert name:cacert readOnly:true] map[mountPath:/etc/kubernetes name:cloud-config readOnly:true]]]]", - "hostNetwork": "true", + "containers": []interface{}{ + map[string]interface{}{ + "args": []interface{}{ + "--csi-address=$(ADDRESS)", "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "ADDRESS", + "value": "/csi/csi.sock", + }, map[string]interface{}{ + "name": "DRIVER_REG_SOCK_PATH", + "value": "/var/lib/kubelet/plugins/cinder.csi.openstack.org/csi.sock", + }, map[string]interface{}{ + "name": "KUBE_NODE_NAME", + "valueFrom": map[string]interface{}{ + "fieldRef": map[string]interface{}{ + "fieldPath": "spec.nodeName", + }, + }, + }, + }, + "image": "k8s.gcr.io/sig-storage/csi-node-driver-registrar:v1.3.0", + "imagePullPolicy": "IfNotPresent", + "lifecycle": map[string]interface{}{ + "preStop": map[string]interface{}{ + "exec": map[string]interface{}{ + "command": []interface{}{ + "/bin/sh", "-c", "rm -rf /registration/cinder.csi.openstack.org /registration/cinder.csi.openstack.org-reg.sock", + }, + }, + }, + }, + "name": "node-driver-registrar", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/csi", + "name": "socket-dir", + }, map[string]interface{}{ + "mountPath": "/registration", + "name": "registration-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "--csi-address=/csi/csi.sock", + }, + "image": "k8s.gcr.io/sig-storage/livenessprobe:v2.1.0", + "imagePullPolicy": "IfNotPresent", + "name": "liveness-probe", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/csi", + "name": "socket-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "/bin/cinder-csi-plugin", "--nodeid=$(NODE_ID)", "--endpoint=$(CSI_ENDPOINT)", "--cloud-config=$(CLOUD_CONFIG)", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "NODE_ID", + "valueFrom": map[string]interface{}{ + "fieldRef": map[string]interface{}{ + "fieldPath": "spec.nodeName", + }, + }, + }, map[string]interface{}{ + "name": "CSI_ENDPOINT", + "value": "unix://csi/csi.sock", + }, map[string]interface{}{ + "name": "CLOUD_CONFIG", + "value": "/etc/kubernetes/cloud-config", + }, + }, + "image": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.21.0", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": map[string]interface{}{ + "failureThreshold": 5, + "httpGet": map[string]interface{}{ + "path": "/healthz", + "port": "healthz", + }, + "initialDelaySeconds": 10, + "periodSeconds": 60, + "timeoutSeconds": 10, + }, + "name": "cinder-csi-plugin", + "ports": []interface{}{ + map[string]interface{}{ + "containerPort": 9808, + "name": "healthz", + "protocol": "TCP", + }, + }, + "securityContext": map[string]interface{}{ + "allowPrivilegeEscalation": true, + "capabilities": map[string]interface{}{ + "add": []interface{}{ + "SYS_ADMIN", + }, + }, + "privileged": true, + }, + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/csi", + "name": "socket-dir", + }, map[string]interface{}{ + "mountPath": "/var/lib/kubelet", + "mountPropagation": "Bidirectional", + "name": "kubelet-dir", + }, map[string]interface{}{ + "mountPath": "/dev", + "mountPropagation": "HostToContainer", + "name": "pods-probe-dir", + }, map[string]interface{}{ + "mountPath": "/etc/cacert", + "name": "cacert", + "readOnly": true, + }, map[string]interface{}{ + "mountPath": "/etc/kubernetes", + "name": "cloud-config", + "readOnly": true, + }, + }, + }, + }, + "hostNetwork": true, "serviceAccount": "csi-cinder-node-sa", - "tolerations": "[map[operator:Exists]]", - "volumes": "[map[hostPath:map[path:/var/lib/kubelet/plugins/cinder.csi.openstack.org type:DirectoryOrCreate] name:socket-dir] map[hostPath:map[path:/var/lib/kubelet/plugins_registry/ type:Directory] name:registration-dir] map[hostPath:map[path:/var/lib/kubelet type:Directory] name:kubelet-dir] map[hostPath:map[path:/dev type:Directory] name:pods-probe-dir] map[hostPath:map[path:/etc/kubernetes] name:cloud-config] map[hostPath:map[path:/etc/cacert] name:cacert]]", + "tolerations": []interface{}{ + map[string]interface{}{ + "operator": "Exists", + }, + }, + "volumes": []interface{}{ + map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/var/lib/kubelet/plugins/cinder.csi.openstack.org", + "type": "DirectoryOrCreate", + }, + "name": "socket-dir", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/var/lib/kubelet/plugins_registry/", + "type": "Directory", + }, + "name": "registration-dir", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/var/lib/kubelet", + "type": "Directory", + }, + "name": "kubelet-dir", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/dev", + "type": "Directory", + }, + "name": "pods-probe-dir", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/etc/kubernetes", + }, + "name": "cloud-config", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/etc/cacert", + }, + "name": "cacert", + }, + }, }, }, }, @@ -315,7 +760,7 @@ var ( "name": "openstack-cinder-csi-controllerplugin", }, "spec": map[string]interface{}{ - "replicas": "1", + "replicas": 1, "selector": map[string]interface{}{ "matchLabels": map[string]interface{}{ "app": "openstack-cinder-csi", @@ -335,9 +780,177 @@ var ( }, }, "spec": map[string]interface{}{ - "containers": "[map[args:[--csi-address=$(ADDRESS) --timeout=3m] env:[map[name:ADDRESS value:/var/lib/csi/sockets/pluginproxy/csi.sock]] image:k8s.gcr.io/sig-storage/csi-attacher:v3.1.0 imagePullPolicy:IfNotPresent name:csi-attacher volumeMounts:[map[mountPath:/var/lib/csi/sockets/pluginproxy/ name:socket-dir]]] map[args:[--csi-address=$(ADDRESS) --timeout=3m --default-fstype=ext4 --feature-gates=Topology=true --extra-create-metadata] env:[map[name:ADDRESS value:/var/lib/csi/sockets/pluginproxy/csi.sock]] image:k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 imagePullPolicy:IfNotPresent name:csi-provisioner volumeMounts:[map[mountPath:/var/lib/csi/sockets/pluginproxy/ name:socket-dir]]] map[args:[--csi-address=$(ADDRESS) --timeout=3m] env:[map[name:ADDRESS value:/var/lib/csi/sockets/pluginproxy/csi.sock]] image:k8s.gcr.io/sig-storage/csi-snapshotter:v2.1.3 imagePullPolicy:IfNotPresent name:csi-snapshotter volumeMounts:[map[mountPath:/var/lib/csi/sockets/pluginproxy/ name:socket-dir]]] map[args:[--csi-address=$(ADDRESS) --timeout=3m --handle-volume-inuse-error=false] env:[map[name:ADDRESS value:/var/lib/csi/sockets/pluginproxy/csi.sock]] image:k8s.gcr.io/sig-storage/csi-resizer:v1.1.0 imagePullPolicy:IfNotPresent name:csi-resizer volumeMounts:[map[mountPath:/var/lib/csi/sockets/pluginproxy/ name:socket-dir]]] map[args:[--csi-address=$(ADDRESS)] env:[map[name:ADDRESS value:/var/lib/csi/sockets/pluginproxy/csi.sock]] image:k8s.gcr.io/sig-storage/livenessprobe:v2.1.0 imagePullPolicy:IfNotPresent name:liveness-probe volumeMounts:[map[mountPath:/var/lib/csi/sockets/pluginproxy/ name:socket-dir]]] map[args:[/bin/cinder-csi-plugin --nodeid=$(NODE_ID) --endpoint=$(CSI_ENDPOINT) --cloud-config=$(CLOUD_CONFIG) --cluster=$(CLUSTER_NAME)] env:[map[name:NODE_ID valueFrom:map[fieldRef:map[fieldPath:spec.nodeName]]] map[name:CSI_ENDPOINT value:unix://csi/csi.sock] map[name:CLOUD_CONFIG value:/etc/kubernetes/cloud-config] map[name:CLUSTER_NAME value:kubernetes]] image:docker.io/k8scloudprovider/cinder-csi-plugin:v1.21.0 imagePullPolicy:IfNotPresent livenessProbe:map[failureThreshold:5 httpGet:map[path:/healthz port:healthz] initialDelaySeconds:10 periodSeconds:60 timeoutSeconds:10] name:cinder-csi-plugin ports:[map[containerPort:9808 name:healthz protocol:TCP]] volumeMounts:[map[mountPath:/csi name:socket-dir] map[mountPath:/etc/cacert name:cacert readOnly:true] map[mountPath:/etc/kubernetes name:cloud-config readOnly:true]]]]", + "containers": []interface{}{ + map[string]interface{}{ + "args": []interface{}{ + "--csi-address=$(ADDRESS)", "--timeout=3m", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "ADDRESS", + "value": "/var/lib/csi/sockets/pluginproxy/csi.sock", + }, + }, + "image": "k8s.gcr.io/sig-storage/csi-attacher:v3.1.0", + "imagePullPolicy": "IfNotPresent", + "name": "csi-attacher", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/var/lib/csi/sockets/pluginproxy/", + "name": "socket-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "--csi-address=$(ADDRESS)", "--timeout=3m", "--default-fstype=ext4", "--feature-gates=Topology=true", "--extra-create-metadata", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "ADDRESS", + "value": "/var/lib/csi/sockets/pluginproxy/csi.sock", + }, + }, + "image": "k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1", + "imagePullPolicy": "IfNotPresent", + "name": "csi-provisioner", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/var/lib/csi/sockets/pluginproxy/", + "name": "socket-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "--csi-address=$(ADDRESS)", "--timeout=3m", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "ADDRESS", + "value": "/var/lib/csi/sockets/pluginproxy/csi.sock", + }, + }, + "image": "k8s.gcr.io/sig-storage/csi-snapshotter:v2.1.3", + "imagePullPolicy": "IfNotPresent", + "name": "csi-snapshotter", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/var/lib/csi/sockets/pluginproxy/", + "name": "socket-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "--csi-address=$(ADDRESS)", "--timeout=3m", "--handle-volume-inuse-error=false", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "ADDRESS", + "value": "/var/lib/csi/sockets/pluginproxy/csi.sock", + }, + }, + "image": "k8s.gcr.io/sig-storage/csi-resizer:v1.1.0", + "imagePullPolicy": "IfNotPresent", + "name": "csi-resizer", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/var/lib/csi/sockets/pluginproxy/", + "name": "socket-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "--csi-address=$(ADDRESS)", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "ADDRESS", + "value": "/var/lib/csi/sockets/pluginproxy/csi.sock", + }, + }, + "image": "k8s.gcr.io/sig-storage/livenessprobe:v2.1.0", + "imagePullPolicy": "IfNotPresent", + "name": "liveness-probe", + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/var/lib/csi/sockets/pluginproxy/", + "name": "socket-dir", + }, + }, + }, map[string]interface{}{ + "args": []interface{}{ + "/bin/cinder-csi-plugin", "--nodeid=$(NODE_ID)", "--endpoint=$(CSI_ENDPOINT)", "--cloud-config=$(CLOUD_CONFIG)", "--cluster=$(CLUSTER_NAME)", + }, + "env": []interface{}{ + map[string]interface{}{ + "name": "NODE_ID", + "valueFrom": map[string]interface{}{ + "fieldRef": map[string]interface{}{ + "fieldPath": "spec.nodeName", + }, + }, + }, map[string]interface{}{ + "name": "CSI_ENDPOINT", + "value": "unix://csi/csi.sock", + }, map[string]interface{}{ + "name": "CLOUD_CONFIG", + "value": "/etc/kubernetes/cloud-config", + }, map[string]interface{}{ + "name": "CLUSTER_NAME", + "value": "kubernetes", + }, + }, + "image": "docker.io/k8scloudprovider/cinder-csi-plugin:v1.21.0", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": map[string]interface{}{ + "failureThreshold": 5, + "httpGet": map[string]interface{}{ + "path": "/healthz", + "port": "healthz", + }, + "initialDelaySeconds": 10, + "periodSeconds": 60, + "timeoutSeconds": 10, + }, + "name": "cinder-csi-plugin", + "ports": []interface{}{ + map[string]interface{}{ + "containerPort": 9808, + "name": "healthz", + "protocol": "TCP", + }, + }, + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/csi", + "name": "socket-dir", + }, map[string]interface{}{ + "mountPath": "/etc/cacert", + "name": "cacert", + "readOnly": true, + }, map[string]interface{}{ + "mountPath": "/etc/kubernetes", + "name": "cloud-config", + "readOnly": true, + }, + }, + }, + }, "serviceAccount": "csi-cinder-controller-sa", - "volumes": "[map[emptyDir: name:socket-dir] map[hostPath:map[path:/etc/kubernetes] name:cloud-config] map[hostPath:map[path:/etc/cacert] name:cacert]]", + "volumes": []interface{}{ + map[string]interface{}{ + "name": "socket-dir", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/etc/kubernetes", + }, + "name": "cloud-config", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/etc/cacert", + }, + "name": "cacert", + }, + }, }, }, }, @@ -353,9 +966,11 @@ var ( "name": "cinder.csi.openstack.org", }, "spec": map[string]interface{}{ - "attachRequired": "true", - "podInfoOnMount": "true", - "volumeLifecycleModes": "[Persistent Ephemeral]", + "attachRequired": true, + "podInfoOnMount": true, + "volumeLifecycleModes": []interface{}{ + "Persistent", "Ephemeral", + }, }, }, } diff --git a/tests/output/clusterrole.yaml_unstructured.go b/tests/output/clusterrole.yaml_unstructured.go index 5ec9105..0c0b5f5 100644 --- a/tests/output/clusterrole.yaml_unstructured.go +++ b/tests/output/clusterrole.yaml_unstructured.go @@ -11,6 +11,48 @@ var clusterRoleUnstructuredClusterRole = v1unstructured.Unstructured{ "metadata": map[string]interface{}{ "name": "cluster-role", }, - "rules": "[map[apiGroups:[] resources:[persistentvolumes] verbs:[get list watch patch]] map[apiGroups:[storage.k8s.io] resources:[csinodes] verbs:[get list watch]] map[apiGroups:[storage.k8s.io] resources:[volumeattachments] verbs:[get list watch patch]] map[apiGroups:[storage.k8s.io] resources:[volumeattachments/status] verbs:[patch]]]", + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "persistentvolumes", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "csinodes", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "volumeattachments", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "storage.k8s.io", + }, + "resources": []interface{}{ + "volumeattachments/status", + }, + "verbs": []interface{}{ + "patch", + }, + }, + }, }, } diff --git a/tests/output/emptydir.yaml_unstructured.go b/tests/output/emptydir.yaml_unstructured.go index 6392b4e..d721548 100644 --- a/tests/output/emptydir.yaml_unstructured.go +++ b/tests/output/emptydir.yaml_unstructured.go @@ -14,7 +14,21 @@ var emptydirSampleUnstructuredStatefulSet = v1unstructured.Unstructured{ "spec": map[string]interface{}{ "template": map[string]interface{}{ "spec": map[string]interface{}{ - "volumes": "[map[emptyDir: name:socket-dir] map[hostPath:map[path:/etc/kubernetes] name:cloud-config] map[hostPath:map[path:/etc/cacert] name:cacert]]", + "volumes": []interface{}{ + map[string]interface{}{ + "name": "socket-dir", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/etc/kubernetes", + }, + "name": "cloud-config", + }, map[string]interface{}{ + "hostPath": map[string]interface{}{ + "path": "/etc/cacert", + }, + "name": "cacert", + }, + }, }, }, }, diff --git a/tests/output/ns_and_pv.yaml_basic.go b/tests/output/ns_and_pv.yaml_basic.go index b7c20ec..e2c02af 100644 --- a/tests/output/ns_and_pv.yaml_basic.go +++ b/tests/output/ns_and_pv.yaml_basic.go @@ -19,7 +19,7 @@ var ( } // PersistentVolume "pv0004" - pv0004VolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" + pv0004PersistentVolumeVolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" pv0004PersistentVolume = corev1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -44,7 +44,7 @@ var ( "hard", "nfsvers=4.1", }, - VolumeMode: &pv0004VolumeModeFilesystem, + VolumeMode: &pv0004PersistentVolumeVolumeModeFilesystem, }, } ) diff --git a/tests/output/ns_and_pv.yaml_boilerplate.go b/tests/output/ns_and_pv.yaml_boilerplate.go index c4bc347..f5863d6 100644 --- a/tests/output/ns_and_pv.yaml_boilerplate.go +++ b/tests/output/ns_and_pv.yaml_boilerplate.go @@ -23,7 +23,7 @@ var ( } // PersistentVolume "pv0004" - pv0004VolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" + pv0004PersistentVolumeVolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" pv0004PersistentVolume = corev1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -48,7 +48,7 @@ var ( "hard", "nfsvers=4.1", }, - VolumeMode: &pv0004VolumeModeFilesystem, + VolumeMode: &pv0004PersistentVolumeVolumeModeFilesystem, }, } ) diff --git a/tests/output/ns_and_pv.yaml_unstructured.go b/tests/output/ns_and_pv.yaml_unstructured.go index bd751b2..eaa060b 100644 --- a/tests/output/ns_and_pv.yaml_unstructured.go +++ b/tests/output/ns_and_pv.yaml_unstructured.go @@ -27,11 +27,15 @@ var ( "name": "pv0004", }, "spec": map[string]interface{}{ - "accessModes": "[ReadWriteOnce]", + "accessModes": []interface{}{ + "ReadWriteOnce", + }, "capacity": map[string]interface{}{ "storage": "5Gi", }, - "mountOptions": "[hard nfsvers=4.1]", + "mountOptions": []interface{}{ + "hard", "nfsvers=4.1", + }, "nfs": map[string]interface{}{ "path": "/tmp", "server": "172.17.0.2", diff --git a/tests/output/pv.yaml_basic.go b/tests/output/pv.yaml_basic.go index 9baafb9..feb3d7b 100644 --- a/tests/output/pv.yaml_basic.go +++ b/tests/output/pv.yaml_basic.go @@ -10,7 +10,7 @@ import ( var ( // PersistentVolume "pv0003" - pv0003VolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" + pv0003PersistentVolumeVolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" pv0003PersistentVolume = corev1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -35,7 +35,7 @@ var ( "hard", "nfsvers=4.1", }, - VolumeMode: &pv0003VolumeModeFilesystem, + VolumeMode: &pv0003PersistentVolumeVolumeModeFilesystem, }, } ) diff --git a/tests/output/pv.yaml_boilerplate.go b/tests/output/pv.yaml_boilerplate.go index 3ce8699..5e00a8d 100644 --- a/tests/output/pv.yaml_boilerplate.go +++ b/tests/output/pv.yaml_boilerplate.go @@ -14,7 +14,7 @@ import ( var ( // PersistentVolume "pv0003" - pv0003VolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" + pv0003PersistentVolumeVolumeModeFilesystem corev1.PersistentVolumeMode = "Filesystem" pv0003PersistentVolume = corev1.PersistentVolume{ ObjectMeta: metav1.ObjectMeta{ @@ -39,7 +39,7 @@ var ( "hard", "nfsvers=4.1", }, - VolumeMode: &pv0003VolumeModeFilesystem, + VolumeMode: &pv0003PersistentVolumeVolumeModeFilesystem, }, } ) diff --git a/tests/output/pv.yaml_unstructured.go b/tests/output/pv.yaml_unstructured.go index 3e5182e..5ba2e6c 100644 --- a/tests/output/pv.yaml_unstructured.go +++ b/tests/output/pv.yaml_unstructured.go @@ -12,11 +12,15 @@ var pv0003UnstructuredPersistentVolume = v1unstructured.Unstructured{ "name": "pv0003", }, "spec": map[string]interface{}{ - "accessModes": "[ReadWriteOnce]", + "accessModes": []interface{}{ + "ReadWriteOnce", + }, "capacity": map[string]interface{}{ "storage": "5Gi", }, - "mountOptions": "[hard nfsvers=4.1]", + "mountOptions": []interface{}{ + "hard", "nfsvers=4.1", + }, "nfs": map[string]interface{}{ "path": "/tmp", "server": "172.17.0.2", diff --git a/tests/output/service-catalog-addons.yaml_basic.go b/tests/output/service-catalog-addons.yaml_basic.go new file mode 100644 index 0000000..d51e8c8 --- /dev/null +++ b/tests/output/service-catalog-addons.yaml_basic.go @@ -0,0 +1,766 @@ +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import ( + appsv1 "k8s.io/api/apps/v1" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + rbacv1 "k8s.io/api/rbac/v1" + apiresource "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + utilintstr "k8s.io/apimachinery/pkg/util/intstr" +) + +var ( + // Job "service-catalog-addons-service-binding-usage-controller-cleanup" + serviceCatalogAddonsServiceBindingUsageControllerCleanupJobBackoffLimit1 int32 = 1 + + serviceCatalogAddonsServiceBindingUsageControllerCleanupJob = batchv1.Job{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller-cleanup", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "helm.sh/hook": "pre-delete", + "helm.sh/hook-delete-policy": "before-hook-creation, hook-succeeded", + "helm.sh/hook-weight": "1", + }, + }, + Spec: batchv1.JobSpec{ + BackoffLimit: &serviceCatalogAddonsServiceBindingUsageControllerCleanupJobBackoffLimit1, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Annotations: map[string]string{ + "sidecar.istio.io/inject": "false", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + corev1.Container{ + Name: "job", + Image: "eu.gcr.io/kyma-project/tpi/k8s-tools:20211022-85284bf9", + Command: []string{ + "bash", + "-c", + "MAX_RETRIES=60\ncnt=0\n\nkubectl delete usagekinds.servicecatalog.kyma-project.io deployment > /dev/null 2>&1\n\nwhile :\n do\n kubectl get usagekinds.servicecatalog.kyma-project.io deployment -o=jsonpath='{.metadata.name}' > /dev/null 2>&1\n if [[ $? -eq \"deployment\" ]]; then\n ((cnt++))\n if (( cnt > $MAX_RETRIES )); then\n echo \"Max retries has been reached (retries $MAX_RETRIES). Exit.\"\n exit 1\n fi\n\n echo \"Removing usagekinds deployment...\"\n sleep 1\n else\n echo \"usagekinds deployment has been removed\"\n break\n fi\ndone", + }, + }, + }, + RestartPolicy: "Never", + ServiceAccountName: "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + } + + // PodSecurityPolicy "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiPodSecurityPolicyAllowPrivilegeEscalationFalse bool = false + + serviceCatalogAddonsServiceCatalogUiPodSecurityPolicy = policyv1beta1.PodSecurityPolicy{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + Spec: policyv1beta1.PodSecurityPolicySpec{ + Privileged: false, + Volumes: []policyv1beta1.FSType{ + "emptyDir", + "configMap", + }, + HostNetwork: false, + HostPID: false, + HostIPC: false, + SELinux: policyv1beta1.SELinuxStrategyOptions{ + Rule: "RunAsAny", + }, + RunAsUser: policyv1beta1.RunAsUserStrategyOptions{ + Rule: "MustRunAsNonRoot", + }, + SupplementalGroups: policyv1beta1.SupplementalGroupsStrategyOptions{ + Rule: "MustRunAs", + Ranges: []policyv1beta1.IDRange{ + policyv1beta1.IDRange{ + Min: 1, + Max: 65535, + }, + }, + }, + FSGroup: policyv1beta1.FSGroupStrategyOptions{ + Rule: "MustRunAs", + Ranges: []policyv1beta1.IDRange{ + policyv1beta1.IDRange{ + Min: 1, + Max: 65535, + }, + }, + }, + ReadOnlyRootFilesystem: true, + AllowPrivilegeEscalation: &serviceCatalogAddonsServiceCatalogUiPodSecurityPolicyAllowPrivilegeEscalationFalse, + }, + } + + // ServiceAccount "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerServiceAccount = corev1.ServiceAccount{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Namespace: "kyma-system", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // ServiceAccount "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiServiceAccount = corev1.ServiceAccount{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + Labels: map[string]string{ + "app": "service-catalog-addons-service-catalog-ui", + }, + }, + } + + // ConfigMap "service-binding-usage-controller-process-sbu-spec" + serviceBindingUsageControllerProcessSbuSpecConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-binding-usage-controller-process-sbu-spec", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + }, + }, + } + + // ConfigMap "service-binding-usage-controller-dashboard" + serviceBindingUsageControllerDashboardConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-binding-usage-controller-dashboard", + Labels: map[string]string{ + "app": "monitoring-grafana", + "grafana_dashboard": "1", + }, + }, + Data: map[string]string{ + "service-binding-usage-controller-dashboard.json": "{\n \"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana --\",\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n },\n \"editable\": false,\n \"gnetId\": null,\n \"graphTooltip\": 0,\n \"id\": 7,\n \"iteration\": 1559633272716,\n \"links\": [],\n \"panels\": [\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": 50,\n \"panels\": [],\n \"title\": \"Runtime Business Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 1\n },\n \"id\": 48,\n \"legend\": {\n \"avg\": true,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"rate(controller_runtime_reconcile_latency_sum{controller=\\\"service_binding_usage_controller\\\"}[1m]) / rate(controller_runtime_reconcile_latency_count{controller=\\\"service_binding_usage_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"rate(controller_runtime_reconcile_latency_sum{controller=\\\"usage_kind_controller\\\"}[1m]) / rate(controller_runtime_reconcile_latency_count{controller=\\\"usage_kind_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Reconcile Latency\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": \"Average reconcile time [s]\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 1\n },\n \"id\": 44,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": true,\n \"targets\": [\n {\n \"expr\": \"increase(controller_runtime_reconcile_queue_length{controller=\\\"service_binding_usage_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"increase(controller_runtime_reconcile_queue_length{controller=\\\"usage_kind_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Queue Length\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"decimals\": 0,\n \"format\": \"short\",\n \"label\": \"Average Queue Length\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 9\n },\n \"id\": 46,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": true,\n \"targets\": [\n {\n \"expr\": \"controller_runtime_reconcile_errors_total{controller=\\\"service_binding_usage_controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"controller_runtime_reconcile_errors_total{controller=\\\"usage_kind_controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Total Errors\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"decimals\": 0,\n \"format\": \"short\",\n \"label\": \"Amount of errors\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 17\n },\n \"id\": 42,\n \"panels\": [],\n \"title\": \"Runtime Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 0,\n \"y\": 18\n },\n \"id\": 16,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_gc_duration_seconds{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{quantile}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"GC duration [s]\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {},\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 8,\n \"y\": 18\n },\n \"id\": 24,\n \"isNew\": true,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"process_open_fds{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{service}}\",\n \"metric\": \"process_open_fds\",\n \"refId\": \"A\",\n \"step\": 4\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"open fds\",\n \"tooltip\": {\n \"msResolution\": false,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 16,\n \"y\": 18\n },\n \"id\": 18,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_threads{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Gothreads\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {},\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 0,\n \"y\": 25\n },\n \"id\": 22,\n \"isNew\": true,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [\n {\n \"alias\": \"alloc rate\",\n \"yaxis\": 2\n }\n ],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_memstats_alloc_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"bytes allocated\",\n \"metric\": \"go_memstats_alloc_bytes\",\n \"refId\": \"A\",\n \"step\": 4\n },\n {\n \"expr\": \"rate(go_memstats_alloc_bytes_total{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}[30s])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"alloc rate\",\n \"metric\": \"go_memstats_alloc_bytes_total\",\n \"refId\": \"B\",\n \"step\": 4\n },\n {\n \"expr\": \"go_memstats_stack_inuse_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"stack inuse\",\n \"metric\": \"go_memstats_stack_inuse_bytes\",\n \"refId\": \"C\",\n \"step\": 4\n },\n {\n \"expr\": \"go_memstats_heap_inuse_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"heap inuse\",\n \"metric\": \"go_memstats_heap_inuse_bytes\",\n \"refId\": \"D\",\n \"step\": 4\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"go memstats\",\n \"tooltip\": {\n \"msResolution\": false,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"Bps\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 12,\n \"y\": 25\n },\n \"id\": 17,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_goroutines{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Goroutines\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 32\n },\n \"id\": 38,\n \"panels\": [],\n \"title\": \"Kubernetes Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 0,\n \"y\": 33\n },\n \"id\": 10,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": true,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": true,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum by(container) (container_memory_usage_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\", container!=\\\"POD\\\"})\",\n \"format\": \"time_series\",\n \"instant\": false,\n \"interval\": \"10s\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Current: {{container}}\",\n \"metric\": \"container_memory_usage_bytes\",\n \"refId\": \"A\",\n \"step\": 15\n },\n {\n \"expr\": \"kube_pod_container_resource_requests_memory_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Requested: {{container}}\",\n \"metric\": \"kube_pod_container_resource_requests_memory_bytes\",\n \"refId\": \"B\",\n \"step\": 20\n },\n {\n \"expr\": \"kube_pod_container_resource_limits_memory_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Limit: {{container}}\",\n \"metric\": \"kube_pod_container_resource_limits_memory_bytes\",\n \"refId\": \"C\",\n \"step\": 20\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Memory Usage\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 12,\n \"y\": 33\n },\n \"id\": 8,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": true,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": true,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum by (container)(rate(container_cpu_usage_seconds_total{image!=\\\"\\\",container!=\\\"POD\\\",pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{container}}\",\n \"refId\": \"A\",\n \"step\": 30\n },\n {\n \"expr\": \"kube_pod_container_resource_requests_cpu_cores{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Requested: {{container}}\",\n \"metric\": \"kube_pod_container_resource_requests_cpu_cores\",\n \"refId\": \"B\",\n \"step\": 20\n },\n {\n \"expr\": \"kube_pod_container_resource_limits_cpu_cores{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Limit: {{container}}\",\n \"metric\": \"kube_pod_container_resource_limits_memory_bytes\",\n \"refId\": \"C\",\n \"step\": 20\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"CPU Usage\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 24,\n \"x\": 0,\n \"y\": 40\n },\n \"id\": 12,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": false,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": false,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sort_desc(sum by (pod) (rate(container_network_receive_bytes_total{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}[1m])))\",\n \"format\": \"time_series\",\n \"interval\": \"\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\",\n \"step\": 30\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Network I/O\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n }\n ],\n \"refresh\": \"10s\",\n \"schemaVersion\": 18,\n \"style\": \"dark\",\n \"tags\": [\n \"service-catalog\",\n \"kyma\"\n ],\n \"templating\": {\n \"list\": [\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-apiserver\",\n \"value\": \"service-catalog-apiserver\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"apiserverdeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-apiserver\",\n \"value\": \"service-catalog-apiserver\"\n }\n ],\n \"query\": \"service-catalog-apiserver\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-controller-manager\",\n \"value\": \"service-catalog-controller-manager\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"controllerdeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-controller-manager\",\n \"value\": \"service-catalog-controller-manager\"\n }\n ],\n \"query\": \"service-catalog-controller-manager\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful-client\",\n \"value\": \"service-catalog-etcd-stateful-client\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"etcd_cluster\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful-client\",\n \"value\": \"service-catalog-etcd-stateful-client\"\n }\n ],\n \"query\": \"service-catalog-etcd-stateful-client\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful\",\n \"value\": \"service-catalog-etcd-stateful\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"etcddeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful\",\n \"value\": \"service-catalog-etcd-stateful\"\n }\n ],\n \"query\": \"service-catalog-etcd-stateful\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n }\n ]\n },\n \"time\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"timepicker\": {\n \"refresh_intervals\": [\n \"5s\",\n \"10s\",\n \"30s\",\n \"1m\",\n \"5m\",\n \"15m\",\n \"30m\",\n \"1h\",\n \"2h\",\n \"1d\"\n ],\n \"time_options\": [\n \"5m\",\n \"15m\",\n \"1h\",\n \"6h\",\n \"12h\",\n \"24h\",\n \"2d\",\n \"7d\",\n \"30d\"\n ]\n },\n \"timezone\": \"\",\n \"title\": \"Kyma / Service Catalog Add-ons / Binding Usage Controller\",\n \"uid\": \"_MIdIJiZz\",\n \"version\": 1\n}", + }, + } + + // ConfigMap "service-catalog-ui" + serviceCatalogUiConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + }, + }, + Data: map[string]string{ + "config.js": "window.clusterConfig = {\n catalogUrl: '/home/environments/{CURRENT_ENV}/catalog',\n graphqlApiUrl: 'https://console-backend.ed200f3.dev.kyma.ondemand.com/graphql',\n subscriptionsApiUrl: 'wss://console-backend.ed200f3.dev.kyma.ondemand.com/graphql',\n};\n", + }, + } + + // ClusterRole "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerClusterRole = rbacv1.ClusterRole{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Rules: []rbacv1.PolicyRule{ + rbacv1.PolicyRule{ + Verbs: []string{ + "create", + "delete", + }, + APIGroups: []string{ + "settings.svcat.k8s.io", + }, + Resources: []string{ + "podpresets", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + "patch", + "update", + }, + APIGroups: []string{ + "apps", + }, + Resources: []string{ + "deployments", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + "patch", + "update", + }, + APIGroups: []string{ + "serverless.kyma-project.io", + }, + Resources: []string{ + "functions", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + "create", + "update", + "delete", + }, + APIGroups: []string{ + "servicecatalog.kyma-project.io", + }, + Resources: []string{ + "servicebindingusages", + "usagekinds", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + }, + APIGroups: []string{ + "servicecatalog.k8s.io", + }, + Resources: []string{ + "servicebindings", + "serviceinstances", + "clusterserviceclasses", + "serviceclasses", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "patch", + "create", + }, + APIGroups: []string{ + "", + }, + Resources: []string{ + "events", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "delete", + "update", + }, + APIGroups: []string{ + "", + }, + Resources: []string{ + "configmaps", + }, + ResourceNames: []string{ + "service-binding-usage-controller-process-sbu-spec", + }, + }, + }, + } + + // ClusterRoleBinding "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerClusterRoleBinding = rbacv1.ClusterRoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Subjects: []rbacv1.Subject{ + rbacv1.Subject{ + Kind: "ServiceAccount", + Name: "service-catalog-addons-service-binding-usage-controller", + Namespace: "kyma-system", + }, + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: "rbac.authorization.k8s.io", + Kind: "ClusterRole", + Name: "service-catalog-addons-service-binding-usage-controller", + }, + } + + // Role "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiRole = rbacv1.Role{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + Rules: []rbacv1.PolicyRule{ + rbacv1.PolicyRule{ + Verbs: []string{ + "use", + }, + APIGroups: []string{ + "extensions", + "policy", + }, + Resources: []string{ + "podsecuritypolicies", + }, + ResourceNames: []string{ + "service-catalog-addons-service-catalog-ui", + }, + }, + }, + } + + // RoleBinding "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiRoleBinding = rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + Subjects: []rbacv1.Subject{ + rbacv1.Subject{ + Kind: "ServiceAccount", + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: "rbac.authorization.k8s.io", + Kind: "Role", + Name: "service-catalog-addons-service-catalog-ui", + }, + } + + // Service "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerService = corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + corev1.ServicePort{ + Name: "http-metrics", + Port: 8080, + }, + }, + Selector: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + } + + // Service "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiService = corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + corev1.ServicePort{ + Name: "http2", + Protocol: "TCP", + Port: 80, + TargetPort: utilintstr.IntOrString{ + Type: 0, + IntVal: 80, + StrVal: "", + }, + }, + }, + Selector: map[string]string{ + "app": "service-catalog-ui", + }, + }, + } + + // Deployment "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerDeploymentAllowPrivilegeEscalationFalse bool = false + serviceCatalogAddonsServiceBindingUsageControllerDeploymentPrivilegedFalse bool = false + serviceCatalogAddonsServiceBindingUsageControllerDeploymentReplicas1 int32 = 1 + serviceCatalogAddonsServiceBindingUsageControllerDeploymentRunAsUser2000 int64 = 2000 + + serviceCatalogAddonsServiceBindingUsageControllerDeployment = appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentReplicas1, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "release": "service-catalog-addons", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "sidecar.istio.io/inject": "true", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + corev1.Container{ + Name: "service-binding-usage-controller", + Image: "eu.gcr.io/kyma-project/service-binding-usage-controller:ef49b0f6", + Ports: []corev1.ContainerPort{ + corev1.ContainerPort{ + ContainerPort: 8080, + }, + }, + Env: []corev1.EnvVar{ + corev1.EnvVar{ + Name: "APP_LOGGER_LEVEL", + Value: "debug", + }, + corev1.EnvVar{ + Name: "APP_APPLIED_SBU_CONFIG_MAP_NAME", + Value: "service-binding-usage-controller-process-sbu-spec", + }, + corev1.EnvVar{ + Name: "APP_APPLIED_SBU_CONFIG_MAP_NAMESPACE", + Value: "kyma-system", + }, + }, + Resources: corev1.ResourceRequirements{ + Limits: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("100m"), + "memory": apiresource.MustParse("96Mi"), + }, + Requests: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("50m"), + "memory": apiresource.MustParse("48Mi"), + }, + }, + LivenessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/statusz", + Port: utilintstr.IntOrString{ + Type: 0, + IntVal: 8080, + StrVal: "", + }, + }, + }, + InitialDelaySeconds: 15, + TimeoutSeconds: 2, + PeriodSeconds: 10, + SuccessThreshold: 1, + }, + ImagePullPolicy: "IfNotPresent", + SecurityContext: &corev1.SecurityContext{ + Privileged: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentPrivilegedFalse, + AllowPrivilegeEscalation: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentAllowPrivilegeEscalationFalse, + }, + }, + }, + ServiceAccountName: "service-catalog-addons-service-binding-usage-controller", + SecurityContext: &corev1.PodSecurityContext{ + RunAsUser: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentRunAsUser2000, + }, + PriorityClassName: "kyma-system", + }, + }, + }, + } + + // Deployment "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiDeploymentAllowPrivilegeEscalationFalse bool = false + serviceCatalogAddonsServiceCatalogUiDeploymentPrivilegedFalse bool = false + serviceCatalogAddonsServiceCatalogUiDeploymentReplicas1 int32 = 1 + + serviceCatalogAddonsServiceCatalogUiDeployment = appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &serviceCatalogAddonsServiceCatalogUiDeploymentReplicas1, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "service-catalog-ui", + "release": "service-catalog-addons", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app": "service-catalog-ui", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "sidecar.istio.io/inject": "false", + }, + }, + Spec: corev1.PodSpec{ + Volumes: []corev1.Volume{ + corev1.Volume{ + Name: "config", + VolumeSource: corev1.VolumeSource{ + ConfigMap: &corev1.ConfigMapVolumeSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "service-catalog-ui", + }, + Items: []corev1.KeyToPath{ + corev1.KeyToPath{ + Key: "config.js", + Path: "config.js", + }, + }, + }, + }, + }, + }, + Containers: []corev1.Container{ + corev1.Container{ + Name: "service-catalog-ui", + Image: "eu.gcr.io/kyma-project/service-catalog-ui:10709d94", + Ports: []corev1.ContainerPort{ + corev1.ContainerPort{ + ContainerPort: 80, + }, + }, + Resources: corev1.ResourceRequirements{ + Limits: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("60m"), + "memory": apiresource.MustParse("64Mi"), + }, + Requests: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("10m"), + "memory": apiresource.MustParse("16Mi"), + }, + }, + VolumeMounts: []corev1.VolumeMount{ + corev1.VolumeMount{ + Name: "config", + MountPath: "/var/public/config", + }, + }, + ImagePullPolicy: "IfNotPresent", + SecurityContext: &corev1.SecurityContext{ + Privileged: &serviceCatalogAddonsServiceCatalogUiDeploymentPrivilegedFalse, + AllowPrivilegeEscalation: &serviceCatalogAddonsServiceCatalogUiDeploymentAllowPrivilegeEscalationFalse, + }, + }, + }, + ServiceAccountName: "service-catalog-addons-service-catalog-ui", + PriorityClassName: "kyma-system", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredDestinationRule = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "DestinationRule", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui", + }, + "spec": map[string]interface{}{ + "host": "service-catalog-addons-service-catalog-ui.kyma-system.svc.cluster.local", + "trafficPolicy": map[string]interface{}{ + "tls": map[string]interface{}{ + "mode": "DISABLE", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredPeerAuthentication = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "security.istio.io/v1beta1", + "kind": "PeerAuthentication", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "mtls": map[string]interface{}{ + "mode": "PERMISSIVE", + }, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredServiceMonitor = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "monitoring.coreos.com/v1", + "kind": "ServiceMonitor", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "prometheus": "monitoring", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "endpoints": []interface{}{ + map[string]interface{}{ + "metricRelabelings": []interface{}{ + map[string]interface{}{ + "action": "keep", + "regex": "^(controller_runtime_reconcile_latency_sum|controller_runtime_reconcile_latency_count|controller_runtime_reconcile_queue_length|controller_runtime_reconcile_errors_total|go_gc_duration_seconds|go_goroutines|go_memstats_alloc_bytes|go_memstats_heap_alloc_bytes|go_memstats_heap_inuse_bytes|go_memstats_heap_sys_bytes|go_memstats_stack_inuse_bytes|go_threads|process_cpu_seconds_total|process_max_fds|process_open_fds|process_resident_memory_bytes|process_start_time_seconds|process_virtual_memory_bytes)$", + "sourceLabels": []interface{}{ + "__name__", + }, + }, + }, + "port": "http-metrics", + }, + }, + "namespaceSelector": map[string]interface{}{ + "matchNames": []interface{}{ + "kyma-system", + }, + }, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "deployment" + deploymentUnstructuredUsageKind = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "servicecatalog.kyma-project.io/v1alpha1", + "kind": "UsageKind", + "metadata": map[string]interface{}{ + "name": "deployment", + }, + "spec": map[string]interface{}{ + "displayName": "Deployment", + "labelsPath": "spec.template.metadata.labels", + "resource": map[string]interface{}{ + "group": "apps", + "kind": "deployment", + "version": "v1", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui-catalog" + serviceCatalogAddonsServiceCatalogUiCatalogUnstructuredVirtualService = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "VirtualService", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-catalog-ui-catalog", + }, + "spec": map[string]interface{}{ + "gateways": []interface{}{ + "kyma-gateway", + }, + "hosts": []interface{}{ + "catalog.ed200f3.dev.kyma.ondemand.com", + }, + "http": []interface{}{ + map[string]interface{}{ + "match": []interface{}{ + map[string]interface{}{ + "uri": map[string]interface{}{ + "regex": "/.*", + }, + }, + }, + "route": []interface{}{ + map[string]interface{}{ + "destination": map[string]interface{}{ + "host": "service-catalog-addons-service-catalog-ui", + "port": map[string]interface{}{ + "number": 80, + }, + }, + }, + }, + }, + }, + }, + }, + } +) diff --git a/tests/output/service-catalog-addons.yaml_boilerplate.go b/tests/output/service-catalog-addons.yaml_boilerplate.go index e69de29..84a599a 100644 --- a/tests/output/service-catalog-addons.yaml_boilerplate.go +++ b/tests/output/service-catalog-addons.yaml_boilerplate.go @@ -0,0 +1,770 @@ +/* +Boilerplate 2022 test. +*/ + +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import ( + appsv1 "k8s.io/api/apps/v1" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + rbacv1 "k8s.io/api/rbac/v1" + apiresource "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + utilintstr "k8s.io/apimachinery/pkg/util/intstr" +) + +var ( + // Job "service-catalog-addons-service-binding-usage-controller-cleanup" + serviceCatalogAddonsServiceBindingUsageControllerCleanupJobBackoffLimit1 int32 = 1 + + serviceCatalogAddonsServiceBindingUsageControllerCleanupJob = batchv1.Job{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller-cleanup", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "helm.sh/hook": "pre-delete", + "helm.sh/hook-delete-policy": "before-hook-creation, hook-succeeded", + "helm.sh/hook-weight": "1", + }, + }, + Spec: batchv1.JobSpec{ + BackoffLimit: &serviceCatalogAddonsServiceBindingUsageControllerCleanupJobBackoffLimit1, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Annotations: map[string]string{ + "sidecar.istio.io/inject": "false", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + corev1.Container{ + Name: "job", + Image: "eu.gcr.io/kyma-project/tpi/k8s-tools:20211022-85284bf9", + Command: []string{ + "bash", + "-c", + "MAX_RETRIES=60\ncnt=0\n\nkubectl delete usagekinds.servicecatalog.kyma-project.io deployment > /dev/null 2>&1\n\nwhile :\n do\n kubectl get usagekinds.servicecatalog.kyma-project.io deployment -o=jsonpath='{.metadata.name}' > /dev/null 2>&1\n if [[ $? -eq \"deployment\" ]]; then\n ((cnt++))\n if (( cnt > $MAX_RETRIES )); then\n echo \"Max retries has been reached (retries $MAX_RETRIES). Exit.\"\n exit 1\n fi\n\n echo \"Removing usagekinds deployment...\"\n sleep 1\n else\n echo \"usagekinds deployment has been removed\"\n break\n fi\ndone", + }, + }, + }, + RestartPolicy: "Never", + ServiceAccountName: "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + } + + // PodSecurityPolicy "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiPodSecurityPolicyAllowPrivilegeEscalationFalse bool = false + + serviceCatalogAddonsServiceCatalogUiPodSecurityPolicy = policyv1beta1.PodSecurityPolicy{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + Spec: policyv1beta1.PodSecurityPolicySpec{ + Privileged: false, + Volumes: []policyv1beta1.FSType{ + "emptyDir", + "configMap", + }, + HostNetwork: false, + HostPID: false, + HostIPC: false, + SELinux: policyv1beta1.SELinuxStrategyOptions{ + Rule: "RunAsAny", + }, + RunAsUser: policyv1beta1.RunAsUserStrategyOptions{ + Rule: "MustRunAsNonRoot", + }, + SupplementalGroups: policyv1beta1.SupplementalGroupsStrategyOptions{ + Rule: "MustRunAs", + Ranges: []policyv1beta1.IDRange{ + policyv1beta1.IDRange{ + Min: 1, + Max: 65535, + }, + }, + }, + FSGroup: policyv1beta1.FSGroupStrategyOptions{ + Rule: "MustRunAs", + Ranges: []policyv1beta1.IDRange{ + policyv1beta1.IDRange{ + Min: 1, + Max: 65535, + }, + }, + }, + ReadOnlyRootFilesystem: true, + AllowPrivilegeEscalation: &serviceCatalogAddonsServiceCatalogUiPodSecurityPolicyAllowPrivilegeEscalationFalse, + }, + } + + // ServiceAccount "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerServiceAccount = corev1.ServiceAccount{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Namespace: "kyma-system", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // ServiceAccount "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiServiceAccount = corev1.ServiceAccount{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + Labels: map[string]string{ + "app": "service-catalog-addons-service-catalog-ui", + }, + }, + } + + // ConfigMap "service-binding-usage-controller-process-sbu-spec" + serviceBindingUsageControllerProcessSbuSpecConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-binding-usage-controller-process-sbu-spec", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + }, + }, + } + + // ConfigMap "service-binding-usage-controller-dashboard" + serviceBindingUsageControllerDashboardConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-binding-usage-controller-dashboard", + Labels: map[string]string{ + "app": "monitoring-grafana", + "grafana_dashboard": "1", + }, + }, + Data: map[string]string{ + "service-binding-usage-controller-dashboard.json": "{\n \"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana --\",\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n },\n \"editable\": false,\n \"gnetId\": null,\n \"graphTooltip\": 0,\n \"id\": 7,\n \"iteration\": 1559633272716,\n \"links\": [],\n \"panels\": [\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": 50,\n \"panels\": [],\n \"title\": \"Runtime Business Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 1\n },\n \"id\": 48,\n \"legend\": {\n \"avg\": true,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"rate(controller_runtime_reconcile_latency_sum{controller=\\\"service_binding_usage_controller\\\"}[1m]) / rate(controller_runtime_reconcile_latency_count{controller=\\\"service_binding_usage_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"rate(controller_runtime_reconcile_latency_sum{controller=\\\"usage_kind_controller\\\"}[1m]) / rate(controller_runtime_reconcile_latency_count{controller=\\\"usage_kind_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Reconcile Latency\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": \"Average reconcile time [s]\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 1\n },\n \"id\": 44,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": true,\n \"targets\": [\n {\n \"expr\": \"increase(controller_runtime_reconcile_queue_length{controller=\\\"service_binding_usage_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"increase(controller_runtime_reconcile_queue_length{controller=\\\"usage_kind_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Queue Length\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"decimals\": 0,\n \"format\": \"short\",\n \"label\": \"Average Queue Length\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 9\n },\n \"id\": 46,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": true,\n \"targets\": [\n {\n \"expr\": \"controller_runtime_reconcile_errors_total{controller=\\\"service_binding_usage_controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"controller_runtime_reconcile_errors_total{controller=\\\"usage_kind_controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Total Errors\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"decimals\": 0,\n \"format\": \"short\",\n \"label\": \"Amount of errors\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 17\n },\n \"id\": 42,\n \"panels\": [],\n \"title\": \"Runtime Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 0,\n \"y\": 18\n },\n \"id\": 16,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_gc_duration_seconds{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{quantile}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"GC duration [s]\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {},\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 8,\n \"y\": 18\n },\n \"id\": 24,\n \"isNew\": true,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"process_open_fds{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{service}}\",\n \"metric\": \"process_open_fds\",\n \"refId\": \"A\",\n \"step\": 4\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"open fds\",\n \"tooltip\": {\n \"msResolution\": false,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 16,\n \"y\": 18\n },\n \"id\": 18,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_threads{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Gothreads\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {},\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 0,\n \"y\": 25\n },\n \"id\": 22,\n \"isNew\": true,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [\n {\n \"alias\": \"alloc rate\",\n \"yaxis\": 2\n }\n ],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_memstats_alloc_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"bytes allocated\",\n \"metric\": \"go_memstats_alloc_bytes\",\n \"refId\": \"A\",\n \"step\": 4\n },\n {\n \"expr\": \"rate(go_memstats_alloc_bytes_total{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}[30s])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"alloc rate\",\n \"metric\": \"go_memstats_alloc_bytes_total\",\n \"refId\": \"B\",\n \"step\": 4\n },\n {\n \"expr\": \"go_memstats_stack_inuse_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"stack inuse\",\n \"metric\": \"go_memstats_stack_inuse_bytes\",\n \"refId\": \"C\",\n \"step\": 4\n },\n {\n \"expr\": \"go_memstats_heap_inuse_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"heap inuse\",\n \"metric\": \"go_memstats_heap_inuse_bytes\",\n \"refId\": \"D\",\n \"step\": 4\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"go memstats\",\n \"tooltip\": {\n \"msResolution\": false,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"Bps\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 12,\n \"y\": 25\n },\n \"id\": 17,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_goroutines{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Goroutines\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 32\n },\n \"id\": 38,\n \"panels\": [],\n \"title\": \"Kubernetes Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 0,\n \"y\": 33\n },\n \"id\": 10,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": true,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": true,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum by(container) (container_memory_usage_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\", container!=\\\"POD\\\"})\",\n \"format\": \"time_series\",\n \"instant\": false,\n \"interval\": \"10s\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Current: {{container}}\",\n \"metric\": \"container_memory_usage_bytes\",\n \"refId\": \"A\",\n \"step\": 15\n },\n {\n \"expr\": \"kube_pod_container_resource_requests_memory_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Requested: {{container}}\",\n \"metric\": \"kube_pod_container_resource_requests_memory_bytes\",\n \"refId\": \"B\",\n \"step\": 20\n },\n {\n \"expr\": \"kube_pod_container_resource_limits_memory_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Limit: {{container}}\",\n \"metric\": \"kube_pod_container_resource_limits_memory_bytes\",\n \"refId\": \"C\",\n \"step\": 20\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Memory Usage\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 12,\n \"y\": 33\n },\n \"id\": 8,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": true,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": true,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum by (container)(rate(container_cpu_usage_seconds_total{image!=\\\"\\\",container!=\\\"POD\\\",pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{container}}\",\n \"refId\": \"A\",\n \"step\": 30\n },\n {\n \"expr\": \"kube_pod_container_resource_requests_cpu_cores{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Requested: {{container}}\",\n \"metric\": \"kube_pod_container_resource_requests_cpu_cores\",\n \"refId\": \"B\",\n \"step\": 20\n },\n {\n \"expr\": \"kube_pod_container_resource_limits_cpu_cores{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Limit: {{container}}\",\n \"metric\": \"kube_pod_container_resource_limits_memory_bytes\",\n \"refId\": \"C\",\n \"step\": 20\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"CPU Usage\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 24,\n \"x\": 0,\n \"y\": 40\n },\n \"id\": 12,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": false,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": false,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sort_desc(sum by (pod) (rate(container_network_receive_bytes_total{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}[1m])))\",\n \"format\": \"time_series\",\n \"interval\": \"\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\",\n \"step\": 30\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Network I/O\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n }\n ],\n \"refresh\": \"10s\",\n \"schemaVersion\": 18,\n \"style\": \"dark\",\n \"tags\": [\n \"service-catalog\",\n \"kyma\"\n ],\n \"templating\": {\n \"list\": [\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-apiserver\",\n \"value\": \"service-catalog-apiserver\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"apiserverdeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-apiserver\",\n \"value\": \"service-catalog-apiserver\"\n }\n ],\n \"query\": \"service-catalog-apiserver\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-controller-manager\",\n \"value\": \"service-catalog-controller-manager\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"controllerdeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-controller-manager\",\n \"value\": \"service-catalog-controller-manager\"\n }\n ],\n \"query\": \"service-catalog-controller-manager\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful-client\",\n \"value\": \"service-catalog-etcd-stateful-client\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"etcd_cluster\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful-client\",\n \"value\": \"service-catalog-etcd-stateful-client\"\n }\n ],\n \"query\": \"service-catalog-etcd-stateful-client\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful\",\n \"value\": \"service-catalog-etcd-stateful\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"etcddeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful\",\n \"value\": \"service-catalog-etcd-stateful\"\n }\n ],\n \"query\": \"service-catalog-etcd-stateful\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n }\n ]\n },\n \"time\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"timepicker\": {\n \"refresh_intervals\": [\n \"5s\",\n \"10s\",\n \"30s\",\n \"1m\",\n \"5m\",\n \"15m\",\n \"30m\",\n \"1h\",\n \"2h\",\n \"1d\"\n ],\n \"time_options\": [\n \"5m\",\n \"15m\",\n \"1h\",\n \"6h\",\n \"12h\",\n \"24h\",\n \"2d\",\n \"7d\",\n \"30d\"\n ]\n },\n \"timezone\": \"\",\n \"title\": \"Kyma / Service Catalog Add-ons / Binding Usage Controller\",\n \"uid\": \"_MIdIJiZz\",\n \"version\": 1\n}", + }, + } + + // ConfigMap "service-catalog-ui" + serviceCatalogUiConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + }, + }, + Data: map[string]string{ + "config.js": "window.clusterConfig = {\n catalogUrl: '/home/environments/{CURRENT_ENV}/catalog',\n graphqlApiUrl: 'https://console-backend.ed200f3.dev.kyma.ondemand.com/graphql',\n subscriptionsApiUrl: 'wss://console-backend.ed200f3.dev.kyma.ondemand.com/graphql',\n};\n", + }, + } + + // ClusterRole "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerClusterRole = rbacv1.ClusterRole{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Rules: []rbacv1.PolicyRule{ + rbacv1.PolicyRule{ + Verbs: []string{ + "create", + "delete", + }, + APIGroups: []string{ + "settings.svcat.k8s.io", + }, + Resources: []string{ + "podpresets", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + "patch", + "update", + }, + APIGroups: []string{ + "apps", + }, + Resources: []string{ + "deployments", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + "patch", + "update", + }, + APIGroups: []string{ + "serverless.kyma-project.io", + }, + Resources: []string{ + "functions", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + "create", + "update", + "delete", + }, + APIGroups: []string{ + "servicecatalog.kyma-project.io", + }, + Resources: []string{ + "servicebindingusages", + "usagekinds", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "list", + "watch", + }, + APIGroups: []string{ + "servicecatalog.k8s.io", + }, + Resources: []string{ + "servicebindings", + "serviceinstances", + "clusterserviceclasses", + "serviceclasses", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "patch", + "create", + }, + APIGroups: []string{ + "", + }, + Resources: []string{ + "events", + }, + }, + rbacv1.PolicyRule{ + Verbs: []string{ + "get", + "delete", + "update", + }, + APIGroups: []string{ + "", + }, + Resources: []string{ + "configmaps", + }, + ResourceNames: []string{ + "service-binding-usage-controller-process-sbu-spec", + }, + }, + }, + } + + // ClusterRoleBinding "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerClusterRoleBinding = rbacv1.ClusterRoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Subjects: []rbacv1.Subject{ + rbacv1.Subject{ + Kind: "ServiceAccount", + Name: "service-catalog-addons-service-binding-usage-controller", + Namespace: "kyma-system", + }, + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: "rbac.authorization.k8s.io", + Kind: "ClusterRole", + Name: "service-catalog-addons-service-binding-usage-controller", + }, + } + + // Role "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiRole = rbacv1.Role{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + Rules: []rbacv1.PolicyRule{ + rbacv1.PolicyRule{ + Verbs: []string{ + "use", + }, + APIGroups: []string{ + "extensions", + "policy", + }, + Resources: []string{ + "podsecuritypolicies", + }, + ResourceNames: []string{ + "service-catalog-addons-service-catalog-ui", + }, + }, + }, + } + + // RoleBinding "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiRoleBinding = rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + Subjects: []rbacv1.Subject{ + rbacv1.Subject{ + Kind: "ServiceAccount", + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + }, + RoleRef: rbacv1.RoleRef{ + APIGroup: "rbac.authorization.k8s.io", + Kind: "Role", + Name: "service-catalog-addons-service-catalog-ui", + }, + } + + // Service "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerService = corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + corev1.ServicePort{ + Name: "http-metrics", + Port: 8080, + }, + }, + Selector: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + } + + // Service "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiService = corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + Spec: corev1.ServiceSpec{ + Ports: []corev1.ServicePort{ + corev1.ServicePort{ + Name: "http2", + Protocol: "TCP", + Port: 80, + TargetPort: utilintstr.IntOrString{ + Type: 0, + IntVal: 80, + StrVal: "", + }, + }, + }, + Selector: map[string]string{ + "app": "service-catalog-ui", + }, + }, + } + + // Deployment "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerDeploymentAllowPrivilegeEscalationFalse bool = false + serviceCatalogAddonsServiceBindingUsageControllerDeploymentPrivilegedFalse bool = false + serviceCatalogAddonsServiceBindingUsageControllerDeploymentReplicas1 int32 = 1 + serviceCatalogAddonsServiceBindingUsageControllerDeploymentRunAsUser2000 int64 = 2000 + + serviceCatalogAddonsServiceBindingUsageControllerDeployment = appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentReplicas1, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "release": "service-catalog-addons", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "sidecar.istio.io/inject": "true", + }, + }, + Spec: corev1.PodSpec{ + Containers: []corev1.Container{ + corev1.Container{ + Name: "service-binding-usage-controller", + Image: "eu.gcr.io/kyma-project/service-binding-usage-controller:ef49b0f6", + Ports: []corev1.ContainerPort{ + corev1.ContainerPort{ + ContainerPort: 8080, + }, + }, + Env: []corev1.EnvVar{ + corev1.EnvVar{ + Name: "APP_LOGGER_LEVEL", + Value: "debug", + }, + corev1.EnvVar{ + Name: "APP_APPLIED_SBU_CONFIG_MAP_NAME", + Value: "service-binding-usage-controller-process-sbu-spec", + }, + corev1.EnvVar{ + Name: "APP_APPLIED_SBU_CONFIG_MAP_NAMESPACE", + Value: "kyma-system", + }, + }, + Resources: corev1.ResourceRequirements{ + Limits: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("100m"), + "memory": apiresource.MustParse("96Mi"), + }, + Requests: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("50m"), + "memory": apiresource.MustParse("48Mi"), + }, + }, + LivenessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: "/statusz", + Port: utilintstr.IntOrString{ + Type: 0, + IntVal: 8080, + StrVal: "", + }, + }, + }, + InitialDelaySeconds: 15, + TimeoutSeconds: 2, + PeriodSeconds: 10, + SuccessThreshold: 1, + }, + ImagePullPolicy: "IfNotPresent", + SecurityContext: &corev1.SecurityContext{ + Privileged: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentPrivilegedFalse, + AllowPrivilegeEscalation: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentAllowPrivilegeEscalationFalse, + }, + }, + }, + ServiceAccountName: "service-catalog-addons-service-binding-usage-controller", + SecurityContext: &corev1.PodSecurityContext{ + RunAsUser: &serviceCatalogAddonsServiceBindingUsageControllerDeploymentRunAsUser2000, + }, + PriorityClassName: "kyma-system", + }, + }, + }, + } + + // Deployment "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiDeploymentAllowPrivilegeEscalationFalse bool = false + serviceCatalogAddonsServiceCatalogUiDeploymentPrivilegedFalse bool = false + serviceCatalogAddonsServiceCatalogUiDeploymentReplicas1 int32 = 1 + + serviceCatalogAddonsServiceCatalogUiDeployment = appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + Spec: appsv1.DeploymentSpec{ + Replicas: &serviceCatalogAddonsServiceCatalogUiDeploymentReplicas1, + Selector: &metav1.LabelSelector{ + MatchLabels: map[string]string{ + "app": "service-catalog-ui", + "release": "service-catalog-addons", + }, + }, + Template: corev1.PodTemplateSpec{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "app": "service-catalog-ui", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "sidecar.istio.io/inject": "false", + }, + }, + Spec: corev1.PodSpec{ + Volumes: []corev1.Volume{ + corev1.Volume{ + Name: "config", + VolumeSource: corev1.VolumeSource{ + ConfigMap: &corev1.ConfigMapVolumeSource{ + LocalObjectReference: corev1.LocalObjectReference{ + Name: "service-catalog-ui", + }, + Items: []corev1.KeyToPath{ + corev1.KeyToPath{ + Key: "config.js", + Path: "config.js", + }, + }, + }, + }, + }, + }, + Containers: []corev1.Container{ + corev1.Container{ + Name: "service-catalog-ui", + Image: "eu.gcr.io/kyma-project/service-catalog-ui:10709d94", + Ports: []corev1.ContainerPort{ + corev1.ContainerPort{ + ContainerPort: 80, + }, + }, + Resources: corev1.ResourceRequirements{ + Limits: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("60m"), + "memory": apiresource.MustParse("64Mi"), + }, + Requests: map[corev1.ResourceName]apiresource.Quantity{ + "cpu": apiresource.MustParse("10m"), + "memory": apiresource.MustParse("16Mi"), + }, + }, + VolumeMounts: []corev1.VolumeMount{ + corev1.VolumeMount{ + Name: "config", + MountPath: "/var/public/config", + }, + }, + ImagePullPolicy: "IfNotPresent", + SecurityContext: &corev1.SecurityContext{ + Privileged: &serviceCatalogAddonsServiceCatalogUiDeploymentPrivilegedFalse, + AllowPrivilegeEscalation: &serviceCatalogAddonsServiceCatalogUiDeploymentAllowPrivilegeEscalationFalse, + }, + }, + }, + ServiceAccountName: "service-catalog-addons-service-catalog-ui", + PriorityClassName: "kyma-system", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredDestinationRule = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "DestinationRule", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui", + }, + "spec": map[string]interface{}{ + "host": "service-catalog-addons-service-catalog-ui.kyma-system.svc.cluster.local", + "trafficPolicy": map[string]interface{}{ + "tls": map[string]interface{}{ + "mode": "DISABLE", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredPeerAuthentication = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "security.istio.io/v1beta1", + "kind": "PeerAuthentication", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "mtls": map[string]interface{}{ + "mode": "PERMISSIVE", + }, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredServiceMonitor = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "monitoring.coreos.com/v1", + "kind": "ServiceMonitor", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "prometheus": "monitoring", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "endpoints": []interface{}{ + map[string]interface{}{ + "metricRelabelings": []interface{}{ + map[string]interface{}{ + "action": "keep", + "regex": "^(controller_runtime_reconcile_latency_sum|controller_runtime_reconcile_latency_count|controller_runtime_reconcile_queue_length|controller_runtime_reconcile_errors_total|go_gc_duration_seconds|go_goroutines|go_memstats_alloc_bytes|go_memstats_heap_alloc_bytes|go_memstats_heap_inuse_bytes|go_memstats_heap_sys_bytes|go_memstats_stack_inuse_bytes|go_threads|process_cpu_seconds_total|process_max_fds|process_open_fds|process_resident_memory_bytes|process_start_time_seconds|process_virtual_memory_bytes)$", + "sourceLabels": []interface{}{ + "__name__", + }, + }, + }, + "port": "http-metrics", + }, + }, + "namespaceSelector": map[string]interface{}{ + "matchNames": []interface{}{ + "kyma-system", + }, + }, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "deployment" + deploymentUnstructuredUsageKind = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "servicecatalog.kyma-project.io/v1alpha1", + "kind": "UsageKind", + "metadata": map[string]interface{}{ + "name": "deployment", + }, + "spec": map[string]interface{}{ + "displayName": "Deployment", + "labelsPath": "spec.template.metadata.labels", + "resource": map[string]interface{}{ + "group": "apps", + "kind": "deployment", + "version": "v1", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui-catalog" + serviceCatalogAddonsServiceCatalogUiCatalogUnstructuredVirtualService = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "VirtualService", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-catalog-ui-catalog", + }, + "spec": map[string]interface{}{ + "gateways": []interface{}{ + "kyma-gateway", + }, + "hosts": []interface{}{ + "catalog.ed200f3.dev.kyma.ondemand.com", + }, + "http": []interface{}{ + map[string]interface{}{ + "match": []interface{}{ + map[string]interface{}{ + "uri": map[string]interface{}{ + "regex": "/.*", + }, + }, + }, + "route": []interface{}{ + map[string]interface{}{ + "destination": map[string]interface{}{ + "host": "service-catalog-addons-service-catalog-ui", + "port": map[string]interface{}{ + "number": 80, + }, + }, + }, + }, + }, + }, + }, + }, + } +) diff --git a/tests/output/service-catalog-addons.yaml_only_meta.go b/tests/output/service-catalog-addons.yaml_only_meta.go new file mode 100644 index 0000000..e4e4dec --- /dev/null +++ b/tests/output/service-catalog-addons.yaml_only_meta.go @@ -0,0 +1,256 @@ +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import ( + appsv1 "k8s.io/api/apps/v1" + batchv1 "k8s.io/api/batch/v1" + corev1 "k8s.io/api/core/v1" + policyv1beta1 "k8s.io/api/policy/v1beta1" + rbacv1 "k8s.io/api/rbac/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" +) + +var ( + // Job "service-catalog-addons-service-binding-usage-controller-cleanup" + serviceCatalogAddonsServiceBindingUsageControllerCleanupJob = batchv1.Job{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller-cleanup", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + Annotations: map[string]string{ + "helm.sh/hook": "pre-delete", + "helm.sh/hook-delete-policy": "before-hook-creation, hook-succeeded", + "helm.sh/hook-weight": "1", + }, + }, + } + + // PodSecurityPolicy "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiPodSecurityPolicy = policyv1beta1.PodSecurityPolicy{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + } + + // ServiceAccount "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerServiceAccount = corev1.ServiceAccount{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Namespace: "kyma-system", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // ServiceAccount "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiServiceAccount = corev1.ServiceAccount{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + Labels: map[string]string{ + "app": "service-catalog-addons-service-catalog-ui", + }, + }, + } + + // ConfigMap "service-binding-usage-controller-process-sbu-spec" + serviceBindingUsageControllerProcessSbuSpecConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-binding-usage-controller-process-sbu-spec", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + }, + }, + } + + // ConfigMap "service-binding-usage-controller-dashboard" + serviceBindingUsageControllerDashboardConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-binding-usage-controller-dashboard", + Labels: map[string]string{ + "app": "monitoring-grafana", + "grafana_dashboard": "1", + }, + }, + } + + // ConfigMap "service-catalog-ui" + serviceCatalogUiConfigMap = corev1.ConfigMap{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + }, + }, + } + + // ClusterRole "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerClusterRole = rbacv1.ClusterRole{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // ClusterRoleBinding "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerClusterRoleBinding = rbacv1.ClusterRoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // Role "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiRole = rbacv1.Role{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + } + + // RoleBinding "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiRoleBinding = rbacv1.RoleBinding{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Namespace: "kyma-system", + }, + } + + // Service "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerService = corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // Service "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiService = corev1.Service{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + }, + } + + // Deployment "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerDeployment = appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-binding-usage-controller", + Labels: map[string]string{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + }, + } + + // Deployment "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiDeployment = appsv1.Deployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "service-catalog-addons-service-catalog-ui", + Labels: map[string]string{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredDestinationRule = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "DestinationRule", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui", + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredPeerAuthentication = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "security.istio.io/v1beta1", + "kind": "PeerAuthentication", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-binding-usage-controller", + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredServiceMonitor = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "monitoring.coreos.com/v1", + "kind": "ServiceMonitor", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-binding-usage-controller", + }, + }, + } + + // Unstructured "deployment" + deploymentUnstructuredUsageKind = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "servicecatalog.kyma-project.io/v1alpha1", + "kind": "UsageKind", + "metadata": map[string]interface{}{ + "name": "deployment", + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui-catalog" + serviceCatalogAddonsServiceCatalogUiCatalogUnstructuredVirtualService = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "VirtualService", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui-catalog", + }, + }, + } +) diff --git a/tests/output/service-catalog-addons.yaml_unstructured.go b/tests/output/service-catalog-addons.yaml_unstructured.go new file mode 100644 index 0000000..5809bb9 --- /dev/null +++ b/tests/output/service-catalog-addons.yaml_unstructured.go @@ -0,0 +1,754 @@ +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + +var ( + // Unstructured "service-catalog-addons-service-binding-usage-controller-cleanup" + serviceCatalogAddonsServiceBindingUsageControllerCleanupUnstructuredJob = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "batch/v1", + "kind": "Job", + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "helm.sh/hook": "pre-delete", + "helm.sh/hook-delete-policy": "before-hook-creation, hook-succeeded", + "helm.sh/hook-weight": "1", + }, + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller-cleanup", + }, + "spec": map[string]interface{}{ + "backoffLimit": 1, + "template": map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "sidecar.istio.io/inject": "false", + }, + }, + "spec": map[string]interface{}{ + "containers": []interface{}{ + map[string]interface{}{ + "command": []interface{}{ + "bash", "-c", "MAX_RETRIES=60\ncnt=0\n\nkubectl delete usagekinds.servicecatalog.kyma-project.io deployment > /dev/null 2>&1\n\nwhile :\n do\n kubectl get usagekinds.servicecatalog.kyma-project.io deployment -o=jsonpath='{.metadata.name}' > /dev/null 2>&1\n if [[ $? -eq \"deployment\" ]]; then\n ((cnt++))\n if (( cnt > $MAX_RETRIES )); then\n echo \"Max retries has been reached (retries $MAX_RETRIES). Exit.\"\n exit 1\n fi\n\n echo \"Removing usagekinds deployment...\"\n sleep 1\n else\n echo \"usagekinds deployment has been removed\"\n break\n fi\ndone", + }, + "image": "eu.gcr.io/kyma-project/tpi/k8s-tools:20211022-85284bf9", + "name": "job", + }, + }, + "restartPolicy": "Never", + "serviceAccountName": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredPodSecurityPolicy = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "policy/v1beta1", + "kind": "PodSecurityPolicy", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-catalog-ui", + }, + "spec": map[string]interface{}{ + "allowPrivilegeEscalation": false, + "fsGroup": map[string]interface{}{ + "ranges": []interface{}{ + map[string]interface{}{ + "max": 65535, + "min": 1, + }, + }, + "rule": "MustRunAs", + }, + "hostIPC": false, + "hostNetwork": false, + "hostPID": false, + "privileged": false, + "readOnlyRootFilesystem": true, + "runAsUser": map[string]interface{}{ + "rule": "MustRunAsNonRoot", + }, + "seLinux": map[string]interface{}{ + "rule": "RunAsAny", + }, + "supplementalGroups": map[string]interface{}{ + "ranges": []interface{}{ + map[string]interface{}{ + "max": 65535, + "min": 1, + }, + }, + "rule": "MustRunAs", + }, + "volumes": []interface{}{ + "emptyDir", "configMap", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredServiceAccount = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "ServiceAccount", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + "namespace": "kyma-system", + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredServiceAccount = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "ServiceAccount", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-catalog-ui", + }, + "name": "service-catalog-addons-service-catalog-ui", + "namespace": "kyma-system", + }, + }, + } + + // Unstructured "service-binding-usage-controller-process-sbu-spec" + serviceBindingUsageControllerProcessSbuSpecUnstructuredConfigMap = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "ConfigMap", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + }, + "name": "service-binding-usage-controller-process-sbu-spec", + }, + }, + } + + // Unstructured "service-binding-usage-controller-dashboard" + serviceBindingUsageControllerDashboardUnstructuredConfigMap = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "data": map[string]interface{}{ + "service-binding-usage-controller-dashboard.json": "{\n \"annotations\": {\n \"list\": [\n {\n \"builtIn\": 1,\n \"datasource\": \"-- Grafana --\",\n \"enable\": true,\n \"hide\": true,\n \"iconColor\": \"rgba(0, 211, 255, 1)\",\n \"name\": \"Annotations & Alerts\",\n \"type\": \"dashboard\"\n }\n ]\n },\n \"editable\": false,\n \"gnetId\": null,\n \"graphTooltip\": 0,\n \"id\": 7,\n \"iteration\": 1559633272716,\n \"links\": [],\n \"panels\": [\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 0\n },\n \"id\": 50,\n \"panels\": [],\n \"title\": \"Runtime Business Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 1\n },\n \"id\": 48,\n \"legend\": {\n \"avg\": true,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"rate(controller_runtime_reconcile_latency_sum{controller=\\\"service_binding_usage_controller\\\"}[1m]) / rate(controller_runtime_reconcile_latency_count{controller=\\\"service_binding_usage_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"rate(controller_runtime_reconcile_latency_sum{controller=\\\"usage_kind_controller\\\"}[1m]) / rate(controller_runtime_reconcile_latency_count{controller=\\\"usage_kind_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Reconcile Latency\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": \"Average reconcile time [s]\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 12,\n \"y\": 1\n },\n \"id\": 44,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null as zero\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": true,\n \"targets\": [\n {\n \"expr\": \"increase(controller_runtime_reconcile_queue_length{controller=\\\"service_binding_usage_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"increase(controller_runtime_reconcile_queue_length{controller=\\\"usage_kind_controller\\\"}[1m])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Queue Length\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"decimals\": 0,\n \"format\": \"short\",\n \"label\": \"Average Queue Length\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 8,\n \"w\": 12,\n \"x\": 0,\n \"y\": 9\n },\n \"id\": 46,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 2,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"stack\": false,\n \"steppedLine\": true,\n \"targets\": [\n {\n \"expr\": \"controller_runtime_reconcile_errors_total{controller=\\\"service_binding_usage_controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"ServiceBindingUsageController\",\n \"refId\": \"A\"\n },\n {\n \"expr\": \"controller_runtime_reconcile_errors_total{controller=\\\"usage_kind_controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"UsageKindController\",\n \"refId\": \"B\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Total Errors\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"decimals\": 0,\n \"format\": \"short\",\n \"label\": \"Amount of errors\",\n \"logBase\": 1,\n \"max\": null,\n \"min\": \"0\",\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": false\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 17\n },\n \"id\": 42,\n \"panels\": [],\n \"title\": \"Runtime Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 0,\n \"y\": 18\n },\n \"id\": 16,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_gc_duration_seconds{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{quantile}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"GC duration [s]\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {},\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 8,\n \"y\": 18\n },\n \"id\": 24,\n \"isNew\": true,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"process_open_fds{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{service}}\",\n \"metric\": \"process_open_fds\",\n \"refId\": \"A\",\n \"step\": 4\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"open fds\",\n \"tooltip\": {\n \"msResolution\": false,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 8,\n \"x\": 16,\n \"y\": 18\n },\n \"id\": 18,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_threads{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Gothreads\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {},\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 0,\n \"y\": 25\n },\n \"id\": 22,\n \"isNew\": true,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [\n {\n \"alias\": \"alloc rate\",\n \"yaxis\": 2\n }\n ],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_memstats_alloc_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"bytes allocated\",\n \"metric\": \"go_memstats_alloc_bytes\",\n \"refId\": \"A\",\n \"step\": 4\n },\n {\n \"expr\": \"rate(go_memstats_alloc_bytes_total{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}[30s])\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"alloc rate\",\n \"metric\": \"go_memstats_alloc_bytes_total\",\n \"refId\": \"B\",\n \"step\": 4\n },\n {\n \"expr\": \"go_memstats_stack_inuse_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"stack inuse\",\n \"metric\": \"go_memstats_stack_inuse_bytes\",\n \"refId\": \"C\",\n \"step\": 4\n },\n {\n \"expr\": \"go_memstats_heap_inuse_bytes{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"hide\": false,\n \"intervalFactor\": 2,\n \"legendFormat\": \"heap inuse\",\n \"metric\": \"go_memstats_heap_inuse_bytes\",\n \"refId\": \"D\",\n \"step\": 4\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"go memstats\",\n \"tooltip\": {\n \"msResolution\": false,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"Bps\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"fill\": 1,\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 12,\n \"y\": 25\n },\n \"id\": 17,\n \"legend\": {\n \"avg\": false,\n \"current\": false,\n \"max\": false,\n \"min\": false,\n \"show\": true,\n \"total\": false,\n \"values\": false\n },\n \"lines\": true,\n \"linewidth\": 1,\n \"links\": [],\n \"nullPointMode\": \"null\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"go_goroutines{service=\\\"service-catalog-addons-service-binding-usage-controller\\\"}\",\n \"format\": \"time_series\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\"\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Goroutines\",\n \"tooltip\": {\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"individual\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"label\": null,\n \"logBase\": 1,\n \"max\": null,\n \"min\": null,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"collapsed\": false,\n \"gridPos\": {\n \"h\": 1,\n \"w\": 24,\n \"x\": 0,\n \"y\": 32\n },\n \"id\": 38,\n \"panels\": [],\n \"title\": \"Kubernetes Metrics\",\n \"type\": \"row\"\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 0,\n \"y\": 33\n },\n \"id\": 10,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": true,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": true,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum by(container) (container_memory_usage_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\", container!=\\\"POD\\\"})\",\n \"format\": \"time_series\",\n \"instant\": false,\n \"interval\": \"10s\",\n \"intervalFactor\": 1,\n \"legendFormat\": \"Current: {{container}}\",\n \"metric\": \"container_memory_usage_bytes\",\n \"refId\": \"A\",\n \"step\": 15\n },\n {\n \"expr\": \"kube_pod_container_resource_requests_memory_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Requested: {{container}}\",\n \"metric\": \"kube_pod_container_resource_requests_memory_bytes\",\n \"refId\": \"B\",\n \"step\": 20\n },\n {\n \"expr\": \"kube_pod_container_resource_limits_memory_bytes{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Limit: {{container}}\",\n \"metric\": \"kube_pod_container_resource_limits_memory_bytes\",\n \"refId\": \"C\",\n \"step\": 20\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Memory Usage\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 12,\n \"x\": 12,\n \"y\": 33\n },\n \"id\": 8,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": true,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": true,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sum by (container)(rate(container_cpu_usage_seconds_total{image!=\\\"\\\",container!=\\\"POD\\\",pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}[1m]))\",\n \"format\": \"time_series\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{container}}\",\n \"refId\": \"A\",\n \"step\": 30\n },\n {\n \"expr\": \"kube_pod_container_resource_requests_cpu_cores{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Requested: {{container}}\",\n \"metric\": \"kube_pod_container_resource_requests_cpu_cores\",\n \"refId\": \"B\",\n \"step\": 20\n },\n {\n \"expr\": \"kube_pod_container_resource_limits_cpu_cores{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}\",\n \"format\": \"time_series\",\n \"interval\": \"10s\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"Limit: {{container}}\",\n \"metric\": \"kube_pod_container_resource_limits_memory_bytes\",\n \"refId\": \"C\",\n \"step\": 20\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"CPU Usage\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n },\n {\n \"aliasColors\": {},\n \"bars\": false,\n \"dashLength\": 10,\n \"dashes\": false,\n \"datasource\": \"Prometheus\",\n \"editable\": true,\n \"error\": false,\n \"fill\": 1,\n \"grid\": {\n \"threshold1Color\": \"rgba(216, 200, 27, 0.27)\",\n \"threshold2Color\": \"rgba(234, 112, 112, 0.22)\"\n },\n \"gridPos\": {\n \"h\": 7,\n \"w\": 24,\n \"x\": 0,\n \"y\": 40\n },\n \"id\": 12,\n \"isNew\": false,\n \"legend\": {\n \"alignAsTable\": false,\n \"avg\": true,\n \"current\": true,\n \"hideEmpty\": false,\n \"hideZero\": false,\n \"max\": false,\n \"min\": false,\n \"rightSide\": false,\n \"show\": true,\n \"total\": false,\n \"values\": true\n },\n \"lines\": true,\n \"linewidth\": 2,\n \"links\": [],\n \"nullPointMode\": \"connected\",\n \"paceLength\": 10,\n \"percentage\": false,\n \"pointradius\": 5,\n \"points\": false,\n \"renderer\": \"flot\",\n \"seriesOverrides\": [],\n \"spaceLength\": 10,\n \"stack\": false,\n \"steppedLine\": false,\n \"targets\": [\n {\n \"expr\": \"sort_desc(sum by (pod) (rate(container_network_receive_bytes_total{pod=~\\\"service-catalog-addons-service-binding-usage-controller.*\\\"}[1m])))\",\n \"format\": \"time_series\",\n \"interval\": \"\",\n \"intervalFactor\": 2,\n \"legendFormat\": \"{{pod}}\",\n \"refId\": \"A\",\n \"step\": 30\n }\n ],\n \"thresholds\": [],\n \"timeFrom\": null,\n \"timeRegions\": [],\n \"timeShift\": null,\n \"title\": \"Network I/O\",\n \"tooltip\": {\n \"msResolution\": true,\n \"shared\": true,\n \"sort\": 0,\n \"value_type\": \"cumulative\"\n },\n \"type\": \"graph\",\n \"xaxis\": {\n \"buckets\": null,\n \"mode\": \"time\",\n \"name\": null,\n \"show\": true,\n \"values\": []\n },\n \"yaxes\": [\n {\n \"format\": \"bytes\",\n \"logBase\": 1,\n \"show\": true\n },\n {\n \"format\": \"short\",\n \"logBase\": 1,\n \"show\": true\n }\n ],\n \"yaxis\": {\n \"align\": false,\n \"alignLevel\": null\n }\n }\n ],\n \"refresh\": \"10s\",\n \"schemaVersion\": 18,\n \"style\": \"dark\",\n \"tags\": [\n \"service-catalog\",\n \"kyma\"\n ],\n \"templating\": {\n \"list\": [\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-apiserver\",\n \"value\": \"service-catalog-apiserver\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"apiserverdeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-apiserver\",\n \"value\": \"service-catalog-apiserver\"\n }\n ],\n \"query\": \"service-catalog-apiserver\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-controller-manager\",\n \"value\": \"service-catalog-controller-manager\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"controllerdeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-controller-manager\",\n \"value\": \"service-catalog-controller-manager\"\n }\n ],\n \"query\": \"service-catalog-controller-manager\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful-client\",\n \"value\": \"service-catalog-etcd-stateful-client\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"etcd_cluster\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful-client\",\n \"value\": \"service-catalog-etcd-stateful-client\"\n }\n ],\n \"query\": \"service-catalog-etcd-stateful-client\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n },\n {\n \"current\": {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful\",\n \"value\": \"service-catalog-etcd-stateful\"\n },\n \"hide\": 2,\n \"label\": null,\n \"name\": \"etcddeploy\",\n \"options\": [\n {\n \"selected\": true,\n \"text\": \"service-catalog-etcd-stateful\",\n \"value\": \"service-catalog-etcd-stateful\"\n }\n ],\n \"query\": \"service-catalog-etcd-stateful\",\n \"skipUrlSync\": false,\n \"type\": \"constant\"\n }\n ]\n },\n \"time\": {\n \"from\": \"now-1h\",\n \"to\": \"now\"\n },\n \"timepicker\": {\n \"refresh_intervals\": [\n \"5s\",\n \"10s\",\n \"30s\",\n \"1m\",\n \"5m\",\n \"15m\",\n \"30m\",\n \"1h\",\n \"2h\",\n \"1d\"\n ],\n \"time_options\": [\n \"5m\",\n \"15m\",\n \"1h\",\n \"6h\",\n \"12h\",\n \"24h\",\n \"2d\",\n \"7d\",\n \"30d\"\n ]\n },\n \"timezone\": \"\",\n \"title\": \"Kyma / Service Catalog Add-ons / Binding Usage Controller\",\n \"uid\": \"_MIdIJiZz\",\n \"version\": 1\n}", + }, + "kind": "ConfigMap", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "monitoring-grafana", + "grafana_dashboard": "1", + }, + "name": "service-binding-usage-controller-dashboard", + }, + }, + } + + // Unstructured "service-catalog-ui" + serviceCatalogUiUnstructuredConfigMap = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "data": map[string]interface{}{ + "config.js": "window.clusterConfig = {\n catalogUrl: '/home/environments/{CURRENT_ENV}/catalog',\n graphqlApiUrl: 'https://console-backend.ed200f3.dev.kyma.ondemand.com/graphql',\n subscriptionsApiUrl: 'wss://console-backend.ed200f3.dev.kyma.ondemand.com/graphql',\n};\n", + }, + "kind": "ConfigMap", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + }, + "name": "service-catalog-ui", + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredClusterRole = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "rbac.authorization.k8s.io/v1", + "kind": "ClusterRole", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "settings.svcat.k8s.io", + }, + "resources": []interface{}{ + "podpresets", + }, + "verbs": []interface{}{ + "create", "delete", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "apps", + }, + "resources": []interface{}{ + "deployments", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", "update", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "serverless.kyma-project.io", + }, + "resources": []interface{}{ + "functions", + }, + "verbs": []interface{}{ + "get", "list", "watch", "patch", "update", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "servicecatalog.kyma-project.io", + }, + "resources": []interface{}{ + "servicebindingusages", "usagekinds", + }, + "verbs": []interface{}{ + "get", "list", "watch", "create", "update", "delete", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "servicecatalog.k8s.io", + }, + "resources": []interface{}{ + "servicebindings", "serviceinstances", "clusterserviceclasses", "serviceclasses", + }, + "verbs": []interface{}{ + "get", "list", "watch", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resources": []interface{}{ + "events", + }, + "verbs": []interface{}{ + "patch", "create", + }, + }, map[string]interface{}{ + "apiGroups": []interface{}{ + "", + }, + "resourceNames": []interface{}{ + "service-binding-usage-controller-process-sbu-spec", + }, + "resources": []interface{}{ + "configmaps", + }, + "verbs": []interface{}{ + "get", "delete", "update", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredClusterRoleBinding = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "rbac.authorization.k8s.io/v1", + "kind": "ClusterRoleBinding", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "roleRef": map[string]interface{}{ + "apiGroup": "rbac.authorization.k8s.io", + "kind": "ClusterRole", + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "service-catalog-addons-service-binding-usage-controller", + "namespace": "kyma-system", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredRole = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "rbac.authorization.k8s.io/v1", + "kind": "Role", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui", + "namespace": "kyma-system", + }, + "rules": []interface{}{ + map[string]interface{}{ + "apiGroups": []interface{}{ + "extensions", "policy", + }, + "resourceNames": []interface{}{ + "service-catalog-addons-service-catalog-ui", + }, + "resources": []interface{}{ + "podsecuritypolicies", + }, + "verbs": []interface{}{ + "use", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredRoleBinding = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "rbac.authorization.k8s.io/v1", + "kind": "RoleBinding", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui", + "namespace": "kyma-system", + }, + "roleRef": map[string]interface{}{ + "apiGroup": "rbac.authorization.k8s.io", + "kind": "Role", + "name": "service-catalog-addons-service-catalog-ui", + }, + "subjects": []interface{}{ + map[string]interface{}{ + "kind": "ServiceAccount", + "name": "service-catalog-addons-service-catalog-ui", + "namespace": "kyma-system", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredService = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Service", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "ports": []interface{}{ + map[string]interface{}{ + "name": "http-metrics", + "port": 8080, + }, + }, + "selector": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredService = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Service", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-catalog-ui", + }, + "spec": map[string]interface{}{ + "ports": []interface{}{ + map[string]interface{}{ + "name": "http2", + "port": 80, + "protocol": "TCP", + "targetPort": 80, + }, + }, + "selector": map[string]interface{}{ + "app": "service-catalog-ui", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredDeployment = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "apps/v1", + "kind": "Deployment", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "replicas": 1, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "release": "service-catalog-addons", + }, + }, + "template": map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "sidecar.istio.io/inject": "true", + }, + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "kyma-project.io/component": "controller", + "release": "service-catalog-addons", + }, + }, + "spec": map[string]interface{}{ + "containers": []interface{}{ + map[string]interface{}{ + "env": []interface{}{ + map[string]interface{}{ + "name": "APP_LOGGER_LEVEL", + "value": "debug", + }, map[string]interface{}{ + "name": "APP_APPLIED_SBU_CONFIG_MAP_NAME", + "value": "service-binding-usage-controller-process-sbu-spec", + }, map[string]interface{}{ + "name": "APP_APPLIED_SBU_CONFIG_MAP_NAMESPACE", + "value": "kyma-system", + }, + }, + "image": "eu.gcr.io/kyma-project/service-binding-usage-controller:ef49b0f6", + "imagePullPolicy": "IfNotPresent", + "livenessProbe": map[string]interface{}{ + "httpGet": map[string]interface{}{ + "path": "/statusz", + "port": 8080, + }, + "initialDelaySeconds": 15, + "periodSeconds": 10, + "successThreshold": 1, + "timeoutSeconds": 2, + }, + "name": "service-binding-usage-controller", + "ports": []interface{}{ + map[string]interface{}{ + "containerPort": 8080, + }, + }, + "resources": map[string]interface{}{ + "limits": map[string]interface{}{ + "cpu": "100m", + "memory": "96Mi", + }, + "requests": map[string]interface{}{ + "cpu": "50m", + "memory": "48Mi", + }, + }, + "securityContext": map[string]interface{}{ + "allowPrivilegeEscalation": false, + "privileged": false, + }, + }, + }, + "priorityClassName": "kyma-system", + "securityContext": map[string]interface{}{ + "runAsUser": 2000, + }, + "serviceAccountName": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredDeployment = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "apps/v1", + "kind": "Deployment", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-catalog-ui", + }, + "spec": map[string]interface{}{ + "replicas": 1, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-ui", + "release": "service-catalog-addons", + }, + }, + "template": map[string]interface{}{ + "metadata": map[string]interface{}{ + "annotations": map[string]interface{}{ + "sidecar.istio.io/inject": "false", + }, + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "kyma-project.io/component": "frontend", + "release": "service-catalog-addons", + }, + }, + "spec": map[string]interface{}{ + "containers": []interface{}{ + map[string]interface{}{ + "image": "eu.gcr.io/kyma-project/service-catalog-ui:10709d94", + "imagePullPolicy": "IfNotPresent", + "name": "service-catalog-ui", + "ports": []interface{}{ + map[string]interface{}{ + "containerPort": 80, + }, + }, + "resources": map[string]interface{}{ + "limits": map[string]interface{}{ + "cpu": "60m", + "memory": "64Mi", + }, + "requests": map[string]interface{}{ + "cpu": "10m", + "memory": "16Mi", + }, + }, + "securityContext": map[string]interface{}{ + "allowPrivilegeEscalation": false, + "privileged": false, + }, + "volumeMounts": []interface{}{ + map[string]interface{}{ + "mountPath": "/var/public/config", + "name": "config", + }, + }, + }, + }, + "priorityClassName": "kyma-system", + "serviceAccountName": "service-catalog-addons-service-catalog-ui", + "volumes": []interface{}{ + map[string]interface{}{ + "configMap": map[string]interface{}{ + "items": []interface{}{ + map[string]interface{}{ + "key": "config.js", + "path": "config.js", + }, + }, + "name": "service-catalog-ui", + }, + "name": "config", + }, + }, + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui" + serviceCatalogAddonsServiceCatalogUiUnstructuredDestinationRule = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "DestinationRule", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-catalog-ui", + }, + "spec": map[string]interface{}{ + "host": "service-catalog-addons-service-catalog-ui.kyma-system.svc.cluster.local", + "trafficPolicy": map[string]interface{}{ + "tls": map[string]interface{}{ + "mode": "DISABLE", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredPeerAuthentication = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "security.istio.io/v1beta1", + "kind": "PeerAuthentication", + "metadata": map[string]interface{}{ + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "mtls": map[string]interface{}{ + "mode": "PERMISSIVE", + }, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-binding-usage-controller" + serviceCatalogAddonsServiceBindingUsageControllerUnstructuredServiceMonitor = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "monitoring.coreos.com/v1", + "kind": "ServiceMonitor", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + "chart": "service-binding-usage-controller-0.1.0", + "heritage": "Helm", + "prometheus": "monitoring", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-binding-usage-controller", + }, + "spec": map[string]interface{}{ + "endpoints": []interface{}{ + map[string]interface{}{ + "metricRelabelings": []interface{}{ + map[string]interface{}{ + "action": "keep", + "regex": "^(controller_runtime_reconcile_latency_sum|controller_runtime_reconcile_latency_count|controller_runtime_reconcile_queue_length|controller_runtime_reconcile_errors_total|go_gc_duration_seconds|go_goroutines|go_memstats_alloc_bytes|go_memstats_heap_alloc_bytes|go_memstats_heap_inuse_bytes|go_memstats_heap_sys_bytes|go_memstats_stack_inuse_bytes|go_threads|process_cpu_seconds_total|process_max_fds|process_open_fds|process_resident_memory_bytes|process_start_time_seconds|process_virtual_memory_bytes)$", + "sourceLabels": []interface{}{ + "__name__", + }, + }, + }, + "port": "http-metrics", + }, + }, + "namespaceSelector": map[string]interface{}{ + "matchNames": []interface{}{ + "kyma-system", + }, + }, + "selector": map[string]interface{}{ + "matchLabels": map[string]interface{}{ + "app": "service-catalog-addons-service-binding-usage-controller", + }, + }, + }, + }, + } + + // Unstructured "deployment" + deploymentUnstructuredUsageKind = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "servicecatalog.kyma-project.io/v1alpha1", + "kind": "UsageKind", + "metadata": map[string]interface{}{ + "name": "deployment", + }, + "spec": map[string]interface{}{ + "displayName": "Deployment", + "labelsPath": "spec.template.metadata.labels", + "resource": map[string]interface{}{ + "group": "apps", + "kind": "deployment", + "version": "v1", + }, + }, + }, + } + + // Unstructured "service-catalog-addons-service-catalog-ui-catalog" + serviceCatalogAddonsServiceCatalogUiCatalogUnstructuredVirtualService = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "networking.istio.io/v1alpha3", + "kind": "VirtualService", + "metadata": map[string]interface{}{ + "labels": map[string]interface{}{ + "app": "service-catalog-ui", + "chart": "service-catalog-ui-0.1.0", + "heritage": "Helm", + "release": "service-catalog-addons", + }, + "name": "service-catalog-addons-service-catalog-ui-catalog", + }, + "spec": map[string]interface{}{ + "gateways": []interface{}{ + "kyma-gateway", + }, + "hosts": []interface{}{ + "catalog.ed200f3.dev.kyma.ondemand.com", + }, + "http": []interface{}{ + map[string]interface{}{ + "match": []interface{}{ + map[string]interface{}{ + "uri": map[string]interface{}{ + "regex": "/.*", + }, + }, + }, + "route": []interface{}{ + map[string]interface{}{ + "destination": map[string]interface{}{ + "host": "service-catalog-addons-service-catalog-ui", + "port": map[string]interface{}{ + "number": 80, + }, + }, + }, + }, + }, + }, + }, + }, + } +) diff --git a/tests/output/ws-crd.yaml_basic.go b/tests/output/ws-crd.yaml_basic.go new file mode 100644 index 0000000..6e1f0bb --- /dev/null +++ b/tests/output/ws-crd.yaml_basic.go @@ -0,0 +1,19 @@ +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + +var exampleFooUnstructuredFoo = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "samplecontroller.k8s.io/v1alpha1", + "kind": "Foo", + "metadata": map[string]interface{}{ + "name": "example-foo", + }, + "spec": map[string]interface{}{ + "deploymentName": "example-foo", + "replicas": 1, + }, + }, +} diff --git a/tests/output/ws-crd.yaml_boilerplate.go b/tests/output/ws-crd.yaml_boilerplate.go new file mode 100644 index 0000000..6f30151 --- /dev/null +++ b/tests/output/ws-crd.yaml_boilerplate.go @@ -0,0 +1,23 @@ +/* +Boilerplate 2022 test. +*/ + +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + +var exampleFooUnstructuredFoo = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "samplecontroller.k8s.io/v1alpha1", + "kind": "Foo", + "metadata": map[string]interface{}{ + "name": "example-foo", + }, + "spec": map[string]interface{}{ + "deploymentName": "example-foo", + "replicas": 1, + }, + }, +} diff --git a/tests/output/ws-crd.yaml_only_meta.go b/tests/output/ws-crd.yaml_only_meta.go new file mode 100644 index 0000000..ac3ee31 --- /dev/null +++ b/tests/output/ws-crd.yaml_only_meta.go @@ -0,0 +1,15 @@ +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + +var exampleFooUnstructuredFoo = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "samplecontroller.k8s.io/v1alpha1", + "kind": "Foo", + "metadata": map[string]interface{}{ + "name": "example-foo", + }, + }, +} diff --git a/tests/output/ws-crd.yaml_unstructured.go b/tests/output/ws-crd.yaml_unstructured.go new file mode 100644 index 0000000..6e1f0bb --- /dev/null +++ b/tests/output/ws-crd.yaml_unstructured.go @@ -0,0 +1,19 @@ +// Code generated by reverse-kube-resource. DO NOT EDIT. + +package examples + +import v1unstructured "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + +var exampleFooUnstructuredFoo = v1unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "samplecontroller.k8s.io/v1alpha1", + "kind": "Foo", + "metadata": map[string]interface{}{ + "name": "example-foo", + }, + "spec": map[string]interface{}{ + "deploymentName": "example-foo", + "replicas": 1, + }, + }, +}