Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 1 | option app_label = "kubernetes"; |
| 2 | option name = "kubernetes"; |
| 3 | |
| 4 | message KubernetesService (Service){ |
| 5 | option verbose_name = "Kubernetes Service"; |
| 6 | |
| 7 | } |
| 8 | |
Scott Baker | 4f5f1e2 | 2018-08-31 17:09:55 -0700 | [diff] [blame] | 9 | message KubernetesResourceInstance (ServiceInstance){ |
Matteo Scandolo | d330190 | 2019-06-06 15:42:02 -0700 | [diff] [blame^] | 10 | 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 Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 13 | |
Matteo Scandolo | d330190 | 2019-06-06 15:42:02 -0700 | [diff] [blame^] | 14 | 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 Baker | 1a2ee30 | 2018-08-27 16:16:19 -0700 | [diff] [blame] | 22 | } |
| 23 | |
Scott Baker | 3fd18e5 | 2018-04-17 09:18:21 -0700 | [diff] [blame] | 24 | message KubernetesServiceInstance (ComputeServiceInstance){ |
Matteo Scandolo | d330190 | 2019-06-06 15:42:02 -0700 | [diff] [blame^] | 25 | 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 Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 28 | |
Matteo Scandolo | d330190 | 2019-06-06 15:42:02 -0700 | [diff] [blame^] | 29 | 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 Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 39 | } |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 40 | |
| 41 | message KubernetesData (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 42 | option description = "Base class for Kubernetes ConfigMaps, Secrets, and similar models"; |
| 43 | |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 44 | required string name = 1 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 45 | help_text = "Name of this data store", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 46 | max_length=256]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 47 | optional string data = 2 [ |
Scott Baker | c11bb7c | 2019-06-06 14:18:20 -0700 | [diff] [blame] | 48 | help_text = "Set of key,value pairs encoded as a json dictionary", |
| 49 | text = True]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 50 | required manytoone trust_domain->TrustDomain:kubernetes_configmaps = 3:1003 [ |
| 51 | help_text = "Trust domain this data resides in", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 52 | db_index = True]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 53 | } |
| 54 | |
| 55 | message KubernetesConfigMap (KubernetesData) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 56 | option description = "A Kubernetes ConfigMap, holding (name, value) data in insecure manner"; |
Matteo Scandolo | d330190 | 2019-06-06 15:42:02 -0700 | [diff] [blame^] | 57 | option sync_implemented = "True"; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 58 | } |
| 59 | |
| 60 | message KubernetesSecret (KubernetesData) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 61 | option description = "A kubernetes Secret, hodling (name, value) data in a secure manner"; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | message KubernetesSecretVolumeMount (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 65 | 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 Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 69 | db_index = True]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 70 | required manytoone service_instance->KubernetesServiceInstance:kubernetes_secret_volume_mounts = 2 [ |
| 71 | help_text = "Service instance in which to mount secret", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 72 | db_index = True]; |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 73 | required string mount_path = 3 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 74 | help_text = "Path to mount secret", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 75 | max_length=1024]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 76 | optional string sub_path = 4 [ |
| 77 | help_text = "Subpath within secret to mount", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 78 | max_length=1024]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | message KubernetesConfigVolumeMount (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 82 | 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 Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 86 | db_index = True]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 87 | required manytoone service_instance->KubernetesServiceInstance:kubernetes_config_volume_mounts = 2:1001 [ |
| 88 | help_text = "Service instance in which to mount config", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 89 | db_index = True]; |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 90 | required string mount_path = 3 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 91 | help_text = "Path to mount secret", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 92 | max_length=1024]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 93 | optional string sub_path = 4 [ |
| 94 | help_text = "Subpath within secret to mount", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 95 | max_length=1024]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 96 | } |
| 97 | |