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'))", |
| 19 | db_index = False, |
| 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){ |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 25 | option verbose_name = "Kubernetes Service Instance"; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 26 | option description = "A ComputeServiceInstance in kubernetes, usually in the form of a pod"; |
| 27 | |
| 28 | optional string pod_ip = 1 [ |
| 29 | help_text = "IP address of pod", |
| 30 | blank = True, |
| 31 | db_index = False, |
| 32 | max_length=32, |
| 33 | null = True]; |
| 34 | required bool need_event = 2 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 35 | help_text = "True if a kafka event needs to be sent by the pull step", |
| 36 | default = False]; |
| 37 | optional string last_event_sent = 3 [ |
| 38 | help_text = "Type of last event sent", |
| 39 | blank = True, |
| 40 | choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))", |
| 41 | db_index = False, |
| 42 | max_length=32, |
| 43 | null = True]; |
Scott Baker | 82b2b08 | 2018-04-16 16:02:14 -0700 | [diff] [blame] | 44 | } |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 45 | |
| 46 | message KubernetesData (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 47 | option description = "Base class for Kubernetes ConfigMaps, Secrets, and similar models"; |
| 48 | |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 49 | required string name = 1 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 50 | help_text = "Name of this data store", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 51 | db_index = False, |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 52 | max_length=256]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 53 | optional string data = 2 [ |
| 54 | help_text = "Set of key,value pairs encoded as a json dictionary", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 55 | db_index = False]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 56 | required manytoone trust_domain->TrustDomain:kubernetes_configmaps = 3:1003 [ |
| 57 | help_text = "Trust domain this data resides in", |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 58 | db_index = True]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | message KubernetesConfigMap (KubernetesData) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 62 | option description = "A Kubernetes ConfigMap, holding (name, value) data in insecure manner"; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | message KubernetesSecret (KubernetesData) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 66 | 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] | 67 | } |
| 68 | |
| 69 | message KubernetesSecretVolumeMount (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 70 | option description = "Mounts a KubernetesSecret to a KubernetesServiceInstance"; |
| 71 | |
| 72 | required manytoone secret->KubernetesSecret:kubernetes_secret_volume_mounts = 1:1001 [ |
| 73 | help_text = "Secret to mount", |
| 74 | blank = False, |
| 75 | db_index = True, |
| 76 | null = False]; |
| 77 | required manytoone service_instance->KubernetesServiceInstance:kubernetes_secret_volume_mounts = 2 [ |
| 78 | help_text = "Service instance in which to mount secret", |
| 79 | blank = False, |
| 80 | db_index = True, |
| 81 | null = False]; |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 82 | required string mount_path = 3 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 83 | help_text = "Path to mount secret", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 84 | db_index = False, |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 85 | max_length=1024]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 86 | optional string sub_path = 4 [ |
| 87 | help_text = "Subpath within secret to mount", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 88 | db_index = False, |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 89 | max_length=1024]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | message KubernetesConfigVolumeMount (XOSBase) { |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 93 | option description = "Mounts a KubernetesConfigMap to a KubernetesServiceInstance"; |
| 94 | |
| 95 | required manytoone config->KubernetesConfigMap:kubernetes_config_voume_mounts = 1:1001 [ |
| 96 | help_text = "Config to mount", |
| 97 | blank = False, |
| 98 | db_index = True, |
| 99 | null = False]; |
| 100 | required manytoone service_instance->KubernetesServiceInstance:kubernetes_config_volume_mounts = 2:1001 [ |
| 101 | help_text = "Service instance in which to mount config", |
| 102 | blank = False, |
| 103 | db_index = True, |
| 104 | null = False]; |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 105 | required string mount_path = 3 [ |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 106 | help_text = "Path to mount secret", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 107 | db_index = False, |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 108 | max_length=1024]; |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 109 | optional string sub_path = 4 [ |
| 110 | help_text = "Subpath within secret to mount", |
Scott Baker | fdb10e1 | 2019-01-22 17:04:42 -0800 | [diff] [blame] | 111 | db_index = False, |
Scott Baker | 95c3dfb | 2019-03-07 11:24:11 -0800 | [diff] [blame^] | 112 | max_length=1024]; |
Scott Baker | ac43a74 | 2018-05-07 16:54:03 -0700 | [diff] [blame] | 113 | } |
| 114 | |