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:

  1. Run the installation script:

    ./install-kubernetes-ca-cert.sh
    
  2. 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. Then, configure a Grafana alert notification channel of choice as described in the Grafana documentation. Rackspace KaaS supports the following Grafana notifications types:

  • Slack
  • PagerDuty
  • Webhook

To configure application metrics monitoring, complete the following steps:

  1. 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
    
  2. Save as service-monitor.yaml.

  3. Apply this configuration:

    $ kubectl apply -f service-monitor.yaml
    
  4. Configure Grafana alert notifications for your application as described in the Grafana documentation.

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
  • Kubernetes cluster domain name
  • Login and password

For example, if your cluster name is test and the domain name is mk8s.systems, the URL to log in to the managed services dashboards is https://ingress.kubernetes-test.test.mk8s.systems:8891/login.

The following table lists the customer-facing dashboards.

Managed service URL Credentials
KaaS Control Panel https://<openstack-env-domain-name>:8891/login
  • Login: RS_OS_USERNAME
  • Password: RS_OS_PASSWORD
Prometheus Monitoring https://ingress.kubernetes-<cluster-name>.<cluster-name>.<domain-name>/prometheus/graph
  • Login: RS_OS_USERNAME
  • Password: RS_OS_PASSWORD
Grafana Dashboard https://ingress.kubernetes-<cluster-name>.<cluster-name>.<domain-name>/monitoring
  • Login: RS_OS_USERNAME
  • Password: RS_OS_PASSWORD
Logging https://ingress.kubernetes-<cluster-name>.<cluster-name>.<domain-name>/logs
  • Login: RS_OS_USERNAME
  • Password: RS_OS_PASSWORD
Private registry https://registry.kubernetes-<cluster-name>.<cluster-name>.<domain-name>
  • Login: RS_OS_USERNAME
  • Password: RS_OS_PASSWORD
Kubernetes Web UI https://ingress.kubernetes-<cluster-name>.<cluster-name>.<domain-name>/dashboard
  • A Rackspace KaaS token generated in the Rackspace KaaS UI.

Perform OpenStack operations from your local machine#

If you are managing a Kubernetes cluster located in the Rackspace data center from your computer, you might need to log in to the underlying OpenStack environment and perform actions there. You can do so by logging in to the OpenStack dashboard or by using the command line. Some of the operations are only available in the command line.

To enable command line OpenStack operations on your computer, complete the following steps:

  1. Log in to the OpenStack dashboard.

  2. In the upper-left navigation panel, under projects, select your project.

  3. Go to Project > Access & Security > API Access.

  4. Click Download OpenStack RC file v3.

  5. On your computer, go to the Rackspace KaaS installer/ directory.

  6. Source your RC file:

    source ~/<cluster-name>-openrc.sh
    
  7. To obtain super-user privileges in your cluster, export the following credentials:

    export OS_USERNAME=<admin-user>
    export OS_PASSWORD=<admin-password>
    export OS_PROJECT_ID=<project-ID>
    

    You can find these parameters in the bootsrap.yaml files in the openstack section.