unip-controller/deploy/crd/repository.yaml
2025-04-15 20:56:15 +03:00

148 lines
No EOL
7.4 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
# имя, должно соответствовать спецификации ниже, и быть в формате <plural>.<group>
name: repositories.unified-platform.cs.hse.ru
spec:
# имя группы, используемое в REST API: /apis/<group>/<version>
group: unified-platform.cs.hse.ru
# Список версий, поддерживаемых этим определением CustomResourceDefinition
versions:
- name: v1
# Каждая версия может быть влкючена или выключена при помощи served флага.
served: true
# Только одна версия может быть отмечена как storage версия.
storage: true
schema:
openAPIV3Schema:
type: object
description: Repository является определением ресурса Repository.
Repository - репозиторий платформы.
properties:
spec:
type: object
description: RepositorySpec определяет желаемое состояние репозитория.
Содержит спецификацию репозитория одного из поддерживаемых типов.
properties:
imageRegistry:
type: object
description: ImageRegistry определяет параметры репозитория типа реестр образов.
properties:
host:
type: string
description: Хост репозитория.
dockerDockerConfigJsonCredentials:
type: string
description: Имя секрета с реквизитами доступа в формате DockerConfigJsonCredentials
к реестру образов Docker.
required: ["host"]
oneOf:
- properties:
dockerDockerConfigJsonCredentials: {}
required: ["dockerDockerConfigJsonCredentials"]
packageRegistry:
type: object
description: PackageRegistry определяет параметры репозитория типа реестр пакетов.
properties:
host:
type: string
description: Хост репозитория.
pythonHTTPBasedURLCredentials:
type: string
description: Имя секрета с реквизитами доступа в формате HTTPBasedURLCredentials
к реестру Python пакетов.
required: ["host"]
oneOf:
- properties:
pythonHTTPBasedURLCredentials: {}
required: ["pythonHTTPBasedURLCredentials"]
sourceRepository:
type: object
description: SourceRepository определяет параметры репозитория типа репозиторий
исходного кода.
properties:
host:
type: string
description: Хост репозитория.
gitHTTPBasedURLCredentials:
type: string
description: Имя секрета с реквизитами доступа в формате HTTPBasedURLCredentials
к Git репозиторию исходного кода.
required: ["host"]
oneOf:
- properties:
gitHTTPBasedURLCredentials: {}
required: ["gitHTTPBasedURLCredentials"]
userRegistry:
type: object
description: UserRegistry определяет параметры репозитория типа реестр пользователей.
properties:
host:
type: string
description: Хост реестра пользователей.
keycloak:
type: object
description: Реестр пользователей, реализуемый keycloak
properties:
robots:
type: object
description: Робот аккаунты реестра пользователей.
properties:
secretRef:
type: object
description: Secret с именами робот аккаунтов.
properties:
name:
type: string
description: Имя Secret
required: ["name"]
x-kubernetes-validations:
- rule: "(has(oldSelf.keycloak) && has(self.keycloak)) ||
(!has(oldSelf.keycloak) && !has(self.keycloak))"
message: "repository type (userRegistry.keycloak) should not change"
oneOf:
- properties:
imageRegistry: {}
required: ["imageRegistry"]
- properties:
packageRegistry: {}
required: ["packageRegistry"]
- properties:
sourceRepository: {}
required: ["sourceRepository"]
- properties:
sourceRepository: {}
required: ["userRegistry"]
x-kubernetes-validations:
- rule: "(has(oldSelf.userRegistry) && has(self.userRegistry)) ||
(!has(oldSelf.userRegistry) && !has(self.userRegistry))"
message: "repository type (userRegistry) should not change"
status:
x-kubernetes-preserve-unknown-fields: true
type: object
properties:
userRegistry:
type: object
properties:
keycloak:
type: object
properties:
masterGroupId:
type: string
subresources:
status: {}
# Namespaced or Cluster
scope: Namespaced
names:
# имя во множественном числе, используемое в URL: /apis/<group>/<version>/<plural>
plural: repositories
# имя в единственном числе, используемое в CLI и для отображения
singular: repository
# вид, обычно CamelCased в единственном числе, указывается в манифестах ресурсов
kind: Repository
# короткие имена для использования в операциях с ресурсами в CLI
shortNames:
- uniprep
- unipreps
categories:
- all