-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Add hostPort and protocol to containers (#1558)
* feat: add the host port to containers * test(unit): add unit tests for host port and protocol * test(functional): add functional tests of host port and protocol * test(functional): add functional tests of host port and protocol for openshift
- Loading branch information
1 parent
d43aefd
commit 9ab4ef3
Showing
6 changed files
with
224 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
script/test/fixtures/host-port-protocol/docker-compose.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3.3" | ||
|
||
services: | ||
nginx: | ||
ports: | ||
- target: 80 | ||
published: 80 | ||
protocol: tcp | ||
mode: host | ||
image: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nginx | ||
name: nginx | ||
spec: | ||
ports: | ||
- name: "80" | ||
port: 80 | ||
targetPort: 80 | ||
selector: | ||
io.kompose.service: nginx | ||
status: | ||
loadBalancer: {} | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nginx | ||
name: nginx | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
io.kompose.service: nginx | ||
strategy: {} | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.network/host-port-protocol-default: "true" | ||
io.kompose.service: nginx | ||
spec: | ||
containers: | ||
- image: nginx | ||
name: nginx | ||
ports: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
resources: {} | ||
restartPolicy: Always | ||
status: {} | ||
|
||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: NetworkPolicy | ||
metadata: | ||
creationTimestamp: null | ||
name: host-port-protocol-default | ||
spec: | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
io.kompose.network/host-port-protocol-default: "true" | ||
podSelector: | ||
matchLabels: | ||
io.kompose.network/host-port-protocol-default: "true" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nginx | ||
name: nginx | ||
spec: | ||
ports: | ||
- name: "80" | ||
port: 80 | ||
targetPort: 80 | ||
selector: | ||
io.kompose.service: nginx | ||
status: | ||
loadBalancer: {} | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: DeploymentConfig | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nginx | ||
name: nginx | ||
spec: | ||
replicas: 1 | ||
selector: | ||
io.kompose.service: nginx | ||
strategy: | ||
resources: {} | ||
template: | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.network/host-port-protocol-default: "true" | ||
io.kompose.service: nginx | ||
spec: | ||
containers: | ||
- image: ' ' | ||
name: nginx | ||
ports: | ||
- containerPort: 80 | ||
hostPort: 80 | ||
protocol: TCP | ||
resources: {} | ||
restartPolicy: Always | ||
test: false | ||
triggers: | ||
- type: ConfigChange | ||
- imageChangeParams: | ||
automatic: true | ||
containerNames: | ||
- nginx | ||
from: | ||
kind: ImageStreamTag | ||
name: nginx:latest | ||
type: ImageChange | ||
status: | ||
availableReplicas: 0 | ||
latestVersion: 0 | ||
observedGeneration: 0 | ||
replicas: 0 | ||
unavailableReplicas: 0 | ||
updatedReplicas: 0 | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: ImageStream | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: nginx | ||
name: nginx | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
tags: | ||
- annotations: null | ||
from: | ||
kind: DockerImage | ||
name: nginx | ||
generation: null | ||
importPolicy: {} | ||
name: latest | ||
referencePolicy: | ||
type: "" | ||
status: | ||
dockerImageRepository: "" | ||
|