f2sk1deploy

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExposeHelper

type ExposeHelper struct {
	Target *f2k8s.Namespace

	// This will create K8S services
	CreateServices bool

	// This will create Skupper services; if CreateServices is also
	// true, the Skupper service will be based on the K8S service.
	// Otherwise, it exposes the deployment.
	//
	// The Skupper service will use the HTTP protocol
	SkupperExpose bool

	ServiceName   string
	ServicePorts  []int
	ServiceLabels map[string]string
	ServiceType   apiv1.ServiceType

	Protocol string

	frame2.DefaultRunDealer
}

ExposeHelper creates K8S services and/or Skupper services for a deployment

As its name implies, it's just a helper. Several 'deploy' pieces would repeat this code, so it's been extracted for reuse

func (ExposeHelper) Execute

func (e ExposeHelper) Execute() error

type HelloWorld

type HelloWorld struct {
	Topology *topology.Basic

	// This will create K8S services
	CreateServices bool

	// This will create Skupper services; if CreateServices is also
	// true, the Skupper service will be based on the K8S service.
	// Otherwise, it exposes the deployment.
	//
	// The Skupper service will use the HTTP protocol
	SkupperExpose bool

	frame2.DefaultRunDealer
}

Deploys HelloWorld; frontend on pub1, backend on prv1

func (HelloWorld) Execute

func (hw HelloWorld) Execute() error

Deploys the hello-world-frontend pod on pub1 and hello-world-backend pod on prv1, and validate they are available

type HelloWorldBackend

type HelloWorldBackend struct {
	Target         *f2k8s.Namespace
	CreateServices bool
	SkupperExpose  bool
	Protocol       string // This will default to http if not specified

	Ctx context.Context
	frame2.DefaultRunDealer
}

func (*HelloWorldBackend) Execute

func (h *HelloWorldBackend) Execute() error

type HelloWorldFrontend

type HelloWorldFrontend struct {
	Target         *f2k8s.Namespace
	CreateServices bool
	SkupperExpose  bool
	Protocol       string // This will default to http if not specified

	Ctx context.Context

	frame2.DefaultRunDealer
}

func (*HelloWorldFrontend) Execute

func (h *HelloWorldFrontend) Execute() error

type HelloWorldValidate

type HelloWorldValidate struct {
	Namespace               *f2k8s.Namespace
	HelloWorldValidateFront HelloWorldValidateFront
	HelloWorldValidateBack  HelloWorldValidateBack

	frame2.Log
	frame2.DefaultRunDealer
}

Validates a Hello World deployment by Curl from the given Namespace.

The individual validaators (front and back) may be configured, but generally do not need to; they'll use the default values.

func (HelloWorldValidate) Validate

func (h HelloWorldValidate) Validate() error

type HelloWorldValidateBack

type HelloWorldValidateBack struct {
	Namespace       *f2k8s.Namespace
	ServiceName     string // default is backend
	ServicePort     int    // default is 8080
	ServicePath     string // default is api/hello
	ServiceProto    string // default http
	ServiceInsecure bool   // ignores cert problems

	frame2.Log
	frame2.DefaultRunDealer
}

func (HelloWorldValidateBack) Validate

func (h HelloWorldValidateBack) Validate() error

type HelloWorldValidateFront

type HelloWorldValidateFront struct {
	Namespace       *f2k8s.Namespace
	ServiceName     string // default is frontend
	ServicePort     int    // default is 8080
	ServiceInsecure bool   // Ignores certificate problems
	ServiceProto    string // default is http

	frame2.Log
	frame2.DefaultRunDealer
}

func (HelloWorldValidateFront) Validate

func (h HelloWorldValidateFront) Validate() error

type PatientDatabase

type PatientDatabase struct {
	Target *f2k8s.Namespace

	Image string // default quay.io/skupper/patient-portal-database

	// This will create K8S services
	CreateServices bool

	// This will create Skupper services; if CreateServices is also
	// true, the Skupper service will be based on the K8S service.
	// Otherwise, it exposes the deployment.
	//
	// The Skupper service will use the HTTP protocol
	SkupperExpose bool

	Ctx context.Context

	frame2.DefaultRunDealer
}

Deploys the patient database from

quay.io/skupper/patient-portal-database

func (PatientDatabase) Execute

func (p PatientDatabase) Execute() error

type PatientDbPing

type PatientDbPing struct {
	Namespace *f2k8s.Namespace

	frame2.Log
	frame2.DefaultRunDealer
}

Given a namespace with a PatientFrontend deployment, it will ping the DB from that deployment using pg_isready TODO change this to use a test helper pod, instead of the frontend

func (PatientDbPing) Validate

func (p PatientDbPing) Validate() error

type PatientFrontend

type PatientFrontend struct {
	Runner *frame2.Run
	Target *f2k8s.Namespace

	Image string // quay.io/skupper/patient-portal-frontend

	// This will create K8S services
	CreateServices bool

	// This will create Skupper services; if CreateServices is also
	// true, the Skupper service will be based on the K8S service.
	// Otherwise, it exposes the deployment.
	//
	// The Skupper service will use the HTTP protocol
	SkupperExpose bool

	Ctx context.Context
}

Deploys the patient frontend

func (PatientFrontend) Execute

func (p PatientFrontend) Execute() error

type PatientFrontendHealth

type PatientFrontendHealth struct {
	Namespace   *f2k8s.Namespace
	ServiceName string // default is frontend
	ServicePort int    // default is 8080
	ServicePath string // default is api/health

	frame2.Log
	frame2.DefaultRunDealer
}

func (PatientFrontendHealth) Validate

func (p PatientFrontendHealth) Validate() error

type PatientPayment

type PatientPayment struct {
	Runner *frame2.Run
	Target *f2k8s.Namespace

	Image string // default quay.io/skupper/patient-portal-payment-processor

	// This will create K8S services
	CreateServices bool

	// This will create Skupper services; if CreateServices is also
	// true, the Skupper service will be based on the K8S service.
	// Otherwise, it exposes the deployment.
	//
	// The Skupper service will use the HTTP protocol
	SkupperExpose bool

	Ctx context.Context
}

Deploys the patient payment processor

func (PatientPayment) Execute

func (p PatientPayment) Execute() error

type PatientPortal

type PatientPortal struct {
	Topology *topology.Basic

	// This will create K8S services
	CreateServices bool

	// This will create Skupper services; if CreateServices is also
	// true, the Skupper service will be based on the K8S service.
	// Otherwise, it exposes the deployment.
	//
	// The Skupper service will use the HTTP protocol
	SkupperExpose bool

	frame2.DefaultRunDealer
}

A full deployment of Patient Portal

For fine tuned configuration, use the individual PatientDatabase, PatientFrontend and PatientPayment components

https://github.com/skupperproject/skupper-example-patient-portal/

func (PatientPortal) Execute

func (p PatientPortal) Execute() error

type PatientValidatePayment

type PatientValidatePayment struct {
	Namespace   *f2k8s.Namespace
	ServiceName string // default is payment-processor
	ServicePort int    // default is 8080
	ServicePath string // default is api/health

	frame2.Log
	frame2.DefaultRunDealer
}

func (PatientValidatePayment) Validate

func (p PatientValidatePayment) Validate() error

Jump to

Keyboard shortcuts

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