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){ |
Scott Baker | 1a2ee30 | 2018-08-27 16:16:19 -0700 | [diff] [blame] | 10 | option verbose_name = "Kubernetes Resource Instance"; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 11 | option description = "An opaque-to-xos blob of yaml that is passed directly to kubectl"; |
| 12 | |
| 13 | optional string resource_definition = 3 [ |
| 14 | help_text = "yaml containing kubernetes resources", |
| 15 | max_length = 65535]; |
| 16 | optional string kubectl_state = 4 [ |
| 17 | help_text = "Most recent kubectl action completed by synchronizer", |
| 18 | choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 19 | feedback_state = True, |
| 20 | max_length = 32]; |
Scott Baker | 1a2ee30 | 2018-08-27 16:16:19 -0700 | [diff] [blame] | 21 | } |
| 22 | |
Scott Baker | 3fd18e5 | 2018-04-17 09:18:21 -0700 | [diff] [blame] | 23 | message KubernetesServiceInstance (ComputeServiceInstance){ |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 24 | option verbose_name = "Kubernetes Service Instance"; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 25 | option description = "A ComputeServiceInstance in kubernetes, usually in the form of a pod"; |
| 26 | |
| 27 | optional string pod_ip = 1 [ |
| 28 | help_text = "IP address of pod", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 29 | max_length=32]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 30 | required bool need_event = 2 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 31 | help_text = "True if a kafka event needs to be sent by the pull step", |
| 32 | default = False]; |
| 33 | optional string last_event_sent = 3 [ |
| 34 | help_text = "Type of last event sent", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 35 | choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 36 | max_length=32]; |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 37 | } |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 38 | |
| 39 | message KubernetesData (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 40 | option description = "Base class for Kubernetes ConfigMaps, Secrets, and similar models"; |
| 41 | |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 42 | required string name = 1 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 43 | help_text = "Name of this data store", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 44 | max_length=256]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 45 | optional string data = 2 [ |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 46 | help_text = "Set of key,value pairs encoded as a json dictionary"]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 47 | required manytoone trust_domain->TrustDomain:kubernetes_configmaps = 3:1003 [ |
| 48 | help_text = "Trust domain this data resides in", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 49 | db_index = True]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | message KubernetesConfigMap (KubernetesData) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 53 | option description = "A Kubernetes ConfigMap, holding (name, value) data in insecure manner"; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | message KubernetesSecret (KubernetesData) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 57 | 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] | 58 | } |
| 59 | |
| 60 | message KubernetesSecretVolumeMount (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 61 | option description = "Mounts a KubernetesSecret to a KubernetesServiceInstance"; |
| 62 | |
| 63 | required manytoone secret->KubernetesSecret:kubernetes_secret_volume_mounts = 1:1001 [ |
| 64 | help_text = "Secret to mount", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 65 | db_index = True]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 66 | required manytoone service_instance->KubernetesServiceInstance:kubernetes_secret_volume_mounts = 2 [ |
| 67 | help_text = "Service instance in which to mount secret", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 68 | db_index = True]; |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 69 | required string mount_path = 3 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 70 | help_text = "Path to mount secret", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 71 | max_length=1024]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 72 | optional string sub_path = 4 [ |
| 73 | help_text = "Subpath within secret to mount", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 74 | max_length=1024]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | message KubernetesConfigVolumeMount (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 78 | option description = "Mounts a KubernetesConfigMap to a KubernetesServiceInstance"; |
| 79 | |
| 80 | required manytoone config->KubernetesConfigMap:kubernetes_config_voume_mounts = 1:1001 [ |
| 81 | help_text = "Config to mount", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 82 | db_index = True]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 83 | required manytoone service_instance->KubernetesServiceInstance:kubernetes_config_volume_mounts = 2:1001 [ |
| 84 | help_text = "Service instance in which to mount config", |
Scott Baker | 871a080 | 2019-03-12 15:23:57 -0700 | [diff] [blame] | 85 | db_index = True]; |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 86 | required string mount_path = 3 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 87 | help_text = "Path to mount secret", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 88 | max_length=1024]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 89 | optional string sub_path = 4 [ |
| 90 | help_text = "Subpath within secret to mount", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame] | 91 | max_length=1024]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 92 | } |
| 93 | |