From 5c680111b6e89e69436cfd92bbc22a7f5d679b6b Mon Sep 17 00:00:00 2001 From: Nikolay Mahotkin Date: Mon, 22 Aug 2016 13:50:42 +0300 Subject: [PATCH] Fixing volume entry definitions * According to http://kubernetes.io/docs/user-guide/volumes/#types-of-volumes and https://github.com/kubernetes/kubernetes/commit/a1b53250118bbfd462d7441833964d379e08802f there is hostPath volume type instead of hostDir; And there is no 'source' keyword anymore. * Replacing 'kubectl update' on 'kubectl replace': kubectl update is deprecated, need to use 'replace': https://github.com/kubernetes/kubernetes/commit/9b3d42c090aeab663bf42e38658a5f88fb4b5272 Closes-Bug: #1604766 Change-Id: I1029caeb2827fc9de271b457c7a61b043d0189cb --- .../package/Classes/DockerHostVolume.yaml | 2 +- .../package/Resources/scripts/patchService.sh | 2 +- .../package/Resources/scripts/updatePod.sh | 2 +- .../Resources/scripts/updateReplicationController.sh | 4 ++-- .../package/Resources/scripts/updateService.sh | 2 +- .../package/Resources/scripts/updatePod.sh | 2 +- .../Resources/scripts/updateReplicationController.sh | 2 +- .../package/Resources/scripts/updateService.sh | 2 +- .../KubernetesPod/package/Classes/KubernetesPod.yaml | 9 +++++---- Kubernetes/README.rst | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/DockerInterfacesLibrary/package/Classes/DockerHostVolume.yaml b/DockerInterfacesLibrary/package/Classes/DockerHostVolume.yaml index 72dc22a..8c33a0e 100644 --- a/DockerInterfacesLibrary/package/Classes/DockerHostVolume.yaml +++ b/DockerInterfacesLibrary/package/Classes/DockerHostVolume.yaml @@ -24,7 +24,7 @@ Properties: Methods: getType: Body: - Return: HostDir + Return: HostPath getParameters: Body: diff --git a/Kubernetes/KubernetesCluster/package/Resources/scripts/patchService.sh b/Kubernetes/KubernetesCluster/package/Resources/scripts/patchService.sh index 64149b3..dae13dd 100644 --- a/Kubernetes/KubernetesCluster/package/Resources/scripts/patchService.sh +++ b/Kubernetes/KubernetesCluster/package/Resources/scripts/patchService.sh @@ -3,4 +3,4 @@ # $1 - service name # $2 - publicIPs JSON -/opt/bin/kubectl update service "$1" --patch="$2" +/opt/bin/kubectl replace service "$1" --patch="$2" diff --git a/Kubernetes/KubernetesCluster/package/Resources/scripts/updatePod.sh b/Kubernetes/KubernetesCluster/package/Resources/scripts/updatePod.sh index 037ca0c..ef3441b 100644 --- a/Kubernetes/KubernetesCluster/package/Resources/scripts/updatePod.sh +++ b/Kubernetes/KubernetesCluster/package/Resources/scripts/updatePod.sh @@ -15,5 +15,5 @@ if [ "$1" == "True" ]; then /opt/bin/kubectl create -f "${fileName}" >> /tmp/murano-kube.log else echo "Updating a Pod" >> /tmp/murano-kube.log - /opt/bin/kubectl update -f "${fileName}" >> /tmp/murano-kube.log + /opt/bin/kubectl replace -f "${fileName}" >> /tmp/murano-kube.log fi diff --git a/Kubernetes/KubernetesCluster/package/Resources/scripts/updateReplicationController.sh b/Kubernetes/KubernetesCluster/package/Resources/scripts/updateReplicationController.sh index cff32c7..f636182 100644 --- a/Kubernetes/KubernetesCluster/package/Resources/scripts/updateReplicationController.sh +++ b/Kubernetes/KubernetesCluster/package/Resources/scripts/updateReplicationController.sh @@ -3,6 +3,6 @@ if [ "$1" == "True" ]; then echo "Creating a new Replication Controller" >> /tmp/murano-kube.log /opt/bin/kubectl create -f /tmp/controller.json >> /tmp/murano-kube.log else - echo "Updating a Replication Controller" >> /tmp/murano-kube.log - /opt/bin/kubectl update -f /tmp/controller.json >> /tmp/murano-kube.log + echo "Replacing a Replication Controller" >> /tmp/murano-kube.log + /opt/bin/kubectl replace -f /tmp/controller.json >> /tmp/murano-kube.log fi diff --git a/Kubernetes/KubernetesCluster/package/Resources/scripts/updateService.sh b/Kubernetes/KubernetesCluster/package/Resources/scripts/updateService.sh index 4912a50..df5b3b2 100644 --- a/Kubernetes/KubernetesCluster/package/Resources/scripts/updateService.sh +++ b/Kubernetes/KubernetesCluster/package/Resources/scripts/updateService.sh @@ -14,5 +14,5 @@ if [ "$1" == "True" ]; then /opt/bin/kubectl create -f "${fileName}" >> /tmp/murano-kube.log else echo "Updating a Service" >> /tmp/murano-kube.log - /opt/bin/kubectl update -f "${fileName}" >> /tmp/murano-kube.log + /opt/bin/kubectl replace -f "${fileName}" >> /tmp/murano-kube.log fi diff --git a/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updatePod.sh b/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updatePod.sh index 7db443a..1b936d0 100644 --- a/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updatePod.sh +++ b/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updatePod.sh @@ -20,5 +20,5 @@ if [ "$1" == "True" ]; then /opt/bin/kubectl create -f /tmp/pod.json >> /tmp/murano-kube.log else echo "Updating a Pod" >> /tmp/murano-kube.log - /opt/bin/kubectl update -f /tmp/pod.json >> /tmp/murano-kube.log + /opt/bin/kubectl replace -f /tmp/pod.json >> /tmp/murano-kube.log fi diff --git a/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateReplicationController.sh b/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateReplicationController.sh index 7bff354..e1fb4e9 100644 --- a/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateReplicationController.sh +++ b/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateReplicationController.sh @@ -16,5 +16,5 @@ if [ "$1" == "True" ]; then /opt/bin/kubectl create -f /tmp/controller.json >> /tmp/murano-kube.log else echo "Updating a Replication Controller" >> /tmp/murano-kube.log - /opt/bin/kubectl update -f /tmp/controller.json >> /tmp/murano-kube.log + /opt/bin/kubectl replace -f /tmp/controller.json >> /tmp/murano-kube.log fi diff --git a/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateService.sh b/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateService.sh index 593b72d..3a1dd38 100644 --- a/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateService.sh +++ b/Kubernetes/KubernetesEntitiesLibrary/package/Resources/scripts/updateService.sh @@ -16,5 +16,5 @@ if [ "$1" == "True" ]; then /opt/bin/kubectl create -f /tmp/service.json >> /tmp/murano-kube.log else echo "Updating a Service" >> /tmp/murano-kube.log - /opt/bin/kubectl update -f /tmp/service.json >> /tmp/murano-kube.log + /opt/bin/kubectl replace -f /tmp/service.json >> /tmp/murano-kube.log fi diff --git a/Kubernetes/KubernetesPod/package/Classes/KubernetesPod.yaml b/Kubernetes/KubernetesPod/package/Classes/KubernetesPod.yaml index ae132a9..fe26758 100644 --- a/Kubernetes/KubernetesPod/package/Classes/KubernetesPod.yaml +++ b/Kubernetes/KubernetesPod/package/Classes/KubernetesPod.yaml @@ -169,9 +169,9 @@ Methods: - $type: $volume.getType() - Value: $type Match: - HostDir: + HostPath: - $spec: - hostDir: + hostPath: path: $volume.getParameters() TempVolume: - $spec: @@ -179,9 +179,10 @@ Methods: Default: - Throw: UnknownDockerVolumeType Message: format('Unknown docker volume type {0}', $type) - - Return: + - $result: name: $._generateVolumeName($name, $volume) - source: $spec + + - Return: $result.mergeWith($spec) _deleteContainer: diff --git a/Kubernetes/README.rst b/Kubernetes/README.rst index af5e73b..2575fdc 100644 --- a/Kubernetes/README.rst +++ b/Kubernetes/README.rst @@ -176,7 +176,7 @@ deploying both Kubernetes and it's nodes. Check each port in applicationPorts and creates or updates it if the port differs from what it was before (or did not exist). Calls - `kubectl update` or `kubectl create` on master node. + `kubectl replace` or `kubectl create` on master node. `deleteServices(applicationName, podId)` * `applicationName` a string holding application's name,