Documentation
¶
Overview ¶
Package basichttpapp contains Pulumi functions for creating and managing a BasicHttpApp in Kubernetes.
Using it as a library fosters reusability and modularity, allowing homogeneous, standardized, and consistent deployments across different environments, ensuring that state-of-the-art practices are followed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoRemoteURL is a sentinel error indicating that no remote URL was found in the git repository. ErrNoRemoteURL = fmt.Errorf("remote URL not found") // ErrMultipleRemoteURLs is a sentinel error indicating that multiple remote URLs were found in the git repository. ErrMultipleRemoteURLs = fmt.Errorf("found more than 1 remote URL") // ErrInvalidUrl is a sentinel error indicating that the remote URL is invalid. ErrInvalidUrl = fmt.Errorf("repository remote URL is invlid") )
Functions ¶
func DeployBasicHTTPApp ¶
DeployBasicHTTPApp deploys a basic HTTP application to the Kubernetes cluster, using the provided parameters merged with the default ones, and returns an error if any of the parameters is invalid or if the deployment fails.
Types ¶
type AppParms ¶
type AppParms struct {
// ImageRef is the base image reference, e.g. registry.host.tld/repo/imagename.
ImageRef url.URL
// ImageTag is the image tag, as a SemVer tag. It should not be manually set, as it
// is automatically set to AppVersion.
ImageTag semver.Version
// RuntimeEnv is the runtime environment, i.e. Pulumi stack name. It is used as a suffix to the application name
// in application instance name, ensuring uniqueness across environments.
RuntimeEnv string
// OTelEndpointUrl is the OpenTelemetry collector endpoint URL.
OTelEndpointUrl url.URL
// OtelExporterCompression is the OpenTelemetry exporter compression method.
OtelExporterCompression string
// AppVersion is the application version, as a SemVer tag.
AppVersion semver.Version
// AppName is the application name, i.e. the name of the repository.
AppName string
// AppNamespace is the application namespace, i.e. which group it belongs to (e.g. shoppingcart, auth, ...)
AppNamespace string
// AppComponent is the application role, e.g. frontend, api, database, ...
AppComponent string
// BusinessUnitId is the business unit developing application.
BusinessUnitId businessunit.BusinessUnit
// CustomerId is the customer using the application.
CustomerId customer.Customer
// CostCenter is the cost center to which the application belongs.
CostCenter costcenter.CostCenter
// CostAllocationOwner is the business unit allocating resources to the application, i.e. the budget holder.
CostAllocationOwner businessunit.BusinessUnit
// OperationsOwner is the business unit responsible for developing and maintaining the application.
OperationsOwner businessunit.BusinessUnit
// Rpo is the recovery point objective, i.e. the maximum amount of data that can be lost in case of a failure.
Rpo time.Duration
// DataClassification is the data classification the application is subject to.
DataClassification dataclassification.DataClassification
// ComplianceFramework is the compliance framework the application is subject to.
ComplianceFramework complianceframework.ComplianceFramework
// Expiration is the expiration date of the application, i.e. when should be decommissioned.
Expiration time.Time
// ProjectUrl is the URL of the project, i.e. the URL of the repository.
ProjectUrl url.URL
// MonitoringUrl is the URL of the monitoring system, e.g. the URL of the APM.
MonitoringUrl url.URL
// Capabilities is the list of capabilities to add to the container.
Capabilities corev1.CapabilitiesPtrInput
// RunAsRoot is a boolean indicating if the container should run as root.
RunAsRoot bool
// Port is the port on which the application is listening.
Port int
// HTTPHostnames is the list of hostnames the application is listening on.
HTTPHostnames []string
// HTTPRules is the list of HTTPRoute rules to use for the application.
HTTPRules pulumi.ArrayInput
// HTTPReadTimeout is the HTTP read timeout, in seconds.
HTTPReadTimeout int
// HTTPWriteTimeout is the HTTP write timeout, in seconds.
HTTPWriteTimeout int
// HTTPIdleTimeout is the HTTP idle timeout, in seconds.
HTTPIdleTimeout int
// MetricsExportInterval is the interval in seconds to export metrics.
MetricsExportInterval int
// TracesSampleRatio is the ratio of traces to sample, e.g. 0.1 for 10% of traces.
TracesSampleRatio float64
// CPURequestMiliCPU is the CPU request for the pod, in mili vCPU (will be set as `strconv.Itoa(CPURequestMiliCPU) + "m"`)
CPURequestMiliCPU int
// CPULimitMiliCPU is the CPU limit for the pod, in mili vCPU (will be set as `strconv.Itoa(CPULimitMiliCPU) + "m"`). It will also be used to
// set GOMAXPROCS to 1/1000th of this value, floored
CPULimitMiliCPU int
// MemoryRequestMiB is the memory request for the pod, in MiB (will be set as `strconv.Itoa(MemoryRequestMiB) + "MiB"`)
MemoryRequestMiB int
// MemoryLimitMiB is the memory limit for the pod, in MiB (will be set as `strconv.Itoa(MemoryLimitMiB) + "MiB"`). It will also be used to
// set GOMEMLIMIT to 95% of this value.
MemoryLimitMiB int
// MinReplicas is the minimum number of replicas for the pod, used for HPA
MinReplicas int
// MaxReplicas is the maximum number of replicas for the pod, used for HPA
MaxReplicas int
// ProgressDeadlineSeconds is the maximum time in seconds for the deployment to be ready.
ProgressDeadlineSeconds int
// ImagePullPolicy is the image pull policy to use.
ImagePullPolicy string
// PodAffinity is the pod affinity to use for the pod. Should be set when know pods communicate alot with the application.
PodAffinity corev1.AffinityPtrInput
// PodTolerations is the tolerations to use for the pod.
PodTolerations corev1.TolerationArrayInput
// NodeSelectors is the node selectors to use for the pod.
NodeSelectors pulumi.StringMapInput
// PriorityClassName is the name of the priority class to use for the pod.
PriorityClassName string
// TopologySpreadConstraints is the list of topology spread constraints to use for the pod.
TopologySpreadConstraints corev1.TopologySpreadConstraintArray
// HorizontalPodAutoscalerBehavior is the behavior of the HPA.
HorizontalPodAutoscalerBehavior autoscalingv2.HorizontalPodAutoscalerBehaviorPtrInput
// HorizontalPodAutoscalerBehaviorMetricSpec is the metric spec for the HPA behavior.
HorizontalPodAutoscalerBehaviorMetricSpec autoscalingv2.MetricSpecArray
}
A AppParms contains all the parameters needed to deploy a basic HTTP application
Click to show internal directories.
Click to hide internal directories.