2022-01-27 06:37:46 +00:00
< ng-form name = "serviceForm" >
2022-10-11 21:06:57 +00:00
< div ng-if = "$ctrl.isAdmin()" class = "small" ng-show = "$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER && !$ctrl.loadbalancerEnabled" >
2023-02-12 21:04:24 +00:00
< p class = "text-warning vertical-center pt-2" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > No Load balancer is available in this cluster, click
2022-08-12 18:22:45 +00:00
< a class = "hyperlink" ui-sref = "kubernetes.cluster.setup" > here< / a > to configure load balancer.
2022-01-16 19:37:46 +00:00
< / p >
< / div >
2022-10-11 21:06:57 +00:00
< div ng-if = "!$ctrl.isAdmin()" class = "small" ng-show = "$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER && !$ctrl.loadbalancerEnabled" >
2023-02-12 21:04:24 +00:00
< p class = "text-warning vertical-center pt-2" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > No Load balancer is available in this cluster, contact your administrator.
2022-07-11 02:05:23 +00:00
< / p >
2022-01-16 19:37:46 +00:00
< / div >
< div
ng-if="
2022-10-11 21:06:57 +00:00
($ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER & & $ctrl.loadbalancerEnabled) ||
$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.CLUSTER_IP ||
$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.NODE_PORT
2022-01-16 19:37:46 +00:00
"
>
2023-02-12 21:04:24 +00:00
< div ng-show = "!$ctrl.multiItemDisable" class = "vertical-center mt-5 mb-5" >
< label class = "control-label !pt-0 text-left" > Published ports< / label >
2022-01-16 19:37:46 +00:00
< / div >
2023-02-12 21:04:24 +00:00
< div ng-repeat = "servicePort in $ctrl.service.Ports" class = "service-form row mt-5" >
< div class = "form-group col-sm-3 !mx-0 !pl-0" >
2022-07-11 02:05:23 +00:00
< div class = "input-group input-group-sm" >
2022-08-12 18:22:45 +00:00
< span class = "input-group-addon required" > Container port< / span >
2022-07-11 02:05:23 +00:00
< input
type="number"
class="form-control"
name="container_port_{{ $index }}"
ng-model="servicePort.targetPort"
placeholder="80"
ng-min="1"
ng-max="65535"
2022-10-06 02:24:59 +00:00
min="1"
max="65535"
2022-07-11 02:05:23 +00:00
ng-change="$ctrl.servicePort($index)"
required
2022-10-11 21:06:57 +00:00
ng-disabled="$ctrl.originalIngresses.length === 0 || ($ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER & & !$ctrl.loadbalancerEnabled)"
2022-07-11 02:05:23 +00:00
ng-change="$ctrl.onChangeContainerPort()"
data-cy="k8sAppCreate-containerPort_{{ $index }}"
/>
2022-01-16 19:37:46 +00:00
< / div >
2022-07-11 02:05:23 +00:00
< span >
2023-02-12 21:04:24 +00:00
< div class = "small text-warning mt-1" ng-if = "$ctrl.state.duplicates.targetPort.refs[$index] !== undefined" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > This container port is already used.
2022-01-16 19:37:46 +00:00
< / div >
2023-02-12 21:04:24 +00:00
< div class = "small text-warning mt-1" ng-messages = "serviceForm['container_port_'+$index].$error" >
2022-11-28 02:00:28 +00:00
< p class = "vertical-center" ng-message = "required" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Container port number is required.< / p >
< p class = "vertical-center" ng-message = "min" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Container port number must be inside the range 1-65535.< / p >
< p class = "vertical-center" ng-message = "max" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Container port number must be inside the range 1-65535.< / p >
2022-01-16 19:37:46 +00:00
< / div >
2022-07-11 02:05:23 +00:00
< / span >
< / div >
2022-01-16 19:37:46 +00:00
2023-02-12 21:04:24 +00:00
< div class = "form-group col-sm-3 !mx-0 !pl-0" >
2022-07-11 02:05:23 +00:00
< div class = "input-group input-group-sm" >
2022-08-12 18:22:45 +00:00
< span class = "input-group-addon required" > Service port< / span >
2022-07-11 02:05:23 +00:00
< input
type="number"
class="form-control"
name="service_port_{{ $index }}"
ng-model="servicePort.port"
placeholder="80"
ng-min="1"
ng-max="65535"
2022-10-06 02:24:59 +00:00
min="1"
max="65535"
2022-07-11 02:05:23 +00:00
required
2022-10-11 21:06:57 +00:00
ng-disabled="$ctrl.originalIngresses.length === 0 || ($ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER & & !$ctrl.loadbalancerEnabled)"
2022-07-11 02:05:23 +00:00
ng-change="$ctrl.onChangeServicePort()"
data-cy="k8sAppCreate-servicePort_{{ $index }}"
/>
< / div >
< span >
2023-02-12 21:04:24 +00:00
< div class = "small text-warning mt-1" ng-if = "$ctrl.state.duplicates.servicePort.refs[$index] !== undefined" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > This service port is already used.
2022-01-16 19:37:46 +00:00
< / div >
2023-02-12 21:04:24 +00:00
< div class = "small text-warning mt-1" >
2022-01-16 19:37:46 +00:00
< div ng-messages = "serviceForm['service_port_'+$index].$error" >
2022-11-28 02:00:28 +00:00
< p class = "vertical-center" ng-message = "required" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Service port number is required.< / p >
< p class = "vertical-center" ng-message = "min" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Service port number must be inside the range 1-65535.< / p >
< p class = "vertical-center" ng-message = "max" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Service port number must be inside the range 1-65535.< / p >
2022-01-16 19:37:46 +00:00
< / div >
< / div >
2022-07-11 02:05:23 +00:00
< / span >
< / div >
2022-01-16 19:37:46 +00:00
2023-02-12 21:04:24 +00:00
< div class = "form-group col-sm-3 !mx-0 !pl-0" ng-if = "$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.NODE_PORT" >
2022-07-11 02:05:23 +00:00
< div class = "input-group input-group-sm" >
2022-08-12 18:22:45 +00:00
< span class = "input-group-addon required" > Nodeport< / span >
2022-07-11 02:05:23 +00:00
< input
type="number"
class="form-control"
name="node_port_{{ $index }}"
ng-model="servicePort.nodePort"
placeholder="30080"
ng-min="30000"
ng-max="32767"
2022-10-06 02:24:59 +00:00
min="30000"
max="32767"
2022-08-12 18:22:45 +00:00
required
2022-07-11 02:05:23 +00:00
ng-change="$ctrl.onChangeNodePort()"
data-cy="k8sAppCreate-nodeportPort_{{ $index }}"
/>
< / div >
< div class = "w-full" >
< span >
2023-02-12 21:04:24 +00:00
< div class = "small text-warning mt-1" >
2022-07-11 02:05:23 +00:00
< div ng-messages = "serviceForm['node_port_'+$index].$error" >
2022-11-28 02:00:28 +00:00
< p class = "vertical-center" ng-message = "required" > < pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Nodeport is required.< / p >
2022-08-12 18:22:45 +00:00
< p class = "vertical-center" ng-message = "min"
2022-11-28 02:00:28 +00:00
>< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Nodeport number must be inside the range 30000-32767 or blank for system allocated.< /p
2022-07-11 02:05:23 +00:00
>
2022-08-12 18:22:45 +00:00
< p class = "vertical-center" ng-message = "max"
2022-11-28 02:00:28 +00:00
>< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > Nodeport number must be inside the range 30000-32767 or blank for system allocated.< /p
2022-07-11 02:05:23 +00:00
>
2023-02-12 21:04:24 +00:00
< div class = "text-warning mt-1" ng-if = "$ctrl.state.duplicates.nodePort.refs[$index] !== undefined" >
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'alert-triangle'" mode = "'warning'" > < / pr-icon > This node port is already used.
2022-10-11 21:06:57 +00:00
< / div >
2022-07-11 02:05:23 +00:00
< / div >
2022-01-16 19:37:46 +00:00
< / div >
2022-07-11 02:05:23 +00:00
< / span >
< / div >
< / div >
2023-02-12 21:04:24 +00:00
< div class = "form-group col-sm-3 !mx-0 !pl-0" ng-if = "$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER" >
2022-07-11 02:05:23 +00:00
< div class = "input-group input-group-sm" >
2022-08-12 18:22:45 +00:00
< span class = "input-group-addon" > Loadbalancer port< / span >
2022-07-11 02:05:23 +00:00
< input
type="number"
class="form-control"
name="loadbalancer_port_{{ $index }}"
ng-model="servicePort.port"
placeholder="80"
ng-min="1"
ng-max="65535"
2022-10-06 02:24:59 +00:00
min="1"
max="65535"
2022-07-11 02:05:23 +00:00
required
2022-10-11 21:06:57 +00:00
ng-disabled="$ctrl.service.Type === $ctrl.KubernetesApplicationPublishingTypes.LOAD_BALANCER & & !$ctrl.loadbalancerEnabled"
2022-07-11 02:05:23 +00:00
data-cy="k8sAppCreate-loadbalancerPort_{{ $index }}"
/>
2022-01-16 19:37:46 +00:00
< / div >
2022-07-11 02:05:23 +00:00
< / div >
2022-01-16 19:37:46 +00:00
2023-02-12 21:04:24 +00:00
< div class = "form-group col-sm-3 !mx-0 !pl-0" >
2022-07-11 02:05:23 +00:00
< div class = "input-group input-group-sm" >
< div class = "btn-group btn-group-sm" >
< label
class="btn btn-light"
ng-model="servicePort.protocol"
uib-btn-radio="'TCP'"
ng-change="ctrl.onChangePortProtocol($index)"
ng-disabled="ctrl.isProtocolOptionDisabled($index, 'TCP')"
data-cy="k8sAppCreate-TCPButton_{{ $index }}"
>TCP< /label
>
< label
class="btn btn-light"
ng-model="servicePort.protocol"
uib-btn-radio="'UDP'"
ng-change="ctrl.onChangePortProtocol($index)"
ng-disabled="ctrl.isProtocolOptionDisabled($index, 'UDP')"
data-cy="k8sAppCreate-UDPButton_{{ $index }}"
>UDP< /label
>
< / div >
< button
2022-10-11 21:06:57 +00:00
ng-disabled="$ctrl.service.Ports.length === 1"
2022-07-11 02:05:23 +00:00
ng-show="!$ctrl.multiItemDisable"
2022-08-12 18:22:45 +00:00
class="btn btn-sm btn-dangerlight btn-only-icon"
2022-07-11 02:05:23 +00:00
type="button"
ng-click="$ctrl.removePort($index)"
data-cy="k8sAppCreate-rmPortButton_{{ $index }}"
>
2022-11-28 02:00:28 +00:00
< pr-icon icon = "'trash-2'" size = "'md'" > < / pr-icon >
2022-07-11 02:05:23 +00:00
< / button >
2022-01-16 19:37:46 +00:00
< / div >
< / div >
< / div >
2023-03-01 00:11:12 +00:00
< div class = "mt-4" >
< span class = "btn btn-primary btn-sm btn btn-sm btn-light mb-2 !ml-0" ng-click = "$ctrl.addPort()" data-cy = "k8sAppCreate-addNewPortButton" >
< pr-icon icon = "'plus'" size = "'sm'" > < / pr-icon > Publish a new port
< / span >
< / div >
2022-01-16 19:37:46 +00:00
< / div >
2022-01-27 06:37:46 +00:00
< / ng-form >