Work on infrastructure abstractions for applications such as ingress #35

Open
opened 2025-05-14 15:31:55 +00:00 by johnride · 0 comments
Owner

Below comment related to this ADR : https://git.nationtech.io/NationTech/harmony/src/branch/master/adr/003-infrastructure-abstractions.md

Thinking about the idea of using a K8sIngressScore here :

A very important idea in Harmony is that we provide an opinionated infrastructure (generally K8s + Ceph + OPNSense) but the user knows nothing about it.

However, the next stage is, as we already did for all the firewall related services (LoadBalancer, Router, TftpServer, etc), is to create sensibles abstractions of the infrastructure components of an application.

That means that we should define a harmony "Ingress" that only has information required by harmony to deploy the concept of an ingress. Then Harmony will provide opinionated implementations of the Ingress object for the various supported Topologies.

For now, this covers only k8s stuff, but at some point (probably soon), it will make sense to provide other implementations.

Let's say for one of our current clients, we have to make a deployment on a windows server. Instead of using k3d, we could provide a more windows friendly implementation based on something else, which is not easily doable when we define a K8sIngressScore, but would be totally natural if it were an IngressScore that requires the Ingress capability in the associated Topology.

So the signature would become :

impl <T: Topology + Ingress> Score<T> for IngressScore { ... }

pub struct IngressConfig {
  pub port: integer,
  pub host: Hostname, // probably a harmony specific type too
  // Other fields that are required in the abstraction of an ingress, nothing implementation specific
}

pub trait Ingress {
  fn create(&self, config: IngressConfig) -> Result<...>
}

impl Ingress for K8sAnywhereTopology {
  fn create(&self, config: IngressConfig) -> Result<...> {
    K8sIngressScore::from(config); // just an idea here but it could make sense to have an easy way to generate a score that is specific to the current topology's technology from the more core Harmony abstract Scores? I feel like this would favor a cohesive, yet easy to use set of abstract/concrete scores.
  }
}

Originally posted by @johnride in https://git.nationtech.io/NationTech/harmony/pulls/32/files#issuecomment-1074

Below comment related to this ADR : https://git.nationtech.io/NationTech/harmony/src/branch/master/adr/003-infrastructure-abstractions.md Thinking about the idea of using a K8sIngressScore here : A very important idea in Harmony is that we provide an opinionated infrastructure (generally K8s + Ceph + OPNSense) but the user knows nothing about it. However, the next stage is, as we already did for all the firewall related services (LoadBalancer, Router, TftpServer, etc), is to create sensibles abstractions of the infrastructure components of an application. That means that we should define a harmony "Ingress" that only has information required by harmony to deploy the concept of an ingress. Then Harmony will provide opinionated implementations of the Ingress object for the various supported Topologies. For now, this covers only k8s stuff, but at some point (probably soon), it will make sense to provide other implementations. Let's say for one of our current clients, we have to make a deployment on a windows server. Instead of using k3d, we could provide a more windows friendly implementation based on something else, which is not easily doable when we define a K8sIngressScore, but would be totally natural if it were an IngressScore that requires the Ingress capability in the associated Topology. So the signature would become : ```rust impl <T: Topology + Ingress> Score<T> for IngressScore { ... } pub struct IngressConfig { pub port: integer, pub host: Hostname, // probably a harmony specific type too // Other fields that are required in the abstraction of an ingress, nothing implementation specific } pub trait Ingress { fn create(&self, config: IngressConfig) -> Result<...> } impl Ingress for K8sAnywhereTopology { fn create(&self, config: IngressConfig) -> Result<...> { K8sIngressScore::from(config); // just an idea here but it could make sense to have an easy way to generate a score that is specific to the current topology's technology from the more core Harmony abstract Scores? I feel like this would favor a cohesive, yet easy to use set of abstract/concrete scores. } } ``` _Originally posted by @johnride in https://git.nationtech.io/NationTech/harmony/pulls/32/files#issuecomment-1074_
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: NationTech/harmony#35
No description provided.