TOSCAna - Kubernetes Transformation Artifact
Congratulations! You have transformed a TOSCA topology using the Kubernetes Plugin of the TOSCAna Transformer. This readme will guide you through the deployment process for the transformed application.
Requirements
The following section describes the requirements for your environment in order to deploy this transformation artifact.
Deployment Machine Requirements
- Kubectl (Version 1.8 or newer)
- The Kubectl context for the cluster you want to deploy to has to be set as default
- The set context/configuration needs the privileges to deploy on the cluster
- Bash (Tested with Version 4.4.19)
- OPTIONAL: Jq (Tested with Version 1.5)
- jq is used to parse the Ports of the resulting services after the deployment is done. If jq is missing this step will be skipped.
Supported Platforms:
- Linux
- MacOS (Only with already Pushed Images, Won't work properly because of the different
sed
implementation) - Windows (Untested, Might work for already Pushed Images with MSYS or Cygwin)
Additional Requirements for Pushing to a Registry
- Docker (including Daemon with Version 17.03 or Later)
- The User executing the script has to be in the
docker
group - Only Linux-based Docker is supported
- The User executing the script has to be in the
- A Docker Registry with write access
- If Reading from the registry requires credentials, automated deployment using the
deploy.sh
script is not possible. This is because the credentials have to be manually set in the cluster. (See Further Reading for more information)
Cluster Requirements
- Kubernetes Version 1.8 or newer
- KubeDNS (on the cluster)
- Linux based Kubernetes cluster
Deploy Guide
Before you deploy
This section gives a quick overview about the commands that have to be executed before running a deployment.
Login to the Docker Registry
The push utility requires you to be logged into the registry you want to push to using the docker login
command like this:
For DockerHub:
docker login
For another registry:
docker login <REGISTRY_URL>
This command will ask you for your username and password. The command will succeed if the login succeeded. Otherwise the command will fail.
Make the shell scripts executable
To make the shell script executable, use a terminal to navigate to the extracted output/scripts
directory and run the following command:
chmod +x deploy.sh
NOTE It is not required to make the push-images.sh
executable because the deploy script will do that for you before starting the script.
Using the automated deploy scripts
To run the automated deployment just run
./deploy.sh
in the output
directory and follow the on screen instructions.
Deploying manually
In some cases the automated deploy script cannot be used. E.g., if you need to specify the registry secret in the Kubernetes manifest.
In that case you can still use the push-images.sh
script to push the images to the registry and to modify the manifest to feature the resulting image tags (including the registry URL).
Assuming the images have been pushed you can use
kubectl create -f kubernetes-resources/complete.yml
to deploy the result to the cluster manually.