Kubernetes
Prerequisites
The prerequisites listed below should be met before proceeding.
-
At least one Kubernetes or _SUSE CaaS Platform _ cluster available on your network
-
SUSE Manager configured for container management
Required channels are present, a registered container build host available, etc.
-
virtual-host-gatherer-Kubernetes package installed on your SUSE Manager server
Requirements
-
Kubernetes version 1.5.0 or higher. Alternatively use SUSE CaaS Platform (SUSE CaaS Platform includes Kubernetes 1.5.0 by default)
-
Docker version 1.12 or higher on the container build host
To enable all Kubernetes related features within the Web UI, the virtual-host-gatherer-Kubernetes package must be installed. |
Register Kubernetes as a Virtual Host Manager
Kubernetes clusters are registered with SUSE Manager as virtual host managers
.
Registration and authorization begins with importing a kubeconfig
file using Kubernetes official command line tool kubectl
.
-
In the SUSE Manager Web UI, navigate to
. -
In the
Create
menu, selectKubernetes Cluster
. -
Enter a label for the new virtual host manager.
-
Select the
kubeconfig
file that contains the required data for the Kubernetes cluster. -
Select the correct context for the cluster, as specified in the kubeconfig file.
-
Click Create.
View the List of Nodes in a Cluster
-
Select
from the navigation menu. -
Select the Kubernetes cluster to view it.
-
Node data is not refreshed during registration. To refresh node data, click Schedule refresh data.
-
Refresh the browser. If the node data is not available wait a few moments, and try again.
Obtain Runtime Data about Images
See the following steps to find runtime data for images.
-
In the SUSE Manager Web UI, navigate to
. -
In the image list table, the runtime columns are labeled
Revision
,Runtime
, andInstances
. In these columns find the following information:-
Revision
: An artificial sequence number that increments on every rebuild for manager-built images or on every re-import for externally built images. -
Runtime
: Overall status of the running instances of the image throughout the registered clusters. The status can be one of the following:-
All instances are consistent with SUSE Manager: All the running instances are running the same build of the image as tracked by SUSE Manager.
-
Outdated instances found: Some of the instances are running an older build of the image. A redeploy of the image into the pod may be required.
-
No information: The checksum of the instance image does not match the image data contained in SUSE Manager. A redeploy of the image into the pod may be required.
-
-
Instances
: Number of instances running this image across all the clusters registered in SUSE Manager. A breakdown of numbers can be seen by clicking the pop-up icon next to the number.
-
Build an image for deployment in Kubernetes
The following steps will help you build an image for deployment in Kubernetes.
-
Under
, create an image store. -
In
, create an image profile (with a dockerfile that is suitable to deploy to Kubernetes). -
Under
, build an image with the new profile and wait for the build to finish. -
Deploy the image into one of the registered Kubernetes clusters using
kubectl
.
In the Runtime
and Instances
columns in the respective image row you can now see the updated data.
Import a Previously Deployed Image in Kubernetes
The following steps will guide you through importing a previously deployed image in Kubernetes.
-
Select an image that has already been deployed to any of your registered Kubernetes clusters.
-
Add the registry owning the image to SUSE Manager as an image store.
-
Navigate to
, clickImport
from the top-right corner, fill in the form fields and clickImport
.
In the Runtime
and Instances
columns in the respective image row you can now see the updated data.
Obtain Additional Runtime Data
The following steps will help you find additional runtime data.
-
Navigate to
, locate the row that contains the running instance, and click Details on the right end. Under theOverview
tab, notice the data inRuntime
andInstances
fields under theImage Info
section. -
Select the
Runtime
tab. -
In the
Runtime
tab is a breakdown of the Kubernetes pods running this image in all the registered clusters including the following data:-
Pod name
-
Namespace which the pod resides in
-
The runtime status of the container in the specific pod. For more about status icons, see the next section.
-
Rebuild a Previously Deployed Image in Kubernetes
These steps will guide you through rebuilding an image that has been deployed to a Kubernetes cluster.
-
Go to
. Click theDetails
button on the right end of a row that has running instances. The image must be manager-built. -
Click the
Rebuild
button located under theBuild Status
section and wait for the build to finish. -
Notice the change in the
Runtime
icon and title, reflecting the fact that now the instances are running a previous build of the image.
Role Based Access Control Permissions and Certificate Data
Currently, only kubeconfig files containing all embedded certificate data can be used with SUSE Manager. |
The API calls from SUSE Manager are:
-
GET /api/v1/pods
-
GET /api/v1/nodes
According to this list, the minimum recommended permissions for SUSE Manager should be as follows:
-
A ClusterRole to list all the nodes:
resources: ["nodes"] verbs: ["list"]
-
A ClusterRole to list pods in all namespaces (role binding must not restrict the namespace):
resources: ["pods"] verbs: ["list"]
Due to a a 403 response from /pods
, the entire cluster will be ignored by SUSE Manager.
For more information on working with RBAC Authorization, see https://kubernetes.io/docs/admin/authorization/rbac/.