-
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.
Implement the base setup for trats resources Kubernetes controllers (#8)
* Implement the base setup for trats resources kubernetes controller
- Loading branch information
1 parent
18d3c9f
commit 601c151
Showing
53 changed files
with
2,696 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# tconfigd Kubernetes Configurations | ||
This directory contains Kubernetes manifest files and installation scripts for tconfigd. Below is an overview of each component: | ||
|
||
### crd | ||
This directory includes custom resource definitions(CRDs) and example custom resources(CRs) for `tratteria.io` custom resources. | ||
|
||
### spire | ||
This directory includes the Kubernetes setup for SPIRE. | ||
|
||
### tconfigd | ||
This directory includes the Kubernetes setup for the tconfigd server components. | ||
|
||
## Contribute | ||
Contributions to the project are welcome, including feature enhancements, bug fixes, and documentation improvements. |
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,4 @@ | ||
kubectl create namespace test-application | ||
|
||
kubectl apply -f trat-crd.yaml | ||
kubectl apply -f example-trat.yaml |
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,3 @@ | ||
kubectl delete crd trats.tratteria.io | ||
|
||
kubectl delete namespace test-application |
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,23 @@ | ||
apiVersion: tratteria.io/v1alpha1 | ||
kind: TraT | ||
metadata: | ||
name: trade | ||
namespace: test-application | ||
spec: | ||
endpoint: "order/trade/{#stock-id}?action={#action}" | ||
method: "POST" | ||
azd-mapping: | ||
quantity: | ||
required: true | ||
value: "${body.quantity}" | ||
action: | ||
required: true | ||
value: "${action}" | ||
stock: | ||
required: true | ||
value: "${stock-id}" | ||
services: | ||
- order | ||
- catalog | ||
- stocks | ||
- payment |
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,50 @@ | ||
apiVersion: apiextensions.k8s.io/v1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: trats.tratteria.io | ||
spec: | ||
group: tratteria.io | ||
names: | ||
kind: TraT | ||
plural: trats | ||
singular: trat | ||
listKind: TraTList | ||
shortNames: | ||
- trat | ||
scope: Namespaced | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
schema: | ||
openAPIV3Schema: | ||
type: object | ||
properties: | ||
apiVersion: | ||
type: string | ||
kind: | ||
type: string | ||
metadata: | ||
type: object | ||
spec: | ||
type: object | ||
properties: | ||
endpoint: | ||
type: string | ||
method: | ||
type: string | ||
azd-mapping: | ||
type: object | ||
x-kubernetes-preserve-unknown-fields: true | ||
services: | ||
type: array | ||
items: | ||
type: string | ||
required: ["endpoint", "method", "services"] | ||
status: | ||
type: object | ||
properties: | ||
applied: | ||
type: boolean | ||
subresources: | ||
status: {} |
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,3 +1,8 @@ | ||
cd crd | ||
chmod +x deploy.sh | ||
./deploy.sh | ||
cd .. | ||
|
||
cd spire | ||
chmod +x deploy.sh | ||
./deploy.sh | ||
|
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 |
---|---|---|
|
@@ -5,4 +5,10 @@ cd .. | |
|
||
cd spire | ||
chmod +x destroy.sh | ||
./destroy.sh | ||
./destroy.sh | ||
cd .. | ||
|
||
cd crd | ||
chmod +x destroy.sh | ||
./destroy.sh | ||
cd .. |
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,2 +1,4 @@ | ||
kubectl delete namespace tratteria | ||
kubectl delete clusterrole tconfigd-service-account-role | ||
kubectl delete clusterrolebinding tconfigd-service-account-binding | ||
kubectl delete mutatingwebhookconfiguration tratteria-agent-injector |
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,14 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: tconfigd-service-account-role | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create", "patch"] | ||
- apiGroups: ["tratteria.io"] | ||
resources: ["trats"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: ["tratteria.io"] | ||
resources: ["trats/status"] | ||
verbs: ["update"] |
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,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: tconfigd-service-account-binding | ||
subjects: | ||
- kind: ServiceAccount | ||
name: tconfigd-service-account | ||
namespace: tratteria | ||
roleRef: | ||
kind: ClusterRole | ||
name: tconfigd-service-account-role | ||
apiGroup: rbac.authorization.k8s.io |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ run: | |
skip-dirs: | ||
- ^tratcontroller/.*$ | ||
- ^tratcontroller$ | ||
- tratcontroller | ||
|
||
linters: | ||
disable-all: true | ||
|
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,27 @@ | ||
# tconfigd Components | ||
This directory holds the source code for tconfigd. Below is an overview of each component and its functionality. | ||
|
||
### agentsmanager | ||
This directory manages agents by enabling agent registrations, handling agent heartbeats, and tracking active agents. | ||
|
||
### api | ||
This directory implements tconfigd's APIs. It holds the following APIs: | ||
|
||
- Agent Registration API | ||
- Agent Heartbeat API | ||
|
||
### configdispatcher | ||
This directory dispatches configurations to tratteria and tratteria agents. | ||
|
||
### tratcontroller | ||
This directory implements Kubernetes controller for `tratteria.io` custom resources. It hosts controllers for the following resources: | ||
- `tratteria.io/TraT` | ||
- `tratteria.io/TraTExclusion` | ||
|
||
### webhook | ||
This directory implements Kubernetes Admission Controller Webhooks. It hosts the following webhooks: | ||
- Tratteria Agent Injection Mutating Admission Controller Webhook | ||
- `tratteria.io` custom resources Validating Admission Controller Webhook | ||
|
||
## Contributions | ||
Contributions to the project are welcome, including feature enhancements, bug fixes, and documentation improvements. |
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
Oops, something went wrong.