Documentation ¶
Overview ¶
Package k8s abstracts all Kubernetes specific behaviour
Index ¶
- Constants
- func CreateClient(endpoint, kubeCfgPath string) (*kubernetes.Clientset, error)
- func CreateTPRClient(endpoint, kubeCfgPath string) (*rest.RESTClient, error)
- func ExtractNamespace(np *metav1.ObjectMeta) string
- func ExtractPolicyName(np *v1beta1.NetworkPolicy) string
- func ParseNetworkPolicy(np *v1beta1.NetworkPolicy) (api.Rules, error)
- type CiliumNetworkPolicy
- type CiliumNetworkPolicyList
Constants ¶
const ( // ThirdPartyResourceGroup is the name of the third party resource group ThirdPartyResourceGroup = "cilium.io" // ThirdPartyResourceVersion is the current version of the resource ThirdPartyResourceVersion = "v1" )
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
func CreateClient(endpoint, kubeCfgPath string) (*kubernetes.Clientset, error)
CreateClient creates a new client to access the Kubernetes API
func CreateTPRClient ¶
func CreateTPRClient(endpoint, kubeCfgPath string) (*rest.RESTClient, error)
CreateTPRClient creates a new k8s client for third party resources
func ExtractNamespace ¶
func ExtractNamespace(np *metav1.ObjectMeta) string
ExtractNamespace extracts the namespace of ObjectMeta.
func ExtractPolicyName ¶
func ExtractPolicyName(np *v1beta1.NetworkPolicy) string
ExtractPolicyName extracts the name of policy name
func ParseNetworkPolicy ¶
func ParseNetworkPolicy(np *v1beta1.NetworkPolicy) (api.Rules, error)
ParseNetworkPolicy parses a k8s NetworkPolicy and returns a list of Cilium policy rules that can be added
Types ¶
type CiliumNetworkPolicy ¶
type CiliumNetworkPolicy struct { metav1.TypeMeta `json:",inline"` // +optional Metadata metav1.ObjectMeta `json:"metadata"` // Spec is the desired Cilium specific rule specification. Spec api.Rule `json:"spec"` }
CiliumNetworkPolicy is a Kubernetes third-party resource with an extended version of NetworkPolicy
func (*CiliumNetworkPolicy) GetObjectKind ¶
func (r *CiliumNetworkPolicy) GetObjectKind() schema.ObjectKind
GetObjectKind returns the kind of the object
func (*CiliumNetworkPolicy) GetObjectMeta ¶
func (r *CiliumNetworkPolicy) GetObjectMeta() metav1.Object
GetObjectMeta returns the metadata of the object
type CiliumNetworkPolicyList ¶
type CiliumNetworkPolicyList struct { metav1.TypeMeta `json:",inline"` // +optional Metadata metav1.ListMeta `json:"metadata"` // Items is a list of CiliumNetworkPolicy Items []CiliumNetworkPolicy `json:"items"` }
CiliumNetworkPolicyList is a list of CiliumNetworkPolicy objects
func (*CiliumNetworkPolicyList) GetListMeta ¶
func (r *CiliumNetworkPolicyList) GetListMeta() metav1.List
GetListMeta returns the metadata of the object
func (*CiliumNetworkPolicyList) GetObjectKind ¶
func (r *CiliumNetworkPolicyList) GetObjectKind() schema.ObjectKind
GetObjectKind returns the kind of the object