|
| 1 | +apiVersion: apiextensions.k8s.io/v1 |
| 2 | +kind: CustomResourceDefinition |
| 3 | +metadata: |
| 4 | + name: dynamicresourcelifecycles.boskos.k8s.io |
| 5 | + annotations: |
| 6 | + api-approved.kubernetes.io: https://github.com/kubernetes-sigs/boskos/pull/105 |
| 7 | +spec: |
| 8 | + group: boskos.k8s.io |
| 9 | + names: |
| 10 | + kind: DRLCObject |
| 11 | + listKind: DRLCObjectList |
| 12 | + plural: dynamicresourcelifecycles |
| 13 | + singular: dynamicresourcelifecycle |
| 14 | + scope: Namespaced |
| 15 | + versions: |
| 16 | + - name: v1 |
| 17 | + served: true |
| 18 | + storage: true |
| 19 | + additionalPrinterColumns: |
| 20 | + - name: Type |
| 21 | + type: string |
| 22 | + description: The dynamic resource type. |
| 23 | + jsonPath: .spec.config.type |
| 24 | + - name: Min-Count |
| 25 | + type: integer |
| 26 | + description: The minimum count requested. |
| 27 | + jsonPath: .spec.min-count |
| 28 | + - name: Max-Count |
| 29 | + type: integer |
| 30 | + description: The maximum count requested. |
| 31 | + jsonPath: .spec.max-count |
| 32 | + schema: |
| 33 | + openAPIV3Schema: |
| 34 | + description: Defines the lifecycle of a dynamic resource. All |
| 35 | + Resource of a given type will be constructed using the same |
| 36 | + configuration |
| 37 | + type: object |
| 38 | + properties: |
| 39 | + spec: |
| 40 | + type: object |
| 41 | + properties: |
| 42 | + state: |
| 43 | + type: string |
| 44 | + max-count: |
| 45 | + description: Maxiumum number of resources expected. This |
| 46 | + maximum may be temporarily exceeded while resources are in |
| 47 | + the process of being deleted, though this is only expected |
| 48 | + when MaxCount is lowered. |
| 49 | + type: integer |
| 50 | + format: int32 |
| 51 | + min-count: |
| 52 | + description: Minimum number of resources to be used as a |
| 53 | + buffer. Resources in the process of being deleted and |
| 54 | + cleaned up are included in this count. |
| 55 | + type: integer |
| 56 | + format: int32 |
| 57 | + lifespan: |
| 58 | + description: Lifespan of a resource, time after which the |
| 59 | + resource should be reset |
| 60 | + type: integer |
| 61 | + format: int64 |
| 62 | + config: |
| 63 | + description: Config information about how to create the |
| 64 | + object |
| 65 | + type: object |
| 66 | + properties: |
| 67 | + type: |
| 68 | + description: The dynamic resource type |
| 69 | + type: string |
| 70 | + content: |
| 71 | + type: string |
| 72 | + needs: |
| 73 | + description: Define the resource needs to create the object |
| 74 | + type: object |
| 75 | + x-kubernetes-preserve-unknown-fields: true |
| 76 | +--- |
| 77 | +apiVersion: apiextensions.k8s.io/v1 |
| 78 | +kind: CustomResourceDefinition |
| 79 | +metadata: |
| 80 | + name: resources.boskos.k8s.io |
| 81 | + annotations: |
| 82 | + api-approved.kubernetes.io: https://github.com/kubernetes-sigs/boskos/pull/105 |
| 83 | +spec: |
| 84 | + group: boskos.k8s.io |
| 85 | + names: |
| 86 | + kind: ResourceObject |
| 87 | + listKind: ResourceObjectList |
| 88 | + plural: resources |
| 89 | + singular: resource |
| 90 | + scope: Namespaced |
| 91 | + versions: |
| 92 | + - name: v1 |
| 93 | + served: true |
| 94 | + storage: true |
| 95 | + additionalPrinterColumns: |
| 96 | + - name: Type |
| 97 | + type: string |
| 98 | + description: The resource type. |
| 99 | + jsonPath: .spec.type |
| 100 | + - name: State |
| 101 | + type: string |
| 102 | + description: The current state of the resource. |
| 103 | + jsonPath: .status.state |
| 104 | + - name: Owner |
| 105 | + type: string |
| 106 | + description: The current owner of the resource. |
| 107 | + jsonPath: .status.owner |
| 108 | + - name: Last-Updated |
| 109 | + type: date |
| 110 | + jsonPath: .status.lastUpdate |
| 111 | + schema: |
| 112 | + openAPIV3Schema: |
| 113 | + description: Abstracts any resource type that can be tracked by boskos |
| 114 | + type: object |
| 115 | + properties: |
| 116 | + spec: |
| 117 | + description: Holds information that are not likely to change |
| 118 | + type: object |
| 119 | + properties: |
| 120 | + type: |
| 121 | + type: string |
| 122 | + status: |
| 123 | + description: Holds information that are likely to change |
| 124 | + type: object |
| 125 | + properties: |
| 126 | + state: |
| 127 | + type: string |
| 128 | + owner: |
| 129 | + type: string |
| 130 | + lastUpdate: |
| 131 | + type: string |
| 132 | + format: date-time |
| 133 | + userData: |
| 134 | + type: object |
| 135 | + x-kubernetes-preserve-unknown-fields: true |
| 136 | + expirationDate: |
| 137 | + type: string |
| 138 | + format: date-time |
| 139 | +--- |
| 140 | +kind: ClusterRole |
| 141 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 142 | +metadata: |
| 143 | + name: boskos |
| 144 | +rules: |
| 145 | +- apiGroups: ["boskos.k8s.io"] |
| 146 | + verbs: ["*"] |
| 147 | + resources: ["*"] |
| 148 | +--- |
| 149 | +kind: ServiceAccount |
| 150 | +apiVersion: v1 |
| 151 | +metadata: |
| 152 | + name: boskos |
| 153 | + namespace: test-pods |
| 154 | +--- |
| 155 | +kind: ClusterRoleBinding |
| 156 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 157 | +metadata: |
| 158 | + name: boskos |
| 159 | +subjects: |
| 160 | +- kind: ServiceAccount |
| 161 | + name: boskos |
| 162 | + namespace: test-pods |
| 163 | +roleRef: |
| 164 | + kind: ClusterRole |
| 165 | + name: boskos |
| 166 | + apiGroup: rbac.authorization.k8s.io |
| 167 | +--- |
| 168 | +apiVersion: apps/v1 |
| 169 | +kind: Deployment |
| 170 | +metadata: |
| 171 | + name: boskos |
| 172 | + namespace: test-pods |
| 173 | +spec: |
| 174 | + replicas: 1 # one canonical source of resources |
| 175 | + selector: |
| 176 | + matchLabels: |
| 177 | + app: boskos |
| 178 | + template: |
| 179 | + metadata: |
| 180 | + labels: |
| 181 | + app: boskos |
| 182 | + namespace: test-pods |
| 183 | + spec: |
| 184 | + serviceAccountName: boskos |
| 185 | + terminationGracePeriodSeconds: 30 |
| 186 | + containers: |
| 187 | + - name: boskos |
| 188 | + image: gcr.io/k8s-staging-boskos/boskos:v20211118-344faec |
| 189 | + args: |
| 190 | + - --config=/etc/config/boskos-resources.yaml |
| 191 | + - --namespace=test-pods |
| 192 | + ports: |
| 193 | + - containerPort: 8080 |
| 194 | + protocol: TCP |
| 195 | + volumeMounts: |
| 196 | + - name: boskos-config |
| 197 | + mountPath: /etc/config |
| 198 | + readOnly: true |
| 199 | + volumes: |
| 200 | + - name: boskos-config |
| 201 | + configMap: |
| 202 | + name: resources |
| 203 | +--- |
| 204 | +apiVersion: v1 |
| 205 | +kind: Service |
| 206 | +metadata: |
| 207 | + name: boskos |
| 208 | + namespace: test-pods |
| 209 | +spec: |
| 210 | + selector: |
| 211 | + app: boskos |
| 212 | + ports: |
| 213 | + - name: default |
| 214 | + protocol: TCP |
| 215 | + port: 80 |
| 216 | + targetPort: 8080 |
0 commit comments