Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Creating a Custom Resource Definition for a pod IP to metadata mapper. #1071

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c31ed60
feat: Creating a Custom Resource Definition for the PodInfo operator.
prateek041 Jun 12, 2023
41de71f
feat: Creating a Custom Resource Definition for the PodInfo operator.
prateek041 Jun 12, 2023
67556ff
feat: Creating a Custom Resource Definition for the PodInfo operator.
prateek041 Jun 12, 2023
d87117d
Remove go.Mod file from podinfo directory.
prateek041 Jun 13, 2023
cca9008
Cleared the file since the tests will be written using testify, and n…
prateek041 Jun 27, 2023
ad830c1
Mirror k8s pod resource
prateek041 Jun 27, 2023
a1f2459
Renamed the project from podinfo to tetragonpod.
prateek041 Jul 2, 2023
52e59e3
Created an exporter, that will create the CRD object and return to th…
prateek041 Jul 2, 2023
f02a0ee
Integrated the registration of tetragonPod CRD into the tetragon oper…
prateek041 Jul 2, 2023
3ef1e9c
Replaced podinfo with tetragonpods.
prateek041 Jul 6, 2023
8b682c4
Updated the Logic for registering TetragonPod CustomResourceDefinitio…
prateek041 Jul 6, 2023
bf134c7
cleanup
prateek041 Jul 6, 2023
58ce306
Added cluster role for tetragon pod controller
prateek041 Jul 19, 2023
6d25981
added role binding and service account for tetragonpod controller
prateek041 Jul 19, 2023
336aaf3
Added deployment for the tetragonpod controller
prateek041 Jul 19, 2023
dbb2856
Modified files for adding labels and default values
prateek041 Jul 19, 2023
85b5baf
Modified tetragonpod controller to check if it gets pod resources
prateek041 Jul 19, 2023
087ef7a
Changed github workflows to build image of the tetragonpod controller
prateek041 Jul 19, 2023
d9b4019
Added flag and logic for skipping the tetragonPod CRD
prateek041 Jul 27, 2023
d8271a4
Added flag in the default value
prateek041 Jul 27, 2023
c12fd65
Cleanup of unused files
prateek041 Jul 27, 2023
ddfd1d9
Resolving merge conflicts
prateek041 Jul 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions podinfo/api/v1alpha1/podinfo_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,27 @@ import (
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// PodInfoSpec defines the desired state of PodInfo. It contains the pod IP and metadata that will be populated by the operator.
type PodInfoSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "make" to regenerate code after modifying this file

// PodName is the IP address of the pod
PodIP string `json:"podIP"`
// PodName contains the additional details like name, version, labels etc.
PodMetadata string `json:"podMetadata"`
// Host networking requested for this pod. Use the host's network namespace.
// If this option is set, the ports that will be used must be specified.
HostNetwork bool `json:"hostNetwork,omitempty"`
}

type PodInfoStatus struct {
// IP address allocated to the pod. Routable at least within the cluster.
// Empty if not yet allocated.
PodIP string `json:"podIP,omitempty"`

// List of Ip addresses allocated to the pod. 0th entry must be same as PodIP.
PodIPs []PodIP `json:"podIPs,omitempty"`
}

type PodIP struct {
// ip is an IP address (IPv4 or IPv6) assigned to the pod
IP string `json:"ip,omitempty"`
}

//+kubebuilder:object:root=true
Expand All @@ -41,10 +53,12 @@ type PodInfo struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec PodInfoSpec `json:"spec,omitempty"`
Spec PodInfoSpec `json:"spec,omitempty"`
Status PodInfoStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true
// +kubebuilder:subresource:status

// PodInfoList contains a list of PodInfo
type PodInfoList struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,30 @@ spec:
metadata:
type: object
spec:
description: PodInfoSpec defines the desired state of PodInfo. It contains
the pod IP and metadata that will be populated by the operator.
properties:
hostNetwork:
description: Host networking requested for this pod. Use the host's
network namespace. If this option is set, the ports that will be
used must be specified.
Copy link
Member

@tixxdz tixxdz Jun 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe my comment is stupid: doc says "the ports that will be used must be specified" but doesn't specify where or how? maybe if it makes sense add it here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing that out. I will make the changes.

@tixxdz

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't mad the changes there yet, will do right before the PR is ready.

type: boolean
type: object
status:
properties:
podIP:
description: PodName is the IP address of the pod
type: string
podMetadata:
description: PodName contains the additional details like name, version,
labels etc.
description: IP address allocated to the pod. Routable at least within
the cluster. Empty if not yet allocated.
type: string
required:
- podIP
- podMetadata
podIPs:
description: List of Ip addresses allocated to the pod. 0th entry
must be same as PodIP.
items:
properties:
ip:
description: ip is an IP address (IPv4 or IPv6) assigned to
the pod
type: string
type: object
type: array
type: object
type: object
served: true
Expand Down