nais_io_v1alpha1

package
v0.0.0-...-3185efd Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 25 Imported by: 17

Documentation

Overview

Package nais_io_v1alpha1 contains API Schema definitions for the nais.io v1alpha1 API group +kubebuilder:object:generate=true +groupName=nais.io +versionName=v1alpha1

Index

Constants

View Source
const (
	DefaultPortName                 = "http"
	DefaultServicePort              = 80
	DefaultAppPort                  = 8080
	DefaultProbePeriodSeconds       = 10
	DefaultProbeTimeoutSeconds      = 1
	DefaultProbeFailureThreshold    = 3
	DeploymentStrategyRollingUpdate = "RollingUpdate"
	DeploymentStrategyRecreate      = "Recreate"
)

Application spec default values

View Source
const (
	DefaultSecretMountPath                 = "/var/run/secrets"
	DefaultJwkerMountPath                  = "/var/run/secrets/nais.io/jwker"
	DefaultAzureratorMountPath             = "/var/run/secrets/nais.io/azure"
	DefaultKafkaratorMountPath             = "/var/run/secrets/nais.io/kafka"
	DefaultDigdiratorIDPortenMountPath     = "/var/run/secrets/nais.io/idporten"
	DefaultDigdiratorMaskinportenMountPath = "/var/run/secrets/nais.io/maskinporten"
	DefaultSqeletorMountPath               = "/var/run/secrets/nais.io/sqlcertificate"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "nais.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func GetDefaultMountPath

func GetDefaultMountPath(name string) string

func GetDefaultPVCMountPath

func GetDefaultPVCMountPath(name string) string

Types

type Application

type Application struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ApplicationSpec   `json:"spec"`
	Status nais_io_v1.Status `json:"status,omitempty"`
}

Application defines a NAIS application.

+genclient +kubebuilder:object:root=true +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:printcolumn:name="Team",type="string",JSONPath=".metadata.labels.team" +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.synchronizationState" +kubebuilder:resource:path="applications",shortName="app",singular="application"

func ExampleApplicationForDocumentation

func ExampleApplicationForDocumentation() *Application

func (*Application) ApplyDefaults

func (app *Application) ApplyDefaults() error

ApplyDefaults sets default values where they are missing from an Application spec.

func (*Application) ClientID

func (in *Application) ClientID(cluster string) string

func (*Application) CorrelationID

func (in *Application) CorrelationID() string

func (*Application) DeepCopy

func (in *Application) DeepCopy() *Application

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Application.

func (*Application) DeepCopyInto

func (in *Application) DeepCopyInto(out *Application)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Application) DeepCopyObject

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

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Application) DefaultSecretPath

func (in *Application) DefaultSecretPath(base string) nais_io_v1.SecretPath

func (*Application) GetAccessPolicy

func (in *Application) GetAccessPolicy() *nais_io_v1.AccessPolicy

func (*Application) GetAzure

func (in *Application) GetAzure() nais_io_v1.AzureInterface

func (*Application) GetCommand

func (in *Application) GetCommand() []string

func (*Application) GetEnv

func (in *Application) GetEnv() nais_io_v1.EnvVars

func (*Application) GetEnvFrom

func (in *Application) GetEnvFrom() []nais_io_v1.EnvFrom

func (*Application) GetFilesFrom

func (in *Application) GetFilesFrom() []nais_io_v1.FilesFrom

func (*Application) GetFrontend

func (in *Application) GetFrontend() *nais_io_v1.Frontend

func (*Application) GetGCP

func (in *Application) GetGCP() *nais_io_v1.GCP

func (*Application) GetIDPorten

func (in *Application) GetIDPorten() *nais_io_v1.IDPorten

func (*Application) GetImage

func (in *Application) GetImage() string

func (*Application) GetInflux

func (in *Application) GetInflux() *nais_io_v1.Influx

func (*Application) GetIngress

func (in *Application) GetIngress() []nais_io_v1.Ingress

func (*Application) GetKafka

func (in *Application) GetKafka() *nais_io_v1.Kafka

func (*Application) GetLeaderElection

func (in *Application) GetLeaderElection() bool

func (*Application) GetLiveness

func (in *Application) GetLiveness() *nais_io_v1.Probe

func (*Application) GetLogformat

func (in *Application) GetLogformat() string

func (*Application) GetLogtransform

func (in *Application) GetLogtransform() string

func (*Application) GetMaskinporten

func (in *Application) GetMaskinporten() *nais_io_v1.Maskinporten

func (*Application) GetObjectKind

func (in *Application) GetObjectKind() schema.ObjectKind

func (*Application) GetObjectReference

func (in *Application) GetObjectReference() corev1.ObjectReference

func (*Application) GetObservability

func (in *Application) GetObservability() *nais_io_v1.Observability

func (*Application) GetOpenSearch

func (in *Application) GetOpenSearch() *nais_io_v1.OpenSearch

func (*Application) GetOwnerReference

func (in *Application) GetOwnerReference() metav1.OwnerReference

func (*Application) GetPort

func (in *Application) GetPort() int

func (*Application) GetPreStopHook

func (in *Application) GetPreStopHook() *nais_io_v1.PreStopHook

func (*Application) GetPreStopHookPath

func (in *Application) GetPreStopHookPath() string

func (*Application) GetPrometheus

func (in *Application) GetPrometheus() *nais_io_v1.PrometheusConfig

func (*Application) GetReadiness

func (in *Application) GetReadiness() *nais_io_v1.Probe

func (*Application) GetRedis

func (in *Application) GetRedis() []nais_io_v1.Redis

func (*Application) GetReplicas

func (in *Application) GetReplicas() *nais_io_v1.Replicas

func (*Application) GetResources

func (in *Application) GetResources() *nais_io_v1.ResourceRequirements

func (*Application) GetSecureLogs

func (in *Application) GetSecureLogs() *nais_io_v1.SecureLogs

func (*Application) GetService

func (in *Application) GetService() *nais_io_v1.Service

func (*Application) GetSkipCABundle

func (in *Application) GetSkipCABundle() bool

func (*Application) GetStartup

func (in *Application) GetStartup() *nais_io_v1.Probe

func (*Application) GetStatus

func (in *Application) GetStatus() *nais_io_v1.Status

func (*Application) GetStrategy

func (in *Application) GetStrategy() *nais_io_v1.Strategy

func (*Application) GetTTL

func (in *Application) GetTTL() string

func (*Application) GetTerminationGracePeriodSeconds

func (in *Application) GetTerminationGracePeriodSeconds() *int64

func (*Application) GetTokenX

func (in *Application) GetTokenX() *nais_io_v1.TokenX

func (*Application) GetVault

func (in *Application) GetVault() *nais_io_v1.Vault

func (*Application) GetWebProxy

func (in *Application) GetWebProxy() bool

func (Application) Hash

func (in Application) Hash() (string, error)

func (*Application) LogFields

func (in *Application) LogFields() log.Fields

func (*Application) SetDeploymentRolloutStatus

func (in *Application) SetDeploymentRolloutStatus(rolloutStatus string)

func (*Application) SetStatus

func (in *Application) SetStatus(status *nais_io_v1.Status)

func (*Application) SetupWebhookWithManager

func (a *Application) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Application) SkipDeploymentMessage

func (in *Application) SkipDeploymentMessage() bool

func (*Application) ValidateCreate

func (a *Application) ValidateCreate() (admission.Warnings, error)

func (*Application) ValidateDelete

func (a *Application) ValidateDelete() (admission.Warnings, error)

func (*Application) ValidateUpdate

func (a *Application) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

type ApplicationList

type ApplicationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Application `json:"items"`
}

+kubebuilder:object:root=true

func (*ApplicationList) DeepCopy

func (in *ApplicationList) DeepCopy() *ApplicationList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationList.

func (*ApplicationList) DeepCopyInto

func (in *ApplicationList) DeepCopyInto(out *ApplicationList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ApplicationList) DeepCopyObject

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

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ApplicationSpec

type ApplicationSpec struct {
	// By default, no traffic is allowed between applications inside the cluster.
	// Configure access policies to explicitly allow communication between applications.
	// This is also used for granting inbound access in the context of Azure AD and TokenX clients.
	// +nais:doc:Link="https://doc.nais.io/explanation/zero-trust/"
	AccessPolicy *nais_io_v1.AccessPolicy `json:"accessPolicy,omitempty"`

	// Provisions and configures Azure resources.
	Azure *nais_io_v1.Azure `json:"azure,omitempty"`

	// Override command when starting Docker image.
	Command []string `json:"command,omitempty"`
	// Custom environment variables injected into your container.
	// Specify either `value` or `valueFrom`, but not both.
	Env nais_io_v1.EnvVars `json:"env,omitempty"`

	// EnvFrom exposes all variables in the ConfigMap or Secret resources as environment variables.
	// One of `configMap` or `secret` is required.
	//
	// Environment variables will take the form `KEY=VALUE`, where `key` is the ConfigMap or Secret key.
	// You can specify as many keys as you like in a single ConfigMap or Secret.
	//
	// The ConfigMap and Secret resources must live in the same Kubernetes namespace as the Application resource.
	// +nais:doc:Availability="team namespaces"
	EnvFrom []nais_io_v1.EnvFrom `json:"envFrom,omitempty"`

	// List of ConfigMap, Secret, or EmptyDir resources that will have their contents mounted into the containers.
	// Either `configMap`, `secret`, or `emptyDir` is required.
	//
	// Files will take the path `<mountPath>/<key>`, where `key` is the ConfigMap or Secret key.
	// You can specify as many keys as you like in a single ConfigMap or Secret, and they will all
	// be mounted to the same directory.
	//
	// If you reference an emptyDir you will just get an empty directory, backed
	// by your requested memory or the disk on the node where your pod is
	// running.
	//
	// The ConfigMap and Secret resources must live in the same Kubernetes namespace as the Application resource.
	// +nais:doc:Availability="team namespaces"
	FilesFrom []nais_io_v1.FilesFrom `json:"filesFrom,omitempty"`

	// Configuration options specifically for frontend applications.
	// +nais:doc:Availability="GCP"
	// +nais:doc:Experimental=true
	Frontend *nais_io_v1.Frontend `json:"frontend,omitempty"`

	// +nais:doc:Availability="GCP"
	GCP *nais_io_v1.GCP `json:"gcp,omitempty"`

	// Configures ID-porten authentication for this application.
	// See [ID-porten](https://doc.nais.io/explanation/auth/idporten/) for more details.
	IDPorten *nais_io_v1.IDPorten `json:"idporten,omitempty"`

	// Your application's Docker image location and tag.
	Image string `json:"image"`

	// List of URLs that will route HTTPS traffic to the application.
	// All URLs must start with `https://`. Domain availability differs according to which environment your application is running in.
	// Check the available environments in the reference documentation.
	Ingresses []nais_io_v1.Ingress `json:"ingresses,omitempty"`

	// An InfluxDB via Aiven. A typical use case for influxdb is to store metrics from your application and visualize them in Grafana.
	// +nais:doc:Availability="GCP"
	Influx *nais_io_v1.Influx `json:"influx,omitempty"`

	// Set up Aiven Kafka for your application.
	// +nais:doc:Link="https://doc.nais.io/explanation/persistence/kafka/"
	Kafka *nais_io_v1.Kafka `json:"kafka,omitempty"`

	// If true, an HTTP endpoint will be available at `$ELECTOR_PATH` that returns the current leader.
	// +nais:doc:Link="https://doc.nais.io/explanation/leader-election/"
	LeaderElection bool `json:"leaderElection,omitempty"`

	// Many applications running for long periods of time eventually transition to broken states,
	// and cannot recover except by being restarted. Kubernetes provides liveness probes to detect
	// and remedy such situations. Read more about this over at the
	// [Kubernetes probes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).
	Liveness *nais_io_v1.Probe `json:"liveness,omitempty"`

	// Format of the logs from the container. Use this if the container doesn't support
	// JSON logging and the log is in a special format that need to be parsed.
	// +kubebuilder:validation:Enum="";accesslog;accesslog_with_processing_time;accesslog_with_referer_useragent;capnslog;logrus;gokit;redis;glog;simple;influxdb;log15
	Logformat string `json:"logformat,omitempty"`

	// Extra filters for modifying log content. This can e.g. be used for setting loglevel based on http status code.
	// +kubebuilder:validation:Enum=http_loglevel;dns_loglevel
	Logtransform string `json:"logtransform,omitempty"`

	// Configures a Maskinporten client for this application.
	// See [Maskinporten](https://doc.nais.io/explanation/auth/maskinporten/) for more details.
	Maskinporten *nais_io_v1.Maskinporten `json:"maskinporten,omitempty"`

	// OpenSearch instance to get credentials for.
	// Must be owned by same team.
	// +nais:doc:Link="https://doc.nais.io/explanation/persistence/open-search/"
	OpenSearch *nais_io_v1.OpenSearch `json:"openSearch,omitempty"`

	// The port number which is exposed by the container and should receive traffic.
	// Note that ports under 1024 are unavailable.
	Port int `json:"port,omitempty"`

	// PreStopHook is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc.
	// The handler is not called if the container crashes or exits by itself.
	// The reason for termination is passed to the handler.
	// +nais:doc:Link="https://doc.nais.io/reference/good-practices/#handles-termination-gracefully";"https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks"
	PreStopHook *nais_io_v1.PreStopHook `json:"preStopHook,omitempty"`

	// A HTTP GET will be issued to this endpoint at least once before the pod is terminated.
	// This feature is deprecated and will be removed in the next major version (nais.io/v1).
	// +nais:doc:Link="https://doc.nais.io/reference/good-practices/#handles-termination-gracefully"
	PreStopHookPath string `json:"preStopHookPath,omitempty"`

	// Prometheus is used to [scrape metrics from the pod](https://doc.nais.io/explanation/observability/metrics/).
	// Use this configuration to override the default values.
	Prometheus *nais_io_v1.PrometheusConfig `json:"prometheus,omitempty"`

	// Sometimes, applications are temporarily unable to serve traffic. For example, an application might need
	// to load large data or configuration files during startup, or depend on external services after startup.
	// In such cases, you don't want to kill the application, but you don’t want to send it requests either.
	// Kubernetes provides readiness probes to detect and mitigate these situations. A pod with containers
	// reporting that they are not ready does not receive traffic through Kubernetes Services.
	// Read more about this over at the [Kubernetes readiness documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/).
	Readiness *nais_io_v1.Probe `json:"readiness,omitempty"`

	// List of redis instances this job needs credentials for.
	// Must be owned by same team.
	// +nais:doc:Link="https://doc.nais.io/explanation/persistence/redis/"
	Redis []nais_io_v1.Redis `json:"redis,omitempty"`

	// The numbers of pods to run in parallel.
	Replicas *nais_io_v1.Replicas `json:"replicas,omitempty"`

	// When Containers have [resource requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) specified,
	// the Kubernetes scheduler can make better decisions about which nodes to place pods on.
	// +nais:doc:Link="https://doc.nais.io/reference/good-practices/#set-reasonable-resource-requests-and-limits"
	Resources *nais_io_v1.ResourceRequirements `json:"resources,omitempty"`

	// Whether or not to enable a sidecar container for secure logging.
	SecureLogs *nais_io_v1.SecureLogs `json:"secureLogs,omitempty"`

	// Specify which port and protocol is used to connect to the application in the container.
	// Defaults to HTTP on port 80.
	Service *nais_io_v1.Service `json:"service,omitempty"`

	// Whether to skip injection of NAV certificate authority bundle or not. Defaults to false.
	SkipCaBundle bool `json:"skipCaBundle,omitempty"`

	// Kubernetes uses startup probes to know when a container application has started. If such a probe is configured,
	// it disables liveness and readiness checks until it succeeds, making sure those probes don't interfere with the
	// application startup. This can be used to adopt liveness checks on slow starting containers, avoiding them getting
	// killed by Kubernetes before they are up and running.
	Startup *nais_io_v1.Probe `json:"startup,omitempty"`

	// Specifies the strategy used to replace old Pods by new ones.
	Strategy *nais_io_v1.Strategy `json:"strategy,omitempty"`

	// Provisions and configures a TokenX client for your application.
	// +nais:doc:Link="https://doc.nais.io/explanation/auth/tokenx/"
	TokenX *nais_io_v1.TokenX `json:"tokenx,omitempty"`

	// The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal.
	// Set this value longer than the expected cleanup time for your process.
	// For most applications, the default is more than enough. Defaults to 30 seconds.
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=180
	TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"`

	// After the specified TTL, the application will be deleted.
	TTL string `json:"ttl,omitempty"`

	// Configuration options related to application observability.
	// +nais:doc:Link="https://doc.nais.io/explanation/observability/"
	Observability *nais_io_v1.Observability `json:"observability,omitempty"`

	// Provides secrets management, identity-based access, and encrypting application data for auditing of secrets
	// for applications, systems, and users.
	// +nais:doc:Link="https://github.com/navikt/vault-iac/tree/master/doc"
	// +nais:doc:Availability="on-premises"
	Vault *nais_io_v1.Vault `json:"vault,omitempty"`

	// Inject on-premises web proxy configuration into the application pod.
	// Most Linux applications should auto-detect these settings from the `$HTTP_PROXY`, `$HTTPS_PROXY` and `$NO_PROXY` environment variables (and their lowercase counterparts).
	// Java applications can start the JVM using parameters from the `$JAVA_PROXY_OPTIONS` environment variable.
	// +nais:doc:Availability="on-premises"
	WebProxy bool `json:"webproxy,omitempty"`
}

ApplicationSpec contains the NAIS manifest. Please keep this list sorted for clarity.

func (*ApplicationSpec) DeepCopy

func (in *ApplicationSpec) DeepCopy() *ApplicationSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ApplicationSpec.

func (*ApplicationSpec) DeepCopyInto

func (in *ApplicationSpec) DeepCopyInto(out *ApplicationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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