initial version of confiuration is now parsed.

This commit is contained in:
Erik Brakkee 2025-01-02 11:44:32 +01:00
parent e943e2cd37
commit f99e885f7a
2 changed files with 33 additions and 1 deletions

View File

@ -39,7 +39,20 @@ type CIDRS struct {
Except []CIDR `yaml:"except,omitempty"`
}
type Application struct {
Name string `yaml:"name"`
Ports []string `yaml:"ports,omitempty"`
MatchLabels map[string]string `yaml:"matchLabels"`
}
type Namespace struct {
Namespace string `yaml:"namespace"`
Capabilities []string `yaml:"capabilities"`
Applications []Application `yaml:"applications"`
}
// Config represents the top-level YAML structure
type Config struct {
Networks []CIDRS `yaml:"networks"`
Namespaces []Namespace `yaml:"namespaces"`
}

View File

@ -10,3 +10,22 @@ networks:
- 192.168.0.0/16
namespaces:
- namespace: wamblee-org
capabilities:
- linkerd
applications:
- name: nexus-server
# ports when specified at the application level are used when
# not explicitly mentioned when a link is made
ports:
- 8081
- 8082
matchLabels:
app: nexus-server
- namespace: exposure
applications:
- name: httpd-wamblee-org
matchLabels:
app: wamblee-org