cfapp

package
v0.0.0-...-6eb79dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const GroupName = "cloudflow.lightbend.com"

GroupName for our CR

View Source
const GroupVersion = "v1alpha1"

GroupVersion for our CR

View Source
const Kind = "CloudflowApplication"

Kind for our CR

View Source
const ReadOnlyMany = "ReadOnlyMany"

ReadOnlyMany is a name of a VolumeMount access mode

View Source
const ReadWriteMany = "ReadWriteMany"

ReadWriteMany is a name of a VolumeMount access mode

Variables

This section is empty.

Functions

func APIVersion

func APIVersion() string

APIVersion formats the correct APIVersion from group name and version

func CreateLabels

func CreateLabels(appID string) map[string]string

CreateLabels creates cloudflow application labels

func CreatedByCliAnnotation

func CreatedByCliAnnotation(releaseTag string, buildNumber string) map[string]string

CreatedByCliAnnotation creates a map for use as an annotation when a resource is created by the CLI

func LastModifiedByCLIAnnotation

func LastModifiedByCLIAnnotation(releaseTag string, buildNumber string, previousAnnotations map[string]string) map[string]string

LastModifiedByCLIAnnotation creates a map for use as an annotation when a resource is updated by the CLI

func NewCloudflowApplicationNamespace

func NewCloudflowApplicationNamespace(spec CloudflowApplicationSpec, releaseTag string, buildNumber string) v1.Namespace

NewCloudflowApplicationNamespace creates a Namespace struct

func TestApplicationDescriptor

func TestApplicationDescriptor() string

TestApplicationDescriptor returns a CloudflowApplication descriptor as a string

Types

type Attribute

type Attribute struct {
	AttributeName string `json:"attribute_name"`
	ConfigPath    string `json:"config_path"`
}

Attribute describes that a streamlet requires specific configuration by the cloudflow platform

type CloudflowApplication

type CloudflowApplication struct {
	metav1.TypeMeta
	metav1.ObjectMeta `json:"metadata"`
	Spec              CloudflowApplicationSpec    `json:"spec"`
	Status            *CloudflowApplicationStatus `json:"status,omitempty"`
}

CloudflowApplication is the complete resource object sent to the API endpoint

func NewCloudflowApplication

func NewCloudflowApplication(spec CloudflowApplicationSpec, releaseTag string, buildNumber string) CloudflowApplication

NewCloudflowApplication creates a CloudflowApplication strcut that can be used with a Create call

func UpdateCloudflowApplication

func UpdateCloudflowApplication(spec CloudflowApplicationSpec, currentAppCR CloudflowApplication, releaseTag string, buildNumber string) CloudflowApplication

UpdateCloudflowApplication creates a CloudflowApplication struct that can be used with a Update call

func (*CloudflowApplication) DeepCopyInto

func (in *CloudflowApplication) DeepCopyInto(out *CloudflowApplication)

DeepCopyInto copies all properties of this object into another object of the same type that is provided as a pointer.

func (*CloudflowApplication) DeepCopyObject

func (in *CloudflowApplication) DeepCopyObject() runtime.Object

DeepCopyObject returns a generically typed copy of an object

func (*CloudflowApplication) GenerateOwnerReference

func (in *CloudflowApplication) GenerateOwnerReference() metav1.OwnerReference

GenerateOwnerReference creates an ownerReference pointing towards this CR

type CloudflowApplicationClient

type CloudflowApplicationClient struct {
	// contains filtered or unexported fields
}

CloudflowApplicationClient is a REST client that can be used to create or update CloudflowApplication CR

func GetCloudflowApplicationClient

func GetCloudflowApplicationClient(namespace string) (*CloudflowApplicationClient, error)

GetCloudflowApplicationClient returns a CloudflowApplicationClient that can be used to create or update a `CloudflowApplication` CR

func (*CloudflowApplicationClient) Create

Create creates a new CloudflowApplication CR

func (*CloudflowApplicationClient) Delete

func (c *CloudflowApplicationClient) Delete(name string) (*rest.Result, error)

Delete a CloudflowApplication successfully and return the rest.Result (a Status), or an error

func (*CloudflowApplicationClient) Get

Get returns an already created CloudflowApplication, or an error

func (*CloudflowApplicationClient) List

List returns a list of CloudflowApplications, or an error

func (*CloudflowApplicationClient) Update

Update updates a CloudflowApplication CR

type CloudflowApplicationDescriptorDigestPair

type CloudflowApplicationDescriptorDigestPair struct {
	AppDescriptor string `json:"appDescriptor"`
	ImageDigest   string `json:"imageDigest"`
}

CloudflowApplicationDescriptorDigestPair is a pair of app descriptor and image digest

type CloudflowApplicationList

type CloudflowApplicationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`
	Items           []CloudflowApplication `json:"items"`
}

CloudflowApplicationList is a list of CloudflowApplications

func (*CloudflowApplicationList) DeepCopyObject

func (in *CloudflowApplicationList) DeepCopyObject() runtime.Object

DeepCopyObject returns a generically typed copy of an object

type CloudflowApplicationSpec

type CloudflowApplicationSpec struct {
	AppID          string            `json:"app_id"`
	AppVersion     string            `json:"app_version"`
	Deployments    []Deployment      `json:"deployments"`
	Streamlets     []Streamlet       `json:"streamlets"`
	AgentPaths     map[string]string `json:"agent_paths"`
	Version        string            `json:"version,omitempty"`
	LibraryVersion string            `json:"library_version,omitempty"`
}

CloudflowApplicationSpec contains the CR spec for a cloudflow application

func LoadCloudflowApplicationSpec

func LoadCloudflowApplicationSpec(crFile string) (CloudflowApplicationSpec, error)

LoadCloudflowApplicationSpec loads the spec from file

type CloudflowApplicationStatus

type CloudflowApplicationStatus struct {
	AppID             string            `json:"app_id"`
	AppVersion        string            `json:"app_version"`
	AppStatus         string            `json:"app_status"`
	AppMessage        string            `json:"app_message"`
	EndpointStatuses  []EndpointStatus  `json:"endpoint_statuses"`
	StreamletStatuses []StreamletStatus `json:"streamlet_statuses"`
}

CloudflowApplicationStatus contains the status of the application

type ConfigParameterDescriptor

type ConfigParameterDescriptor struct {
	Key          string `json:"key"`
	Description  string `json:"description"`
	Type         string `json:"validation_type"`
	Pattern      string `json:"validation_pattern"`
	DefaultValue string `json:"default_value"`
}

ConfigParameterDescriptor describes an argument that has to be supplied when deploying a Cloudflow application

type Deployment

type Deployment struct {
	ClassName     string                  `json:"class_name"`
	Config        json.RawMessage         `json:"config"`
	Image         string                  `json:"image"`
	Name          string                  `json:"name"`
	PortMappings  map[string]PortMapping  `json:"port_mappings"`
	VolumeMounts  []VolumeMountDescriptor `json:"volume_mounts"`
	Runtime       string                  `json:"runtime"`
	StreamletName string                  `json:"streamlet_name"`
	SecretName    string                  `json:"secret_name"`
	Endpoint      *Endpoint               `json:"endpoint,omitempty"`
	Replicas      int                     `json:"replicas,omitempty"`
}

Deployment contains a streamlet deployment

type Descriptor

type Descriptor struct {
	Attributes       []Attribute                 `json:"attributes"`
	ClassName        string                      `json:"class_name"`
	ConfigParameters []ConfigParameterDescriptor `json:"config_parameters"`
	VolumeMounts     []VolumeMountDescriptor     `json:"volume_mounts"`
	Inlets           []InOutlet                  `json:"inlets"`
	Labels           []string                    `json:"labels"`
	Outlets          []InOutlet                  `json:"outlets"`
	Runtime          string                      `json:"runtime"`
	Description      string                      `json:"description"`
}

Descriptor describes a streamlet

type Endpoint

type Endpoint struct {
	AppID         string `json:"app_id,omitempty"`
	Streamlet     string `json:"streamlet,omitempty"`
	ContainerPort int    `json:"container_port,omitempty"`
}

Endpoint contains deployment endpoint information

type EndpointStatus

type EndpointStatus struct {
	StreamletName string `json:"streamlet_name"`
	URL           string `json:"url"`
}

EndpointStatus contains the status of the endpoint

type InOutlet

type InOutlet struct {
	Name   string         `json:"name"`
	Schema InOutletSchema `json:"schema"`
}

InOutlet defines a in/out-let and its schema

type InOutletSchema

type InOutletSchema struct {
	Fingerprint string `json:"fingerprint"`
	Schema      string `json:"schema"`
	Name        string `json:"name"`
	Format      string `json:"format"`
}

InOutletSchema contains the schema of a in/out-let

type PodStatus

type PodStatus struct {
	Name                string `json:"name"`
	Ready               string `json:"ready"`
	NrOfContainersReady int    `json:"nr_of_containers_ready"`
	NrOfContainers      int    `json:"nr_of_containers"`
	Restarts            int    `json:"restarts"`
	Status              string `json:"status"`
}

PodStatus contains the status of the pod

type PortMapping

type PortMapping struct {
	ID      string          `json:"id"`
	Config  json.RawMessage `json:"config"`
	Cluster string          `json:"cluster,omitempty"`
}

PortMapping maps outlets

type Streamlet

type Streamlet struct {
	Descriptor Descriptor `json:"descriptor"`
	Name       string     `json:"name"`
}

Streamlet is a streamlet instance in the cloudflow application

type StreamletStatus

type StreamletStatus struct {
	StreamletName string      `json:"streamlet_name"`
	PodStatuses   []PodStatus `json:"pod_statuses"`
}

StreamletStatus contains the status of the streamlet

type VolumeMountDescriptor

type VolumeMountDescriptor struct {
	Name       string `json:"name"`
	Path       string `json:"path"`
	AccessMode string `json:"access_mode"`
	PVCName    string `json:"pvc_name,omitempty"`
}

VolumeMountDescriptor describes a volume mount that a streamlet will use

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL