devops_armory/cloud/gcp/gke/ingress/
models.rs1use serde_derive::{Serialize, Deserialize};
2
3#[derive(Serialize, Deserialize, Default, Debug)]
4pub struct Ingress {
5 pub apiVersion: String,
6 pub kind: String,
7 pub metadata: IngressMetadata,
8 pub spec: IngressSpecTemplateSpec
9}
10
11#[derive(Serialize, Deserialize, Default, Debug)]
12pub struct IngressMetadata {
13 pub name: String,
14 pub namespace: String,
15 pub annotations: Option<IngressMetadataAnnotations>,
16}
17
18#[derive(Serialize, Deserialize, Default, Debug)]
19pub struct IngressMetadataAnnotations {
20 #[serde(rename = "kubernetes.io/ingress.global-static-ip-name")]
21 pub kubernetes_io_ingress_global_static_ip_name: Option<String>,
22 #[serde(rename = "networking.gke.io/managed-certificates")]
23 pub networking_gke_io_managed_certificates: Option<String>,
24 #[serde(rename = "kubernetes.io/ingress.class")]
25 pub kubernetes_io_ingress_class: Option<String>,
26 #[serde(rename = "nginx.ingress.kubernetes.io/force-ssl-redirect")]
27 pub nginx_force_ssl_redirect: Option<String>,
28 #[serde(rename = "cert-manager.io/cluster-issuer")]
29 pub cert_manager_cluster_issuer: Option<String>,
30}
31
32#[derive(Serialize, Deserialize, Default, Debug)]
33pub struct IngressSpecTemplateSpec {
34 pub tls: Option<Vec<IngressSpecTemplateTlsRules>>,
35 pub rules: Vec<IngressSpecTemplateSpecRules>
36}
37
38#[derive(Serialize, Deserialize, Default, Debug)]
39pub struct IngressSpecTemplateTlsRules {
40 pub hosts: Vec<String>,
41 pub secretName: String
42}
43
44#[derive(Serialize, Deserialize, Default, Debug)]
45pub struct IngressSpecTemplateSpecRules {
46 pub host: String,
47 pub http: SpecHttp
48}
49
50#[derive(Serialize, Deserialize, Default, Debug)]
51pub struct SpecHttp {
52 pub paths: Vec<Paths>
53}
54
55#[derive(Serialize, Deserialize, Default, Debug)]
56pub struct Paths {
57 pub path: String,
58 pub pathType: String,
59 pub backend: IngressBackend
60}
61
62#[derive(Serialize, Deserialize, Default, Debug)]
63pub struct IngressBackend {
64 pub service: IngressBackendService
65}
66
67#[derive(Serialize, Deserialize, Default, Debug)]
68pub struct IngressBackendService {
69 pub name: String,
70 pub port: BackendPort
71}
72
73#[derive(Serialize, Deserialize, Default, Debug)]
74pub struct BackendPort {
75 pub number: i32
76}
77
78