blob: dfcc07294374540fe8073e3ce6e5100bbf6626f9 [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){
Scott Baker1a2ee302018-08-27 16:16:19 -070010 option verbose_name = "Kubernetes Resource Instance";
Scott Bakerfdb10e12019-01-22 17:04:42 -080011 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 Bakerfdb10e12019-01-22 17:04:42 -080019 feedback_state = True,
20 max_length = 32];
Scott Baker1a2ee302018-08-27 16:16:19 -070021}
22
Scott Baker3fd18e52018-04-17 09:18:21 -070023message KubernetesServiceInstance (ComputeServiceInstance){
Scott Baker82b2b082018-04-16 16:02:14 -070024 option verbose_name = "Kubernetes Service Instance";
Scott Bakerfdb10e12019-01-22 17:04:42 -080025 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 Baker871a0802019-03-12 15:23:57 -070029 max_length=32];
Scott Bakerfdb10e12019-01-22 17:04:42 -080030 required bool need_event = 2 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080031 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 Bakerfdb10e12019-01-22 17:04:42 -080035 choices = "(('created', 'CREATED'), ('updated', 'UPDATED'), ('deleted', 'DELETED'))",
Scott Baker871a0802019-03-12 15:23:57 -070036 max_length=32];
Scott Baker82b2b082018-04-16 16:02:14 -070037}
Scott Bakerac43a742018-05-07 16:54:03 -070038
39message KubernetesData (XOSBase) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080040 option description = "Base class for Kubernetes ConfigMaps, Secrets, and similar models";
41
Scott Baker95c3dfb2019-03-07 11:24:11 -080042 required string name = 1 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080043 help_text = "Name of this data store",
Scott Baker95c3dfb2019-03-07 11:24:11 -080044 max_length=256];
Scott Bakerfdb10e12019-01-22 17:04:42 -080045 optional string data = 2 [
Scott Baker871a0802019-03-12 15:23:57 -070046 help_text = "Set of key,value pairs encoded as a json dictionary"];
Scott Bakerfdb10e12019-01-22 17:04:42 -080047 required manytoone trust_domain->TrustDomain:kubernetes_configmaps = 3:1003 [
48 help_text = "Trust domain this data resides in",
Scott Baker95c3dfb2019-03-07 11:24:11 -080049 db_index = True];
Scott Bakerac43a742018-05-07 16:54:03 -070050}
51
52message KubernetesConfigMap (KubernetesData) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080053 option description = "A Kubernetes ConfigMap, holding (name, value) data in insecure manner";
Scott Bakerac43a742018-05-07 16:54:03 -070054}
55
56message KubernetesSecret (KubernetesData) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080057 option description = "A kubernetes Secret, hodling (name, value) data in a secure manner";
Scott Bakerac43a742018-05-07 16:54:03 -070058}
59
60message KubernetesSecretVolumeMount (XOSBase) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080061 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 Baker871a0802019-03-12 15:23:57 -070065 db_index = True];
Scott Bakerfdb10e12019-01-22 17:04:42 -080066 required manytoone service_instance->KubernetesServiceInstance:kubernetes_secret_volume_mounts = 2 [
67 help_text = "Service instance in which to mount secret",
Scott Baker871a0802019-03-12 15:23:57 -070068 db_index = True];
Scott Baker95c3dfb2019-03-07 11:24:11 -080069 required string mount_path = 3 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080070 help_text = "Path to mount secret",
Scott Baker95c3dfb2019-03-07 11:24:11 -080071 max_length=1024];
Scott Bakerfdb10e12019-01-22 17:04:42 -080072 optional string sub_path = 4 [
73 help_text = "Subpath within secret to mount",
Scott Baker95c3dfb2019-03-07 11:24:11 -080074 max_length=1024];
Scott Bakerac43a742018-05-07 16:54:03 -070075}
76
77message KubernetesConfigVolumeMount (XOSBase) {
Scott Bakerfdb10e12019-01-22 17:04:42 -080078 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 Baker871a0802019-03-12 15:23:57 -070082 db_index = True];
Scott Bakerfdb10e12019-01-22 17:04:42 -080083 required manytoone service_instance->KubernetesServiceInstance:kubernetes_config_volume_mounts = 2:1001 [
84 help_text = "Service instance in which to mount config",
Scott Baker871a0802019-03-12 15:23:57 -070085 db_index = True];
Scott Baker95c3dfb2019-03-07 11:24:11 -080086 required string mount_path = 3 [
Scott Bakerfdb10e12019-01-22 17:04:42 -080087 help_text = "Path to mount secret",
Scott Baker95c3dfb2019-03-07 11:24:11 -080088 max_length=1024];
Scott Bakerfdb10e12019-01-22 17:04:42 -080089 optional string sub_path = 4 [
90 help_text = "Subpath within secret to mount",
Scott Baker95c3dfb2019-03-07 11:24:11 -080091 max_length=1024];
Scott Bakerac43a742018-05-07 16:54:03 -070092}
93