-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #957 from hangyan/support-hostpath-volume
Support hostpath volume
- Loading branch information
Showing
8 changed files
with
296 additions
and
5 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
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
8 changes: 8 additions & 0 deletions
8
script/test/fixtures/volume-mounts/hostpath/docker-compose.yml
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,8 @@ | ||
version: '2' | ||
services: | ||
db: | ||
image: postgres:10.1 | ||
ports: | ||
- "5432" | ||
volumes: | ||
- ./data:/var/lib/postgresql/data |
96 changes: 96 additions & 0 deletions
96
script/test/fixtures/volume-mounts/hostpath/output-k8s-template.json
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,96 @@ | ||
{ | ||
"kind": "List", | ||
"apiVersion": "v1", | ||
"metadata": {}, | ||
"items": [ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "db", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
}, | ||
"annotations": { | ||
"kompose.cmd": "%CMD%", | ||
"kompose.version": "%VERSION%" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "5432", | ||
"port": 5432, | ||
"targetPort": 5432 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "db" | ||
} | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
}, | ||
{ | ||
"kind": "Deployment", | ||
"apiVersion": "extensions/v1beta1", | ||
"metadata": { | ||
"name": "db", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
}, | ||
"annotations": { | ||
"kompose.cmd": "%CMD%", | ||
"kompose.version": "%VERSION%" | ||
} | ||
}, | ||
"spec": { | ||
"replicas": 1, | ||
"template": { | ||
"metadata": { | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
} | ||
}, | ||
"spec": { | ||
"volumes": [ | ||
{ | ||
"name": "db-hostpath0", | ||
"hostPath": { | ||
"path": "%HOSTPATH%" | ||
} | ||
} | ||
], | ||
"containers": [ | ||
{ | ||
"name": "db", | ||
"image": "postgres:10.1", | ||
"ports": [ | ||
{ | ||
"containerPort": 5432 | ||
} | ||
], | ||
"resources": {}, | ||
"volumeMounts": [ | ||
{ | ||
"name": "db-hostpath0", | ||
"mountPath": "/var/lib/postgresql/data" | ||
} | ||
] | ||
} | ||
], | ||
"restartPolicy": "Always" | ||
} | ||
}, | ||
"strategy": { | ||
"type": "Recreate" | ||
} | ||
}, | ||
"status": {} | ||
} | ||
] | ||
} |
147 changes: 147 additions & 0 deletions
147
script/test/fixtures/volume-mounts/hostpath/output-os-template.json
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,147 @@ | ||
{ | ||
"kind": "List", | ||
"apiVersion": "v1", | ||
"metadata": {}, | ||
"items": [ | ||
{ | ||
"kind": "Service", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "db", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
}, | ||
"annotations": { | ||
"kompose.cmd": "%CMD%", | ||
"kompose.version": "%VERSION%" | ||
} | ||
}, | ||
"spec": { | ||
"ports": [ | ||
{ | ||
"name": "5432", | ||
"port": 5432, | ||
"targetPort": 5432 | ||
} | ||
], | ||
"selector": { | ||
"io.kompose.service": "db" | ||
} | ||
}, | ||
"status": { | ||
"loadBalancer": {} | ||
} | ||
}, | ||
{ | ||
"kind": "DeploymentConfig", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "db", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
}, | ||
"annotations": { | ||
"kompose.cmd": "%CMD%", | ||
"kompose.version": "%VERSION%" | ||
} | ||
}, | ||
"spec": { | ||
"strategy": { | ||
"type": "Recreate", | ||
"resources": {} | ||
}, | ||
"triggers": [ | ||
{ | ||
"type": "ConfigChange" | ||
}, | ||
{ | ||
"type": "ImageChange", | ||
"imageChangeParams": { | ||
"automatic": true, | ||
"containerNames": [ | ||
"db" | ||
], | ||
"from": { | ||
"kind": "ImageStreamTag", | ||
"name": "db:10.1" | ||
} | ||
} | ||
} | ||
], | ||
"replicas": 1, | ||
"test": false, | ||
"selector": { | ||
"io.kompose.service": "db" | ||
}, | ||
"template": { | ||
"metadata": { | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
} | ||
}, | ||
"spec": { | ||
"volumes": [ | ||
{ | ||
"name": "db-hostpath0", | ||
"hostPath": { | ||
"path": "%HOSTPATH%" | ||
} | ||
} | ||
], | ||
"containers": [ | ||
{ | ||
"name": "db", | ||
"image": " ", | ||
"ports": [ | ||
{ | ||
"containerPort": 5432 | ||
} | ||
], | ||
"resources": {}, | ||
"volumeMounts": [ | ||
{ | ||
"name": "db-hostpath0", | ||
"mountPath": "/var/lib/postgresql/data" | ||
} | ||
] | ||
} | ||
], | ||
"restartPolicy": "Always" | ||
} | ||
} | ||
}, | ||
"status": {} | ||
}, | ||
{ | ||
"kind": "ImageStream", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "db", | ||
"creationTimestamp": null, | ||
"labels": { | ||
"io.kompose.service": "db" | ||
} | ||
}, | ||
"spec": { | ||
"tags": [ | ||
{ | ||
"name": "10.1", | ||
"annotations": null, | ||
"from": { | ||
"kind": "DockerImage", | ||
"name": "postgres:10.1" | ||
}, | ||
"generation": null, | ||
"importPolicy": {} | ||
} | ||
] | ||
}, | ||
"status": { | ||
"dockerImageRepository": "" | ||
} | ||
} | ||
] | ||
} |