Cloud API Overview > @adpt/cloud > k8s > ServiceDeployment
k8s.ServiceDeployment class
A component for mapping a group of abstract Containers and NetworkServices to Kubernetes k8s.Pods and k8s.K8sContainers.
Signature:
export declare class ServiceDeployment extends DeferredComponent<ServiceDeploymentProps>
Remarks
This component is intended to be used to replace Container and NetworkService components that are grouped together, as the only children of a common parent in a pattern that looks like this:
<Service>
<Container ... />
<Container ... />
<NetworkService ... />
</Service>
ServiceDeployment
would map those abstract components into corresponding k8s components like this:
<Group>
<docker.RegistryDockerImage ... /> //If props.config specifies a registry
<k8s.Pod ... >
<k8s.K8sContainer ... />
</k8s.Pod>
<docker.RegistryDockerImage ... /> //If props.config specifies a registry
<k8s.Pod ... >
<k8s.K8sContainer ... />
</k8s.Pod>
<k8s.Service ... />
</Group>
An example style rule to do this is:
{Adapt.rule((matchedProps) => {
const { handle, ...remainingProps } = matchedProps;
return <ServiceDeployment config={kubeconfig} {...remainingProps} />;
})}
ServiceDeployment
also requires the config
prop which specifies connection and authentication information for the Kubernetes cluster on which these objects should be created.
Methods
Method | Modifiers | Description |
---|---|---|
build(helpers) |