Search in sources :

Example 1 with KnativeContainerModel

use of org.ballerinax.kubernetes.models.knative.KnativeContainerModel in project kubernetes by ballerinax.

the class KnativeContainerHandler method createArtifacts.

@Override
public void createArtifacts() throws KubernetesPluginException {
    // Service
    ServiceModel deploymentModel = knativeDataHolder.getServiceModel();
    Map<String, KnativeContainerModel> serviceModels = knativeDataHolder.getbListenerToK8sServiceMap();
    int count = 0;
    for (KnativeContainerModel serviceModel : serviceModels.values()) {
        count++;
        String balxFileName = extractJarName(KnativeContext.getInstance().getDataHolder().getUberJarPath());
        serviceModel.addLabel(KubernetesConstants.KUBERNETES_SELECTOR_KEY, balxFileName);
        serviceModel.setSelector(balxFileName);
        generate(serviceModel);
        deploymentModel.addPort(serviceModel.getTargetPort());
    }
}
Also used : ServiceModel(org.ballerinax.kubernetes.models.knative.ServiceModel) KnativeContainerModel(org.ballerinax.kubernetes.models.knative.KnativeContainerModel)

Aggregations

KnativeContainerModel (org.ballerinax.kubernetes.models.knative.KnativeContainerModel)1 ServiceModel (org.ballerinax.kubernetes.models.knative.ServiceModel)1