Configure your environment#
After obtaining all the required items described in Prerequisites,
set up your environment by configuring the environment variables provided by
your administrator. Use the export
command to set up your username,
cluster name, and domain as environment variables.
To configure the environment variables, run the following commands:
export RS_OS_USERNAME=<my-openstack-username>
export RS_K8S_CLUSTER_NAME=<my-cluster-name>
export RS_K8S_DOMAIN=<my-cluster-domain>
Install the Kubernetes certificate authority#
To configure your web browser and personal Docker Engine to work with the managed services, install the Kubernetes CA certificate. You must perform this configuration once.
To install the Kubernetes CA certificate, perform the following steps:
Run the installation script:
./install-kubernetes-ca-cert.sh
If you are using MacOS or Windows, restart Docker:
docker-machine restart <docker-machine>
Configure application metrics monitoring#
Rackspace Kubernetes-as-a-Service (KaaS) provides an easy to use and configure
Prometheus cloud monitoring solution that
visualizes alerts and metrics through the Grafana
dashboards. You can configure Prometheus to collect metrics from your
Kubernetes applications through a Kubernetes Custom Resource Definition (CRD)
called ServiceMonitor. You can define the ServiceMonitor in a simple yaml
file and apply this file to your configuration using kubectl
.
To configure application metrics monitoring, complete the following steps:
Create a
yaml
configuration file:apiVersion: monitoring.coreos.com/v1alpha1 kind: ServiceMonitor metadata: name: your-application namespace: rackspace-monitoring labels: monitor: rackspace-prometheus # needs to have this label to be detected by the managed prometheus resource spec: selector: matchLabels: some-label: <that-will-match-your-application-service> namespaceSelector: matchNames: - the-namespace-where-your-application-lives # needs to be the namespace the app got deployed to endpoints: - port: the-name-of-the-port-that-exposes-your-metrics-endpoint
Save as
service-monitor.yaml
.Apply this configuration:
$ kubectl apply -f service-monitor.yaml
Access the Rackspace KaaS dashboards#
The Rackspace KaaS solution enables you to access the managed services user interface by using your web browser.
To access the dashboards, you need the following information:
- Kubernetes cluster name
- OpenStack DNS zone for the Kubernetes cluster
- Login and password
To get the required information for logging in to the Kubernetes dashboards:
Get the name of your Kubernetes cluster:
kubectl config get-clusters
System response:
NAME kubernetes-test
Get the DNS zone name for your Kubernetes cluster:
openstack zone list
Example of system response:
+--------------+-------------------+---------+----------+--------+--------+ | id | name | type | serial | status | action | +--------------+-------------------+---------+----------+--------+--------+ | 034d29de ... | test.mk8s.systems.| PRIMARY | 92303 ...| ACTIVE | NONE | +--------------+-------------------+---------+----------+--------+--------+
If your cluster name is
kubernetes-test
and the DNS zone name istest.mk8s.systems
, the URL to log in to the manage services dashboards is https://ingress.kubernetes-test.test.mk8s.systems/<dashboard>.Use the username and password provided to you by your administrator to log in.
The following table lists the customer-facing dashboards.
Managed service | URL | Credentials |
---|---|---|
Rackspace KaaS UI | https://<openstack-env-domain-name>:8891/login |
|
Prometheus Monitoring | https://ingress.<cluster-name>.<dns-zone>/prometheus/graph |
|
Grafana Dashboards | https://ingress.<cluster-name>.<dns-zone>/monitoring |
|
Logging | https://ingress.<cluster-name>.<dns-zone>/logs |
|
Private registry | https://registry.<cluster-name>.<dns-zone> |
|
Kubernetes Web UI | https://<cluster-name>.<dns-zone>/dashboard |
|