kubernetes

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence
	RevisionAnnotation = "deployment.kubernetes.io/revision"
	// RevisionHistoryAnnotation maintains the history of all old revisions that a replica set has served for a deployment.
	RevisionHistoryAnnotation = "deployment.kubernetes.io/revision-history"
	// DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation
	// in its replica sets. Helps in separating scaling events from the rollout process and for
	// determining if the new replica set for a deployment is really saturated.
	DesiredReplicasAnnotation = "deployment.kubernetes.io/desired-replicas"
	// MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which
	// is deployment.spec.replicas + maxSurge. Used by the underlying replica sets to estimate their
	// proportions in case the deployment has surge replicas.
	MaxReplicasAnnotation = "deployment.kubernetes.io/max-replicas"
)

Variables

This section is empty.

Functions

func CloneAndRemoveLabel

func CloneAndRemoveLabel(labels map[string]string, labelKey string) map[string]string

Taken from https://github.com/kubernetes/kubernetes/blob/master/pkg/util/labels/labels.go

CloneAndRemoveLabel clones the given map and returns a new map with the given key removed. Returns the given map, if labelKey is empty.

func SetDeploymentAnnotationsTo

func SetDeploymentAnnotationsTo(deployment *apps.Deployment, rollbackToRS *apps.ReplicaSet)

https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/deployment/util/deployment_util.go#L331

SetDeploymentAnnotationsTo sets deployment's annotations as given RS's annotations. This action should be done if and only if the deployment is rolling back to this rs. Note that apply and revision annotations are not changed.

func SetFromReplicaSetTemplate

func SetFromReplicaSetTemplate(deployment *apps.Deployment, template v1.PodTemplateSpec) *apps.Deployment

https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/deployment/util/deployment_util.go#L679

SetFromReplicaSetTemplate sets the desired PodTemplateSpec from a replica set template to the given deployment.

Types

type CleanupArtifactsRequest

type CleanupArtifactsRequest struct {
	Manifests []map[string]interface{} `json:"manifests"`
	Account   string                   `json:"account"`
}

type Controller

type Controller struct {
	*internal.Controller
}

Controller holds all non request-scoped objects.

func (*Controller) CleanupArtifacts

func (cc *Controller) CleanupArtifacts(c *gin.Context, ca CleanupArtifactsRequest)

func (*Controller) Delete

func (cc *Controller) Delete(c *gin.Context, dm DeleteManifestRequest)

func (*Controller) Deploy

func (cc *Controller) Deploy(c *gin.Context, dm DeployManifestRequest)

Deploy performs a "Deploy (Manifest)" Spinnaker operation. It takes in a list of manifest and the Kubernetes provider to "apply" them to. It adds Spinnaker annotations/labels, and handles any Spinnaker versioning, then applies each manifest one by one.

func (*Controller) Patch

func (cc *Controller) Patch(c *gin.Context, pm PatchManifestRequest)

func (*Controller) Rollback

func (cc *Controller) Rollback(c *gin.Context, ur UndoRolloutManifestRequest)

func (*Controller) RollingRestart

func (cc *Controller) RollingRestart(c *gin.Context, rr RollingRestartManifestRequest)

RollingRestart performs a `kubectl rollout restart` by setting an annotation on a pod template to the current time in RFC3339.

func (*Controller) RunJob

func (cc *Controller) RunJob(c *gin.Context, rj RunJobRequest)

func (*Controller) Scale

func (cc *Controller) Scale(c *gin.Context, sm ScaleManifestRequest)

type DeleteManifestRequest

type DeleteManifestRequest struct {
	App            string                              `json:"app"`
	Mode           string                              `json:"mode"`
	LabelSelectors DeleteManifestRequestLabelSelectors `json:"labelSelectors"`
	ManifestName   string                              `json:"manifestName"`
	CloudProvider  string                              `json:"cloudProvider"`
	Options        DeleteManifestRequestOptions        `json:"options"`
	Kinds          []string                            `json:"kinds"`
	Location       string                              `json:"location"`
	User           string                              `json:"user"`
	Account        string                              `json:"account"`
}

type DeleteManifestRequestLabelSelector

type DeleteManifestRequestLabelSelector struct {
	Kind   string   `json:"kind"`
	Values []string `json:"values"`
	Key    string   `json:"key"`
}

type DeleteManifestRequestLabelSelectors

type DeleteManifestRequestLabelSelectors struct {
	Selectors []DeleteManifestRequestLabelSelector `json:"selectors"`
}

type DeleteManifestRequestOptions

type DeleteManifestRequestOptions struct {
	Cascading          bool   `json:"cascading"`
	OrphanDependants   *bool  `json:"orphanDependants"`
	GracePeriodSeconds *int64 `json:"gracePeriodSeconds"`
}

type DeployManifestRequest

type DeployManifestRequest struct {
	EnableTraffic     bool                     `json:"enableTraffic"`
	NamespaceOverride string                   `json:"namespaceOverride"`
	CloudProvider     string                   `json:"cloudProvider"`
	Manifests         []map[string]interface{} `json:"manifests"`
	TrafficManagement struct {
		Options struct {
			EnableTraffic bool `json:"enableTraffic"`
		} `json:"options"`
		Enabled bool `json:"enabled"`
	} `json:"trafficManagement"`
	Moniker struct {
		App string `json:"app"`
	} `json:"moniker"`
	Source                   string                 `json:"source"`
	Account                  string                 `json:"account"`
	SkipExpressionEvaluation bool                   `json:"skipExpressionEvaluation"`
	RequiredArtifacts        []clouddriver.Artifact `json:"requiredArtifacts"`
	OptionalArtifacts        []clouddriver.Artifact `json:"optionalArtifacts"`
}

type ManifestCoordinatesResponse

type ManifestCoordinatesResponse struct {
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

type ManifestResponse

type ManifestResponse struct {
	Account string `json:"account"`
	// Artifacts []struct {
	// 	CustomKind bool `json:"customKind"`
	// 	Metadata   struct {
	// 	} `json:"metadata"`
	// 	Name      string `json:"name"`
	// 	Reference string `json:"reference"`
	// 	Type      string `json:"type"`
	// } `json:"artifacts"`
	Events   []interface{}           `json:"events"`
	Location string                  `json:"location"`
	Manifest map[string]interface{}  `json:"manifest"`
	Metrics  []interface{}           `json:"metrics"`
	Moniker  ManifestResponseMoniker `json:"moniker"`
	Name     string                  `json:"name"`
	Status   manifest.Status         `json:"status"`
	Warnings []interface{}           `json:"warnings"`
}

why are artifacts commented out here? possibly causing the problem of artifacts not getting bound correctly

type ManifestResponseMoniker

type ManifestResponseMoniker struct {
	App     string `json:"app"`
	Cluster string `json:"cluster"`
}

type Operation

type Operation struct {
	DeployManifest         *DeployManifestRequest         `json:"deployManifest"`
	ScaleManifest          *ScaleManifestRequest          `json:"scaleManifest"`
	CleanupArtifacts       *CleanupArtifactsRequest       `json:"cleanupArtifacts"`
	DeleteManifest         *DeleteManifestRequest         `json:"deleteManifest"`
	UndoRolloutManifest    *UndoRolloutManifestRequest    `json:"undoRolloutManifest"`
	RollingRestartManifest *RollingRestartManifestRequest `json:"rollingRestartManifest"`
	PatchManifest          *PatchManifestRequest          `json:"patchManifest"`
	RunJob                 *RunJobRequest                 `json:"runJob"`
}

type Operations

type Operations []Operation

type OperationsResponse

type OperationsResponse struct {
	ID          string `json:"id"`
	ResourceURI string `json:"resourceUri"`
}

type PatchManifestRequest

type PatchManifestRequest struct {
	App      string `json:"app"`
	Cluster  string `json:"cluster"`
	Criteria string `json:"criteria"`
	// Kind          string                         `json:"kind"`
	ManifestName  string                         `json:"manifestName"`
	Source        string                         `json:"source"`
	Mode          string                         `json:"mode"`
	PatchBody     map[string]interface{}         `json:"patchBody"`
	CloudProvider string                         `json:"cloudProvider"`
	AllArtifacts  []PatchManifestRequestArtifact `json:"allArtifacts"`
	Options       PatchManifestRequestOptions    `json:"options"`
	// Manifests         []map[string]interface{}       `json:"manifests"`
	Location string `json:"location"`
	Account  string `json:"account"`
}

type PatchManifestRequestArtifact

type PatchManifestRequestArtifact struct {
	CustomKind bool   `json:"customKind"`
	Reference  string `json:"reference"`
	Metadata   struct {
		Account string `json:"account"`
	} `json:"metadata"`
	Name     string `json:"name"`
	Location string `json:"location"`
	Type     string `json:"type"`
	Version  string `json:"version"`
}

type PatchManifestRequestOptions

type PatchManifestRequestOptions struct {
	MergeStrategy string `json:"mergeStrategy"`
	Record        bool   `json:"record"`
}

Merge strategy can be "strategic", "json", or "merge".

type RollingRestartManifestRequest

type RollingRestartManifestRequest struct {
	CloudProvider string `json:"cloudProvider"`
	ManifestName  string `json:"manifestName"`
	Location      string `json:"location"`
	User          string `json:"user"`
	Account       string `json:"account"`
}

type RunJobRequest

type RunJobRequest struct {
	Account       string                 `json:"account"`
	Alias         string                 `json:"alias"`
	Application   string                 `json:"application"`
	CloudProvider string                 `json:"cloudProvider"`
	Manifest      map[string]interface{} `json:"manifest"`
}

type ScaleManifestRequest

type ScaleManifestRequest struct {
	Replicas      string `json:"replicas"`
	ManifestName  string `json:"manifestName"`
	CloudProvider string `json:"cloudProvider"`
	Location      string `json:"location"`
	User          string `json:"user"`
	Account       string `json:"account"`
}

type UndoRolloutManifestRequest

type UndoRolloutManifestRequest struct {
	Mode             string `json:"mode"`
	ManifestName     string `json:"manifestName"`
	CloudProvider    string `json:"cloudProvider"`
	Location         string `json:"location"`
	NumRevisionsBack int    `json:"numRevisionsBack"`
	User             string `json:"user"`
	Account          string `json:"account"`
	Revision         string `json:"revision"`
}

Jump to

Keyboard shortcuts

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