apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: # имя, должно соответствовать спецификации ниже, и быть в формате . name: componentlinks.unified-platform.cs.hse.ru spec: # имя группы, используемое в REST API: /apis// group: unified-platform.cs.hse.ru # Список версий, поддерживаемых этим определением CustomResourceDefinition versions: - name: v1 # Каждая версия может быть влкючена или выключена при помощи served флага. served: true # Только одна версия может быть отмечена как storage версия. storage: true schema: openAPIV3Schema: description: ComponentLink является определением ресурса ComponentLink. ComponentLink - ссылка для доступа между компонентами. type: object properties: spec: type: object description: ComponentLinkSpec определяет желаемое состояние ящика. Содержит спецификацию ссылки, что включает определение концов ссылки, реквизитов и параметров доступа. properties: platformAppName: type: string description: Имя приложения, к которому применяется ссылка. handle: type: object description: Handle определяет часть ссылки обработчика. properties: {} targets: type: array description: Targets определяют часть ссылки цель. items: type: object properties: name: type: string description: Ресурс, на который указывает ссылка. platformAppName: type: string description: Имя приложения цели. Если не задано, используется имя приложения из атрибута spec.platformAppName. kind: type: string description: Вид ресурса, на который указывает ссылка. Если не задано, то считается, что ссылка указывает на APIComponent. required: ["name"] config: type: object description: Config определяет вид ссылки конфигурация. properties: {} secretRef: type: object description: Secret, ассоциированный со ссылкой. properties: name: type: string description: Имя Secret. configMapRef: type: object properties: name: type: string description: Имя конфигурации ConfigMap с настройками. required: ["name"] keycloakGroup: type: object description: Keycloak группа. properties: userRegistryRef: type: object description: Ссылка на объект вида Repository типа реестр пользователей. properties: name: type: string description: Имя реестра пользователей. required: ["name"] x-kubernetes-validations: - rule: "oldSelf.name == self.name" message: "userRegistryRef.name should not change" x-kubernetes-validations: - rule: "(has(oldSelf.userRegistryRef) && has(self.userRegistryRef)) || (!has(oldSelf.userRegistryRef) && !has(self.userRegistryRef))" message: "userRegistryRef should not change" basicAuth: type: object description: Basic аутентификация. properties: {} allOf: - properties: platformAppName: {} required: ["platformAppName"] - oneOf: - properties: handle: {} required: ["handle"] - anyOf: - properties: targets: {} required: ["targets"] - properties: targets: {} keycloakGroup: {} required: ["targets", "keycloakGroup"] - properties: targets: {} basicAuth: {} required: ["targets", "basicAuth"] - allOf: - properties: config: {} required: ["config"] - anyOf: - properties: secretRef: {} required: ["secretRef"] - properties: configMapRef: {} required: ["configMapRef"] x-kubernetes-validations: - rule: "(has(oldSelf.config) && has(self.config)) || (!has(oldSelf.config) && !has(self.config))" message: "ComponentLink type (config) should not change" - rule: "(has(oldSelf.keycloakGroup) && has(self.keycloakGroup)) || (!has(oldSelf.keycloakGroup) && !has(self.keycloakGroup))" message: "ComponentLink type (keycloakGroup) should not change" - rule: "(has(oldSelf.basicAuth) && has(self.basicAuth)) || (!has(oldSelf.basicAuth) && !has(self.basicAuth))" message: "ComponentLink type (basicAuth) should not change" status: x-kubernetes-preserve-unknown-fields: true type: object description: ComponentLinkStatus хранит фактическое состояние ссылки. properties: keycloakGroup: type: object description: Статус для ComponentLink типа KeycloakGroup. properties: groupIds: type: object description: Идентификаторы группы Keycloak в различных реалмах. additionalProperties: type: string conditions: type: array default: [] description: Список наблюдаемых в настоящий момент условий. items: maxItems: 32 type: object properties: type: type: string description: Тип условия. conditionStatus: type: string description: Статус условия "True", "False" или "Unknown". observedGeneration: type: integer description: Содержит .metadata.generation, при котором условие было установлено. lastTransitionTime: type: string description: Время последнего изменения статуса условия в формате ISO. reason: type: string description: Содержит программный идентификатор, являющийся индикатором причины последнего изменения статуса условия. message: type: string description: Подробное описание условия, понятное человеку. required: ["type", "conditionStatus", "lastTransitionTime", "reason", "message"] subresources: status: {} # Namespaced или Cluster scope: Namespaced names: # имя во множественном числе, используемое в URL: /apis/// plural: componentlinks # имя в единственном числе, используемое в CLI и для отображения singular: componentlink # вид, обычно CamelCased в единственном числе, указывается в манифестах ресурсов kind: ComponentLink # короткие имена для использования в операциях с ресурсами в CLI shortNames: - cmplnk - cmplnks categories: - all