---
title: Charmhub | k8s-service interface
description: Interfaces describe the relation between two charms. This interface shows
  opinionated, standardized interface specifications for charm relations.
url: https://charmhub.io/integrations/k8s-service
---

# k8s-service

## Usage

This relation interface describes the expected behavior of any charm claiming to be able to provide or consume a Kubernetes Service (k8s service). With K8s Service referring to the [Service abstraction](https://kubernetes.io/docs/concepts/services-networking/service/) defined in the Kubernetes API.

## Direction

The `k8s-service` interface implements a provider/requirer pattern.
The requirer is a charm that wishes to consume a k8s service, and the provider is a charm able to provide it.

```
flowchart TD
    Provider -- Kubernetes Service --> Requirer
```

## Behavior

The requirer and the provider need to adhere to a certain set of criteria to be considered compatible with the interface.

### Provider

* Is expected to provide `service-name` and `service-port` needed to access the K8s service.
* Is expected to provide a `service-name` formatted as `<resource-name>.<namespace>`, for example `kfp-api.kubeflow`.

### Requirer

* Is expected to consume the data provided.

## Relation Data

### Provider

[[JSON Schema]](https://github.com/canonical/charmlibs/blob/main/interfaces/k8s-service/interface/vv0/schemas/provider.json)

Exposes a `url` field containing the url at which ingress is available. Should be placed in the **application** databag, encoded as yaml and nested in a "data" field.

#### Example

```
application_data:
  service-name: "kfp-api.kubeflow"
  service-port: "8888"
```

### Requirer

N/A

## Charms implementing this interface

### Providers

* [kfp-api](https://charmhub.io/kfp-api)
* [kfp-viz](https://charmhub.io/kfp-viz)
* [kubeflow-profiles](https://charmhub.io/kubeflow-profiles)

### Requirers

* [kfp-api](https://charmhub.io/kfp-api)
* [kfp-ui](https://charmhub.io/kfp-ui)
* [kfp-persistence](https://charmhub.io/kfp-persistence)
* [kubeflow-dashboard](https://charmhub.io/kubeflow-dashboard)

## Other charms using this interface

### Providers

* [kfp-ui](https://charmhub.io/kfp-ui)
* [istio-pilot](https://charmhub.io/istio-pilot)
* [mlmd](https://charmhub.io/mlmd)
* [kubeflow-profiles](https://charmhub.io/kubeflow-profiles)
* [kfp-api](https://charmhub.io/kfp-api)
* [kfp-viz](https://charmhub.io/kfp-viz)
* [katib-db-manager](https://charmhub.io/katib-db-manager)

### Requirers

* [kfp-ui](https://charmhub.io/kfp-ui)
* [kfp-persistence](https://charmhub.io/kfp-persistence)
* [kfp-api](https://charmhub.io/kfp-api)
* [kubeflow-dashboard](https://charmhub.io/kubeflow-dashboard)
* [katib-controller](https://charmhub.io/katib-controller)
* [katib-ui](https://charmhub.io/katib-ui)
* [istio-gateway](https://charmhub.io/istio-gateway)
