Try out the API Portal on Kubernetes in the following simple steps.
IMPORTANT: Currently, this page will install the latest released version of wicked (0.12.5). If you want to try the latest Beta release (recommended, wicked 1.0.0 is in a quite stable state already), please go to this page: How to install a beta version of wicked.haufe.io.
This page contains the instructions to run a demo portal on a Kubernetes minikube
cluster; to see this for
a local Docker host, please see the Getting Started With Docker guide.
This introduction to the API Portal we provide will guide you to deploy an API Portal like the one we keep for demo purposes at wicked-demo.haufe.io, on a Kubernetes cluster.
The wicked API Portal is designed to run within docker
,
and is specifically now targeting Kubernetes as the preferred runtime environment. The following short tutorial
assumes you are familiar with Kubernetes, and that you have a local minikube
environment up and
running on your local machine.
Further, it's assumed that you are familiar in using a bash
type shell, and that you
have a running git
installation. On Linux/Mac OS X this should be present out of the box (if
you are a developer). On Windows, using either the Ubuntu bash Windows subsystem, or plain "Git bash" (cygwin)
should work fine.
Note: The following guide is not suitable as a starting point for your own configuration, but is rather meant as a demo configuration. The documentation contains more information on how to get you started with your own APIs.
Please make sure you have runnning minikube
installation before you proceed with the
next steps of this tutorial. Refer to the homepage of the minikube
project on Github
for more information on how to install:
Enable the "ingress addon" for minikube to be able to use the built-in ingress controller:
$ minikube addons enable ingress
Please also install Kubernetes Helm, which is the package manager for Kubernetes.
Make sure Helm (the tiller
) is installed on your cluster by running
$ helm init
Deploying the API Portal is equivalent to install a Helm Chart to your local minikube
Kubernetes cluster. You can always find the Chart release on Github, or you can use the following
script to download the latest version (for production use, please always use a specific version and
upgrade manually):
$ curl -L http://wicked.haufe.io/get-wicked.sh | bash
This command downloads the latest version of the wicked Helm Chart to a local directory wicked
so that it can be used with the configured cluster and Helm:
$ helm install --set minikubeIP=$(minikube ip) --name test wicked
The installation process takes a little while, as the images need to be downloaded and run on your cluster;
by opening a different terminal instance and calling kubectl get pods
, you can check on the
status of the provisioning.
After around 2-5 minutes, depending on your bandwidth, you will presented the installation notes from Helm.
/etc/hosts
entries
Issue the following command to retrieve the IP address of your minikube
VM's IP:
$ minikube ip 192.168.64.2 # example value
Open up your /etc/hosts
(Linux/Mac OS X, on Windows: C:\Windows\System32\drivers\etc\hosts
)
file in an editor (this step will be different on Linux, Mac OS X and
Windows, please google if unclear) and add the following line:
(output of minikube ip) portal.local,api.portal.local
Note: You may need to sudo
to change that file; on Windows you will need
to edit the hosts
file as Administrator.
Using Chrome or Firefox, navigate to your API Portal at https://portal.local
and start playing around. The sample configuration has a preconfigured admin user with the following credentials:
admin@foo.com
wicked
Note: Due to restrictions with saving Cookies with self signed certificates, this process may not work with all browsers. When installed with correct and valid certificates, wicked will work with all recent common browsers (Microsoft Edge, Firefox, Chrome and Safari).
Read more in the documentation, e.g. on how to use the sample portal.
To stop and deallocate the local API Portal, issue the following command:
$ kubectl delete job test-wicked-post-install # in future, this will be auto-removed by Helm $ helm delete test --purge
Or, simply deprovision the minikube
cluster (minikube delete
).
© 2016-2018 Haufe-Lexware GmbH & Co. KG, www.haufe-lexware.com, www.haufe.de, www.lexware.de, www.haufe-akademie.de