-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from canonical/OPENG-2501
Istio Beacon - Waypoint
- Loading branch information
Showing
12 changed files
with
712 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
ops ~= 2.5 | ||
pydantic>=2 | ||
|
||
# A collection of helpers and shared code for using Lightkube | ||
# Code: https://github.com/canonical/lightkube-extensions | ||
# Deps: charm | ||
lightkube-extensions @ git+https://github.com/canonical/lightkube-extensions.git@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env python3 | ||
|
||
# Copyright 2024 Canonical Ltd. | ||
# See LICENSE file for licensing details. | ||
"""This module defines Pydantic schemas for various resources used in the Kubernetes Gateway API.""" | ||
|
||
from typing import Dict, List, Optional | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
# Global metadata schema | ||
class Metadata(BaseModel): | ||
"""Global metadata schema for Kubernetes resources.""" | ||
|
||
name: str | ||
namespace: str | ||
labels: Optional[Dict[str, str]] = None | ||
annotations: Optional[Dict[str, str]] = None | ||
|
||
|
||
class AllowedRoutes(BaseModel): | ||
"""AllowedRoutes defines namespaces from which traffic is allowed.""" | ||
|
||
namespaces: Dict[str, str] | ||
|
||
|
||
class Listener(BaseModel): | ||
"""Listener defines a port and protocol configuration.""" | ||
|
||
name: str | ||
port: int | ||
protocol: str | ||
allowedRoutes: AllowedRoutes # noqa: N815 | ||
|
||
|
||
class IstioWaypointSpec(BaseModel): | ||
"""IstioWaypointSpec defines the specification of a waypoint.""" | ||
|
||
gatewayClassName: str # noqa: N815 | ||
listeners: List[Listener] | ||
|
||
|
||
class IstioWaypointResource(BaseModel): | ||
"""IstioWaypointResource defines the structure of an waypoint Kubernetes resource.""" | ||
|
||
metadata: Metadata | ||
spec: IstioWaypointSpec |
Oops, something went wrong.