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