blob: bb8bf8cde1de0c27825b3c30792aa7588aefda0a [file] [log] [blame]
Scott Baker82b2b082018-04-16 16:02:14 -07001option app_label = "kubernetes";
2option name = "kubernetes";
3
4message KubernetesService (Service){
5 option verbose_name = "Kubernetes Service";
6
7}
8
Scott Baker4f5f1e22018-08-31 17:09:55 -07009message KubernetesResourceInstance (ServiceInstance){
Matteo Scandolod3301902019-06-06 15:42:02 -070010 option verbose_name = "Kubernetes Resource Instance";
11 option description = "An opaque-to-xos blob of yaml that is passed directly to kubectl";
12 option sync_implemented = "True";
Scott Bakerfdb10e12019-01-22 17:04:42 -080013
Matteo Scandolod3301902019-06-06 15:42:02 -070014 optional string resource_definition = 3 [
15 help_text = "yaml containing kubernetes resources",
16 max_length = 65535];
17 optional string kubectl_state = 4 [
18 help_text = "Most recent kubectl action completed by synchronizer",
19 choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))",
20 feedback_state = True,
21 max_length = 32];
Scott Baker1a2ee302018-08-27 16:16:19 -070022}
23
Scott Baker3fd18e52018-04-17 09:18:21 -070024message KubernetesServiceInstance (ComputeServiceInstance){
Matteo Scandolod3301902019-06-06 15:42:02 -070025 option verbose_name = "Kubernetes Service Instance";
26 option description = "A ComputeServiceInstance in kubernetes, usually in the form of a pod";
27 option sync_implemented = "True";
Scott Bakerfdb10e12019-01-22 17:04:42 -080028
Matteo Scandolod3301902019-06-06 15:42:02 -070029 optional string pod_ip = 1 [
30 help_text = "IP address of pod",
31 max_length=32];
32 required bool need_event = 2 [
33 help_text = "True if a kafka event needs to be sent by the pull step",
34 default = False];
35 optional string last_event_sent = 3 [
36 help_text = "Type of last event sent",
37 choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))",
38 max_length=32];
Scott Baker82b2b082018-04-16 16:02:14 -070039}
Scott Bakerac43a742018-05-07 16:54:03 -070040
41message KubernetesData (XOSBase) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080042 option description = "Base class for Kubernetes ConfigMaps, Secrets, and similar models";
43
Scott Baker95c3dfb2019-03-07 11:24:11 -080044 required string name = 1 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080045 help_text = "Name of this data store",
Scott Baker95c3dfb2019-03-07 11:24:11 -080046 max_length=256];
Scott Bakerfdb10e12019-01-22 17:04:42 -080047 optional string data = 2 [
Scott Bakerc11bb7c2019-06-06 14:18:20 -070048 help_text = "Set of key,value pairs encoded as a json dictionary",
49 text = True];
Scott Bakerfdb10e12019-01-22 17:04:42 -080050 required manytoone trust_domain->TrustDomain:kubernetes_configmaps = 3:1003 [
51 help_text = "Trust domain this data resides in",
Scott Baker95c3dfb2019-03-07 11:24:11 -080052 db_index = True];
Scott Bakerac43a742018-05-07 16:54:03 -070053}
54
55message KubernetesConfigMap (KubernetesData) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080056 option description = "A Kubernetes ConfigMap, holding (name, value) data in insecure manner";
Matteo Scandolod3301902019-06-06 15:42:02 -070057 option sync_implemented = "True";
Scott Bakerac43a742018-05-07 16:54:03 -070058}
59
60message KubernetesSecret (KubernetesData) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080061 option description = "A kubernetes Secret, hodling (name, value) data in a secure manner";
Scott Bakerac43a742018-05-07 16:54:03 -070062}
63
64message KubernetesSecretVolumeMount (XOSBase) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080065 option description = "Mounts a KubernetesSecret to a KubernetesServiceInstance";
66
67 required manytoone secret->KubernetesSecret:kubernetes_secret_volume_mounts = 1:1001 [
68 help_text = "Secret to mount",
Scott Baker871a0802019-03-12 15:23:57 -070069 db_index = True];
Scott Bakerfdb10e12019-01-22 17:04:42 -080070 required manytoone service_instance->KubernetesServiceInstance:kubernetes_secret_volume_mounts = 2 [
71 help_text = "Service instance in which to mount secret",
Scott Baker871a0802019-03-12 15:23:57 -070072 db_index = True];
Scott Baker95c3dfb2019-03-07 11:24:11 -080073 required string mount_path = 3 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080074 help_text = "Path to mount secret",
Scott Baker95c3dfb2019-03-07 11:24:11 -080075 max_length=1024];
Scott Bakerfdb10e12019-01-22 17:04:42 -080076 optional string sub_path = 4 [
77 help_text = "Subpath within secret to mount",
Scott Baker95c3dfb2019-03-07 11:24:11 -080078 max_length=1024];
Scott Bakerac43a742018-05-07 16:54:03 -070079}
80
81message KubernetesConfigVolumeMount (XOSBase) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080082 option description = "Mounts a KubernetesConfigMap to a KubernetesServiceInstance";
83
84 required manytoone config->KubernetesConfigMap:kubernetes_config_voume_mounts = 1:1001 [
85 help_text = "Config to mount",
Scott Baker871a0802019-03-12 15:23:57 -070086 db_index = True];
Scott Bakerfdb10e12019-01-22 17:04:42 -080087 required manytoone service_instance->KubernetesServiceInstance:kubernetes_config_volume_mounts = 2:1001 [
88 help_text = "Service instance in which to mount config",
Scott Baker871a0802019-03-12 15:23:57 -070089 db_index = True];
Scott Baker95c3dfb2019-03-07 11:24:11 -080090 required string mount_path = 3 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080091 help_text = "Path to mount secret",
Scott Baker95c3dfb2019-03-07 11:24:11 -080092 max_length=1024];
Scott Bakerfdb10e12019-01-22 17:04:42 -080093 optional string sub_path = 4 [
94 help_text = "Subpath within secret to mount",
Scott Baker95c3dfb2019-03-07 11:24:11 -080095 max_length=1024];
Scott Bakerac43a742018-05-07 16:54:03 -070096}
97