Fix OpenShift tests for build and push

This commit is contained in:
Anush Shetty
2017-08-09 19:15:44 +05:30
73 changed files with 3118 additions and 1768 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
# Copyright 2017 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
# Copyright 2017 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
+50 -6
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
# Copyright 2017 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,9 +15,9 @@
# limitations under the License.
# Constants. Enter relevant repo information here.
UPSTREAM_REPO="kubernetes-incubator"
UPSTREAM_REPO="kubernetes"
CLI="kompose"
GITPATH="$GOPATH/src/github.com/kubernetes-incubator/kompose"
GITPATH="$GOPATH/src/github.com/kubernetes/kompose"
usage() {
echo "This will prepare $CLI for release!"
@@ -97,8 +97,11 @@ replaceversion() {
echo "Replaced version in README.md"
sed -i "s/$1/$2/g" README.md
echo "Replaced version in docs/setup.md"
sed -i "s/$1/$2/g" docs/setup.md
echo "Replaced version in docs/installation.md"
sed -i "s/$1/$2/g" docs/installation.md
echo "Replaced version in build/VERSION"
sed -i "s/$1/$2/g" build/VERSION
}
changelog() {
@@ -159,6 +162,43 @@ git_tag() {
git tag v$1
}
generate_install_guide() {
echo "
# Installation
__Linux and macOS:__
\`\`\`sh
# Linux
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-linux-amd64 -o kompose
# macOS
curl -L https://github.com/kubernetes/kompose/releases/download/v$1/kompose-darwin-amd64 -o kompose
chmod +x kompose
sudo mv ./kompose /usr/local/bin/kompose
\`\`\`
__Windows:__
Download from [GitHub](https://github.com/kubernetes/kompose/releases/download/v$1/kompose-windows-amd64.exe) and add the binary to your PATH.
__Checksums:__
| Filename | SHA256 Hash |
| ------------- |:-------------:|" > install_guide.txt
for f in bin/*
do
HASH=`sha256sum $f | head -n1 | awk '{print $1;}'`
NAME=`echo $f | sed "s,bin/,,g"`
echo "[$NAME](https://github.com/kubernetes/kompose/releases/download/v$1/$NAME) | $HASH" >> install_guide.txt
done
# Append the file to the file
cat install_guide.txt >> changes.txt
}
push() {
CHANGES=$(cat changes.txt)
# Release it!
@@ -204,7 +244,7 @@ push() {
}
clean() {
rm changes.txt
rm changes.txt install_guide.txt
}
main() {
@@ -248,6 +288,7 @@ main() {
"Create tag"
"Build binaries"
"Create tarballs"
"Generate install guide"
"Upload the binaries and push to GitHub release page"
"Clean"
"Quit")
@@ -282,6 +323,9 @@ main() {
"Create tarballs")
create_tarballs
;;
"Generate install guide")
generate_install_guide $VERSION
;;
"Upload the binaries and push to GitHub release page")
push $VERSION
;;
+3 -2
View File
@@ -7,7 +7,7 @@ if [ "$TRAVIS_BRANCH" != "master" ] || [ "$BUILD_DOCS" != "yes" ] || [ "$TRAVIS_
fi
DOCS_REPO_NAME="kompose"
DOCS_REPO_URL="git@github.com:kubernetes-incubator/kompose.git"
DOCS_REPO_URL="git@github.com:kubernetes/kompose.git"
DOCS_KEY="script/deploy_key"
DOCS_USER="komposebot"
DOCS_EMAIL="cdrage+kompose@redhat.com"
@@ -65,6 +65,7 @@ for filename in *.md; do
jekyll="---
layout: default
permalink: /$name/
redirect_from: \"/docs/$name.md\"
---
"
echo -e "$jekyll\n$(cat $filename)" > $filename
@@ -80,7 +81,7 @@ git config user.email "$DOCS_EMAIL"
git add --all
# Check if anything changed, and if it's the case, push to origin/master.
if git commit -m 'Update docs' -m "Commit: https://github.com/kubernetes-incubator/kompose/commit/$TRAVIS_COMMIT" ; then
if git commit -m 'Update docs' -m "Commit: https://github.com/kubernetes/kompose/commit/$TRAVIS_COMMIT" ; then
git push
fi
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
# Copyright 2017 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
# Copyright 2017 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
+10 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2016 The Kubernetes Authors All rights reserved.
# Copyright 2017 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -106,6 +106,12 @@ convert::expect_success_and_warning "kompose -f $KOMPOSE_ROOT/script/test/fixtur
# openshift test
convert::expect_success_and_warning "kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/volumes-from/docker-compose.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/volume-mounts/volumes-from/output-os.json" "ignoring path on the host"
# Tests related to docker-compose file in /script/test/fixtures/volume-mounts/volumes-from corner cases
# kubernetes test
convert::expect_success "kompose -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/volumes-from/docker-compose-case.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/volume-mounts/volumes-from/output-k8s-case.json"
# openshift test
convert::expect_success "kompose --provider=openshift -f $KOMPOSE_ROOT/script/test/fixtures/volume-mounts/volumes-from/docker-compose-case.yml convert --stdout -j" "$KOMPOSE_ROOT/script/test/fixtures/volume-mounts/volumes-from/output-os-case.json"
######
# Tests related to docker-compose file in /script/test/fixtures/envvars-separators
@@ -264,6 +270,9 @@ cd $CURRENT_DIR
# Test V3 Support of Docker Compose
# Test support for cpu and memory limits + reservations
convert::expect_success "kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-memcpu.yaml" "$KOMPOSE_ROOT/script/test/fixtures/v3/output-memcpu-k8s.json"
# Test volumes are passed correctly
convert::expect_success "kompose convert --stdout -j -f $KOMPOSE_ROOT/script/test/fixtures/v3/docker-compose-volumes.yaml" "$KOMPOSE_ROOT/script/test/fixtures/v3/output-volumes-k8s.json"
+10 -10
View File
@@ -95,16 +95,16 @@
"image": "bitnami/mariadb:latest",
"env": [
{
"name": "MARIADB_USER",
"value": "bn_wordpress"
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
},
{
"name": "MARIADB_DATABASE",
"value": "bitnami_wordpress"
},
{
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
"name": "MARIADB_USER",
"value": "bn_wordpress"
}
],
"resources": {},
@@ -200,6 +200,10 @@
}
],
"env": [
{
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
},
{
"name": "MARIADB_HOST",
"value": "mariadb"
@@ -208,17 +212,13 @@
"name": "MARIADB_PORT",
"value": "3306"
},
{
"name": "WORDPRESS_DATABASE_USER",
"value": "bn_wordpress"
},
{
"name": "WORDPRESS_DATABASE_NAME",
"value": "bitnami_wordpress"
},
{
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
"name": "WORDPRESS_DATABASE_USER",
"value": "bn_wordpress"
}
],
"resources": {},
+10 -10
View File
@@ -121,16 +121,16 @@
"image": " ",
"env": [
{
"name": "MARIADB_USER",
"value": "bn_wordpress"
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
},
{
"name": "MARIADB_DATABASE",
"value": "bitnami_wordpress"
},
{
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
"name": "MARIADB_USER",
"value": "bn_wordpress"
}
],
"resources": {},
@@ -277,6 +277,10 @@
}
],
"env": [
{
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
},
{
"name": "MARIADB_HOST",
"value": "mariadb"
@@ -285,17 +289,13 @@
"name": "MARIADB_PORT",
"value": "3306"
},
{
"name": "WORDPRESS_DATABASE_USER",
"value": "bn_wordpress"
},
{
"name": "WORDPRESS_DATABASE_NAME",
"value": "bitnami_wordpress"
},
{
"name": "ALLOW_EMPTY_PASSWORD",
"value": "yes"
"name": "WORDPRESS_DATABASE_USER",
"value": "bn_wordpress"
}
],
"resources": {},
+1 -1
View File
@@ -39,7 +39,7 @@ services:
cpus: '0.0001'
memory: 20M
restart_policy:
condition: on_failure
condition: on-failure
delay: 5s
max_attempts: 3
window: 120s
+13
View File
@@ -0,0 +1,13 @@
version: "3"
services:
foo:
deploy:
resources:
limits:
cpus: '0.01'
memory: 50M
reservations:
cpus: '0.001'
memory: 20M
image: redis
+171 -327
View File
@@ -4,372 +4,216 @@
"metadata": {},
"items": [
{
"kind": "Service",
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"com.example.description": "Accounting webapp",
"com.example.empty-label": "",
"com.example.number": "42"
}
},
"spec": {
"ports": [
"volumes": [
{
"name": "3000",
"port": 3000,
"targetPort": 3000
},
{
"name": "3000",
"port": 3000,
"targetPort": 3000
},
{
"name": "3001",
"port": 3001,
"targetPort": 3001
},
{
"name": "3002",
"port": 3002,
"targetPort": 3002
},
{
"name": "3003",
"port": 3003,
"targetPort": 3003
},
{
"name": "3004",
"port": 3004,
"targetPort": 3004
},
{
"name": "3005",
"port": 3005,
"targetPort": 3005
},
{
"name": "8000",
"port": 8000,
"targetPort": 8000
},
{
"name": "9090",
"port": 9090,
"targetPort": 8080
},
{
"name": "9091",
"port": 9091,
"targetPort": 8081
},
{
"name": "49100",
"port": 49100,
"targetPort": 22
},
{
"name": "8001",
"port": 8001,
"targetPort": 8001
},
{
"name": "5000",
"port": 5000,
"targetPort": 5000
},
{
"name": "5001",
"port": 5001,
"targetPort": 5001
},
{
"name": "5002",
"port": 5002,
"targetPort": 5002
},
{
"name": "5003",
"port": 5003,
"targetPort": 5003
},
{
"name": "5004",
"port": 5004,
"targetPort": 5004
},
{
"name": "5005",
"port": 5005,
"targetPort": 5005
},
{
"name": "5006",
"port": 5006,
"targetPort": 5006
},
{
"name": "5007",
"port": 5007,
"targetPort": 5007
},
{
"name": "5008",
"port": 5008,
"targetPort": 5008
},
{
"name": "5009",
"port": 5009,
"targetPort": 5009
},
{
"name": "5010",
"port": 5010,
"targetPort": 5010
}
],
"selector": {
"io.kompose.service": "foo"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"com.example.description": "Accounting webapp",
"com.example.empty-label": "",
"com.example.number": "42"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
},
"spec": {
"volumes": [
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
},
{
"name": "foo-claim2",
"persistentVolumeClaim": {
"claimName": "foo-claim2"
}
},
{
"name": "foo-claim3",
"persistentVolumeClaim": {
"claimName": "foo-claim3"
}
},
{
"name": "foo-claim4",
"persistentVolumeClaim": {
"claimName": "foo-claim4",
"readOnly": true
}
},
{
"name": "datavolume",
"persistentVolumeClaim": {
"claimName": "datavolume"
}
},
{
"name": "foo-tmpfs0",
"emptyDir": {
"medium": "Memory"
}
},
{
"name": "foo-tmpfs1",
"emptyDir": {
"medium": "Memory"
}
}
],
"containers": [
{
"name": "my-web-container",
"image": "redis",
"command": [
"/code/entrypoint.sh",
"-p",
"3000"
],
"args": [
"bundle",
"exec",
"thin",
"-p",
"3000"
],
"workingDir": "/code",
"ports": [
{
"containerPort": 3000
},
{
"containerPort": 3000
},
{
"containerPort": 3001
},
{
"containerPort": 3002
},
{
"containerPort": 3003
},
{
"containerPort": 3004
},
{
"containerPort": 3005
},
{
"containerPort": 8000
},
{
"containerPort": 8080
},
{
"containerPort": 8081
},
{
"containerPort": 22
},
{
"containerPort": 8001
},
{
"containerPort": 5000
},
{
"containerPort": 5001
},
{
"containerPort": 5002
},
{
"containerPort": 5003
},
{
"containerPort": 5004
},
{
"containerPort": 5005
},
{
"containerPort": 5006
},
{
"containerPort": 5007
},
{
"containerPort": 5008
},
{
"containerPort": 5009
},
{
"containerPort": 5010
}
],
"resources": {
"limits": {
"cpu": "1",
"memory": "52428800"
},
"requests": {
"memory": "20971520"
}
},
"volumeMounts": [
{
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim2",
"persistentVolumeClaim": {
"claimName": "foo-claim2"
}
"mountPath": "/code"
},
{
"name": "foo-claim3",
"persistentVolumeClaim": {
"claimName": "foo-claim3"
}
"mountPath": "/var/www/html"
},
{
"name": "foo-claim4",
"persistentVolumeClaim": {
"claimName": "foo-claim4",
"readOnly": true
}
"readOnly": true,
"mountPath": "/etc/configs/"
},
{
"name": "datavolume",
"persistentVolumeClaim": {
"claimName": "datavolume"
}
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-tmpfs0",
"emptyDir": {
"medium": "Memory"
}
"mountPath": "/run"
},
{
"name": "foo-tmpfs1",
"emptyDir": {
"medium": "Memory"
}
"mountPath": "/tmp"
}
],
"containers": [
{
"name": "my-web-container",
"image": "redis",
"command": [
"/code/entrypoint.sh",
"-p",
"3000"
"securityContext": {
"capabilities": {
"add": [
"ALL"
],
"args": [
"bundle",
"exec",
"thin",
"-p",
"3000"
],
"workingDir": "/code",
"ports": [
{
"containerPort": 3000
},
{
"containerPort": 3000
},
{
"containerPort": 3001
},
{
"containerPort": 3002
},
{
"containerPort": 3003
},
{
"containerPort": 3004
},
{
"containerPort": 3005
},
{
"containerPort": 8000
},
{
"containerPort": 8080
},
{
"containerPort": 8081
},
{
"containerPort": 22
},
{
"containerPort": 8001
},
{
"containerPort": 5000
},
{
"containerPort": 5001
},
{
"containerPort": 5002
},
{
"containerPort": 5003
},
{
"containerPort": 5004
},
{
"containerPort": 5005
},
{
"containerPort": 5006
},
{
"containerPort": 5007
},
{
"containerPort": 5008
},
{
"containerPort": 5009
},
{
"containerPort": 5010
}
],
"resources": {
"limits": {
"memory": "52428800"
}
},
"volumeMounts": [
{
"name": "foo-claim0",
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim1",
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim2",
"mountPath": "/code"
},
{
"name": "foo-claim3",
"mountPath": "/var/www/html"
},
{
"name": "foo-claim4",
"readOnly": true,
"mountPath": "/etc/configs/"
},
{
"name": "datavolume",
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-tmpfs0",
"mountPath": "/run"
},
{
"name": "foo-tmpfs1",
"mountPath": "/tmp"
}
],
"securityContext": {
"capabilities": {
"add": [
"ALL"
],
"drop": [
"NET_ADMIN",
"SYS_ADMIN"
]
},
"privileged": true
},
"stdin": true,
"tty": true
}
],
"restartPolicy": "Always"
"drop": [
"NET_ADMIN",
"SYS_ADMIN"
]
},
"privileged": true
},
"stdin": true,
"tty": true
}
},
"strategy": {
"type": "Recreate"
}
],
"restartPolicy": "OnFailure"
},
"status": {}
},
+77
View File
@@ -0,0 +1,77 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "foo"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"containers": [
{
"name": "foo",
"image": "redis",
"resources": {
"limits": {
"cpu": "10",
"memory": "52428800"
},
"requests": {
"cpu": "1",
"memory": "20971520"
}
}
}
],
"restartPolicy": "Always"
}
},
"strategy": {}
},
"status": {}
}
]
}
+155 -362
View File
@@ -4,426 +4,219 @@
"metadata": {},
"items": [
{
"kind": "Service",
"kind": "Pod",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"com.example.description": "Accounting webapp",
"com.example.empty-label": "",
"com.example.number": "42"
}
},
"spec": {
"ports": [
"volumes": [
{
"name": "3000",
"port": 3000,
"targetPort": 3000
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
},
{
"name": "3000",
"port": 3000,
"targetPort": 3000
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
},
{
"name": "3001",
"port": 3001,
"targetPort": 3001
"name": "foo-claim2",
"persistentVolumeClaim": {
"claimName": "foo-claim2"
}
},
{
"name": "3002",
"port": 3002,
"targetPort": 3002
"name": "foo-claim3",
"persistentVolumeClaim": {
"claimName": "foo-claim3"
}
},
{
"name": "3003",
"port": 3003,
"targetPort": 3003
"name": "foo-claim4",
"persistentVolumeClaim": {
"claimName": "foo-claim4",
"readOnly": true
}
},
{
"name": "3004",
"port": 3004,
"targetPort": 3004
"name": "datavolume",
"persistentVolumeClaim": {
"claimName": "datavolume"
}
},
{
"name": "3005",
"port": 3005,
"targetPort": 3005
"name": "foo-tmpfs0",
"emptyDir": {
"medium": "Memory"
}
},
{
"name": "8000",
"port": 8000,
"targetPort": 8000
},
{
"name": "9090",
"port": 9090,
"targetPort": 8080
},
{
"name": "9091",
"port": 9091,
"targetPort": 8081
},
{
"name": "49100",
"port": 49100,
"targetPort": 22
},
{
"name": "8001",
"port": 8001,
"targetPort": 8001
},
{
"name": "5000",
"port": 5000,
"targetPort": 5000
},
{
"name": "5001",
"port": 5001,
"targetPort": 5001
},
{
"name": "5002",
"port": 5002,
"targetPort": 5002
},
{
"name": "5003",
"port": 5003,
"targetPort": 5003
},
{
"name": "5004",
"port": 5004,
"targetPort": 5004
},
{
"name": "5005",
"port": 5005,
"targetPort": 5005
},
{
"name": "5006",
"port": 5006,
"targetPort": 5006
},
{
"name": "5007",
"port": 5007,
"targetPort": 5007
},
{
"name": "5008",
"port": 5008,
"targetPort": 5008
},
{
"name": "5009",
"port": 5009,
"targetPort": 5009
},
{
"name": "5010",
"port": 5010,
"targetPort": 5010
"name": "foo-tmpfs1",
"emptyDir": {
"medium": "Memory"
}
}
],
"selector": {
"io.kompose.service": "foo"
}
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
},
"annotations": {
"com.example.description": "Accounting webapp",
"com.example.empty-label": "",
"com.example.number": "42"
}
},
"spec": {
"strategy": {
"type": "Recreate",
"resources": {}
},
"triggers": [
"containers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"my-web-container"
],
"from": {
"kind": "ImageStreamTag",
"name": "foo:latest"
"name": "my-web-container",
"image": "redis",
"command": [
"/code/entrypoint.sh",
"-p",
"3000"
],
"args": [
"bundle",
"exec",
"thin",
"-p",
"3000"
],
"workingDir": "/code",
"ports": [
{
"containerPort": 3000
},
{
"containerPort": 3000
},
{
"containerPort": 3001
},
{
"containerPort": 3002
},
{
"containerPort": 3003
},
{
"containerPort": 3004
},
{
"containerPort": 3005
},
{
"containerPort": 8000
},
{
"containerPort": 8080
},
{
"containerPort": 8081
},
{
"containerPort": 22
},
{
"containerPort": 8001
},
{
"containerPort": 5000
},
{
"containerPort": 5001
},
{
"containerPort": 5002
},
{
"containerPort": 5003
},
{
"containerPort": 5004
},
{
"containerPort": 5005
},
{
"containerPort": 5006
},
{
"containerPort": 5007
},
{
"containerPort": 5008
},
{
"containerPort": 5009
},
{
"containerPort": 5010
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "foo"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"volumes": [
],
"resources": {
"limits": {
"cpu": "1",
"memory": "52428800"
},
"requests": {
"memory": "20971520"
}
},
"volumeMounts": [
{
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim2",
"persistentVolumeClaim": {
"claimName": "foo-claim2"
}
"mountPath": "/code"
},
{
"name": "foo-claim3",
"persistentVolumeClaim": {
"claimName": "foo-claim3"
}
"mountPath": "/var/www/html"
},
{
"name": "foo-claim4",
"persistentVolumeClaim": {
"claimName": "foo-claim4",
"readOnly": true
}
"readOnly": true,
"mountPath": "/etc/configs/"
},
{
"name": "datavolume",
"persistentVolumeClaim": {
"claimName": "datavolume"
}
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-tmpfs0",
"emptyDir": {
"medium": "Memory"
}
"mountPath": "/run"
},
{
"name": "foo-tmpfs1",
"emptyDir": {
"medium": "Memory"
}
"mountPath": "/tmp"
}
],
"containers": [
{
"name": "my-web-container",
"image": " ",
"command": [
"/code/entrypoint.sh",
"-p",
"3000"
"securityContext": {
"capabilities": {
"add": [
"ALL"
],
"args": [
"bundle",
"exec",
"thin",
"-p",
"3000"
],
"workingDir": "/code",
"ports": [
{
"containerPort": 3000
},
{
"containerPort": 3000
},
{
"containerPort": 3001
},
{
"containerPort": 3002
},
{
"containerPort": 3003
},
{
"containerPort": 3004
},
{
"containerPort": 3005
},
{
"containerPort": 8000
},
{
"containerPort": 8080
},
{
"containerPort": 8081
},
{
"containerPort": 22
},
{
"containerPort": 8001
},
{
"containerPort": 5000
},
{
"containerPort": 5001
},
{
"containerPort": 5002
},
{
"containerPort": 5003
},
{
"containerPort": 5004
},
{
"containerPort": 5005
},
{
"containerPort": 5006
},
{
"containerPort": 5007
},
{
"containerPort": 5008
},
{
"containerPort": 5009
},
{
"containerPort": 5010
}
],
"resources": {
"limits": {
"memory": "52428800"
}
},
"volumeMounts": [
{
"name": "foo-claim0",
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim1",
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-claim2",
"mountPath": "/code"
},
{
"name": "foo-claim3",
"mountPath": "/var/www/html"
},
{
"name": "foo-claim4",
"readOnly": true,
"mountPath": "/etc/configs/"
},
{
"name": "datavolume",
"mountPath": "/var/lib/mysql"
},
{
"name": "foo-tmpfs0",
"mountPath": "/run"
},
{
"name": "foo-tmpfs1",
"mountPath": "/tmp"
}
],
"securityContext": {
"capabilities": {
"add": [
"ALL"
],
"drop": [
"NET_ADMIN",
"SYS_ADMIN"
]
},
"privileged": true
},
"stdin": true,
"tty": true
}
],
"restartPolicy": "Always"
"drop": [
"NET_ADMIN",
"SYS_ADMIN"
]
},
"privileged": true
},
"stdin": true,
"tty": true
}
}
],
"restartPolicy": "OnFailure"
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "redis"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
@@ -0,0 +1,29 @@
version: '2'
services:
foo:
image: busybox
command: sleep 3600
volumes:
- /foo1
- /foo2
volumes_from:
- cat
bar:
image: busybox
command: sleep 3600
volumes:
- /foo1
- /bar
volumes_from:
- foo
cat:
image: busybox
command: sleep 3600
volumes:
- /cat
@@ -0,0 +1,388 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "bar",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "bar"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "cat",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "cat"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "foo"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "bar",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"volumes": [
{
"name": "bar-claim1",
"persistentVolumeClaim": {
"claimName": "bar-claim1"
}
},
{
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
},
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
},
{
"name": "cat-claim0",
"persistentVolumeClaim": {
"claimName": "cat-claim0"
}
}
],
"containers": [
{
"name": "bar",
"image": "busybox",
"args": [
"sleep",
"3600"
],
"resources": {},
"volumeMounts": [
{
"name": "bar-claim1",
"mountPath": "/bar"
},
{
"name": "foo-claim0",
"mountPath": "/foo1"
},
{
"name": "foo-claim1",
"mountPath": "/foo2"
},
{
"name": "cat-claim0",
"mountPath": "/cat"
}
]
}
],
"restartPolicy": "Always"
}
},
"strategy": {
"type": "Recreate"
}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "bar-claim1",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar-claim1"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "cat",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"volumes": [
{
"name": "cat-claim0",
"persistentVolumeClaim": {
"claimName": "cat-claim0"
}
}
],
"containers": [
{
"name": "cat",
"image": "busybox",
"args": [
"sleep",
"3600"
],
"resources": {},
"volumeMounts": [
{
"name": "cat-claim0",
"mountPath": "/cat"
}
]
}
],
"restartPolicy": "Always"
}
},
"strategy": {
"type": "Recreate"
}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "cat-claim0",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat-claim0"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
},
{
"kind": "Deployment",
"apiVersion": "extensions/v1beta1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"replicas": 1,
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"volumes": [
{
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
},
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
},
{
"name": "cat-claim0",
"persistentVolumeClaim": {
"claimName": "cat-claim0"
}
}
],
"containers": [
{
"name": "foo",
"image": "busybox",
"args": [
"sleep",
"3600"
],
"resources": {},
"volumeMounts": [
{
"name": "foo-claim0",
"mountPath": "/foo1"
},
{
"name": "foo-claim1",
"mountPath": "/foo2"
},
{
"name": "cat-claim0",
"mountPath": "/cat"
}
]
}
],
"restartPolicy": "Always"
}
},
"strategy": {
"type": "Recreate"
}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "foo-claim0",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo-claim0"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "foo-claim1",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo-claim1"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
}
]
}
@@ -0,0 +1,541 @@
{
"kind": "List",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "bar",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "bar"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "cat",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "cat"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "Service",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"ports": [
{
"name": "headless",
"port": 55555,
"targetPort": 0
}
],
"selector": {
"io.kompose.service": "foo"
},
"clusterIP": "None"
},
"status": {
"loadBalancer": {}
}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "bar",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"strategy": {
"type": "Recreate",
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"bar"
],
"from": {
"kind": "ImageStreamTag",
"name": "bar:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "bar"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"volumes": [
{
"name": "bar-claim1",
"persistentVolumeClaim": {
"claimName": "bar-claim1"
}
},
{
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
},
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
},
{
"name": "cat-claim0",
"persistentVolumeClaim": {
"claimName": "cat-claim0"
}
}
],
"containers": [
{
"name": "bar",
"image": " ",
"args": [
"sleep",
"3600"
],
"resources": {},
"volumeMounts": [
{
"name": "bar-claim1",
"mountPath": "/bar"
},
{
"name": "foo-claim0",
"mountPath": "/foo1"
},
{
"name": "foo-claim1",
"mountPath": "/foo2"
},
{
"name": "cat-claim0",
"mountPath": "/cat"
}
]
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "bar",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "busybox"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "bar-claim1",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "bar-claim1"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "cat",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"strategy": {
"type": "Recreate",
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"cat"
],
"from": {
"kind": "ImageStreamTag",
"name": "cat:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "cat"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"volumes": [
{
"name": "cat-claim0",
"persistentVolumeClaim": {
"claimName": "cat-claim0"
}
}
],
"containers": [
{
"name": "cat",
"image": " ",
"args": [
"sleep",
"3600"
],
"resources": {},
"volumeMounts": [
{
"name": "cat-claim0",
"mountPath": "/cat"
}
]
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "cat",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "busybox"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "cat-claim0",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "cat-claim0"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
},
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"strategy": {
"type": "Recreate",
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"foo"
],
"from": {
"kind": "ImageStreamTag",
"name": "foo:latest"
}
}
}
],
"replicas": 1,
"test": false,
"selector": {
"io.kompose.service": "foo"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"volumes": [
{
"name": "foo-claim0",
"persistentVolumeClaim": {
"claimName": "foo-claim0"
}
},
{
"name": "foo-claim1",
"persistentVolumeClaim": {
"claimName": "foo-claim1"
}
},
{
"name": "cat-claim0",
"persistentVolumeClaim": {
"claimName": "cat-claim0"
}
}
],
"containers": [
{
"name": "foo",
"image": " ",
"args": [
"sleep",
"3600"
],
"resources": {},
"volumeMounts": [
{
"name": "foo-claim0",
"mountPath": "/foo1"
},
{
"name": "foo-claim1",
"mountPath": "/foo2"
},
{
"name": "cat-claim0",
"mountPath": "/cat"
}
]
}
],
"restartPolicy": "Always"
}
}
},
"status": {}
},
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "foo",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo"
}
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": null,
"from": {
"kind": "DockerImage",
"name": "busybox"
},
"generation": null,
"importPolicy": {}
}
]
},
"status": {
"dockerImageRepository": ""
}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "foo-claim0",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo-claim0"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
},
{
"kind": "PersistentVolumeClaim",
"apiVersion": "v1",
"metadata": {
"name": "foo-claim1",
"creationTimestamp": null,
"labels": {
"io.kompose.service": "foo-claim1"
}
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
"resources": {
"requests": {
"storage": "100Mi"
}
}
},
"status": {}
}
]
}
+119
View File
@@ -0,0 +1,119 @@
#!/bin/bash
RED='\033[0;31m'
NOCOLOR='\033[0m'
start_k8s() {
# Note: takes some time for the http server to pop up :)
# MINIMUM 15 seconds
echo "
##########
STARTING KUBERNETES
##########
"
if [ ! -f /usr/bin/kubectl ] && [ ! -f /usr/local/bin/kubectl ]; then
echo "No kubectl bin exists? Please install."
return 1
fi
# Uses https://github.com/kubernetes/minikube/tree/master/deploy/docker
# In which we have to git clone and create the image..
# https://github.com/kubernetes/minikube
# Thus we are using a public docker image
IMAGE=calpicow/localkube-image:v1.5.3
docker run -d \
--volume=/:/rootfs:ro \
--volume=/sys:/sys:rw \
--volume=/var/lib/docker:/var/lib/docker:rw \
--volume=/var/lib/kubelet:/var/lib/kubelet:rw \
--volume=/var/run:/var/run:rw \
--net=host \
--pid=host \
--privileged \
--name=minikube \
$IMAGE \
/localkube start \
--apiserver-insecure-address=0.0.0.0 \
--apiserver-insecure-port=8080 \
--logtostderr=true \
--containerized
until curl 127.0.0.1:8080 &>/dev/null;
do
echo ...
sleep 1
done
# Set the appropriate .kube/config configuration
kubectl config set-cluster dev --server=http://localhost:8080
kubectl config set-context dev --cluster=dev --user=default
kubectl config use-context dev
kubectl config set-credentials default --token=foobar
# Debug info:
# cat ~/.kube/config
# Delay due to CI being a bit too slow when first starting k8s
sleep 5
}
stop_k8s() {
echo "
##########
STOPPING KUBERNETES
##########
"
docker rm -f minikube
# Delete via image name google_containers
# Delete all containers started (names start with k8s_)
# Run twice in-case a container is replicated during that time
for run in {0..2}
do
docker ps -a | grep 'k8s_' | awk '{print $1}' | xargs --no-run-if-empty docker rm -f
docker ps -a | grep 'gcr.io/google_containers/hyperkube-amd64' | awk '{print $1}' | xargs --no-run-if-empty docker rm -f
done
}
wait_k8s() {
echo "Waiting for k8s po/svc/rc to finish terminating..."
kubectl get po,svc,rc
sleep 3 # give kubectl chance to catch up to api call
while [ 1 ]
do
k8s=`kubectl get po,svc,rc | grep Terminating`
if [[ $k8s == "" ]]
then
echo "k8s po/svc/rc terminated!"
break
else
echo "..."
fi
sleep 1
done
}
test_k8s() {
for f in examples/*.yaml
do
echo -e "\n${RED}kompose up -f $f ${NC}\n"
./kompose up -f $f
sleep 2 # Sleep for k8s to catch up to deployment
echo -e "\n${RED}kompose down -f $f ${NC}\n"
./kompose down -f $f
done
}
if [[ $1 == "start" ]]; then
start_k8s
elif [[ $1 == "stop" ]]; then
stop_k8s
elif [[ $1 == "wait" ]]; then
wait_k8s
elif [[ $1 == "test" ]]; then
test_k8s
else
echo $"Usage: kubernetes.sh {answers|start|stop|wait}"
fi
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
# These tests will bring up a single-node Kubernetes cluster and test against examples
# WARNING: This will actively create Docker containers on your machine as well as remove them
# do not run this on a production cluster / machine.
# Check requirements!
if ! hash go 2>/dev/null; then
echo "ERROR: go required"
exit 1
fi
if ! hash docker 2>/dev/null; then
echo "ERROR: docker required"
exit 1
fi
if ! hash kubectl 2>/dev/null; then
echo "ERROR: kubectl required"
exit 1
fi
# First off, we have to compile the latest binary
make bin
#####################
# KUBERNETES TESTS ##
#####################
# Now we can start our Kubernetes cluster!
./script/test_ci/kubernetes.sh start
# And we're off! Let's test those example files
./script/test_ci/kubernetes.sh test
# Stop our Kubernetes cluster
./script/test_ci/kubernetes.sh stop
+1 -1
View File
@@ -28,7 +28,7 @@ ENV GOPATH="/opt/go" \
ENV PATH="$PATH:$GOPATH/bin" \
# KOMPOSE_SRC is where kompose source will be copied when container starts (by run.sh script)
# this is to ensure that we won't write anything to host volume mount
KOMPOSE_SRC="$GOPATH/src/github.com/kubernetes-incubator/kompose"
KOMPOSE_SRC="$GOPATH/src/github.com/kubernetes/kompose"
RUN go get github.com/Masterminds/glide &&\
go get github.com/sgotti/glide-vc &&\
+1 -1
View File
@@ -174,7 +174,7 @@ function convert::oc_cleanup () {
function convert::oc_check_route () {
local route_key=$1
if [ $route_key == 'true' ]; then
route_key='xip.io'
route_key='nip.io'
fi
if [ $(oc get route | grep ${route_key} | wc -l ) -gt 0 ]; then