---
title: Charmhub | Deploy Ranger K8s Operator using Charmhub - The Open Operator Collection
description: Deploy the latest version of Ranger K8s Operator as a Kubernetes Operator
  on any cloud.
url: https://charmhub.io/ranger-k8s/docs/tutorial-getting-started
---

# Ranger K8s Operator

[Business Data](https://charmhub.io/publisher/businessdata "View all packages from Business Data")

* [Business Data](https://charmhub.io/publisher/businessdata "View all packages from Business Data")

Platform:

stable 33

```
juju deploy ranger-k8s
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Contacts

##### Maintainers

+ [Commercial Systems](mailto:jaas-crew@lists.canonical.com)

* [Submit a bug](https://github.com/canonical/ranger-k8s-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Ranger K8s Operator

The Charmed Ranger K8s Operator delivers automated management on Apache Ranger authorization software on top of a Kubernetes cluster. [Apache Ranger™](https://ranger.apache.org/) is a framework to enable, monitor and manage comprehensive data security across the Hadoop platform.

Note: This operator requires the use of juju>=3.1.

## Deploying Ranger and PostgreSQL database

Ranger requires PostgreSQL to store its state. Therefore, its deployment requires a relation with the [postgresql-k8s](https://charmhub.io/postgresql-k8s) charm:

```
# deploy ranger
juju deploy ranger-k8s

# deploy postgresql
juju deploy postgresql-k8s --channel 14/stable --trust

# relate the applications
juju relate ranger-k8s:database postgresql-k8s:database
```

Note: details on the custom image used for Ranger deployment can be found [here](https://github.com/canonical/ranger/pkgs/container/ranger).

## Authentication

Username/password authentication is enabled by default using the `admin` user and the password set via the Ranger configuration value `admin-password`. Additional users can be added in the Ranger UI.

## Relations

### Policy

The Ranger Operator provides a policy interface for relation with applications requiring Ranger’s authorization services. Note: the related application image **must** be configured with the Ranger-plugin (ie. Atlas, Kafka, Presto, Trino … ) a full list can be found in directories [here](https://github.com/apache/ranger).

```
# deploy application
juju deploy trino-k8s

# relate via policy interface
juju relate trino-k8s:policy ranger-k8s:policy
```

### Ingress

The Ranger operator exposes its ports using the [Nginx Ingress Integrator operator](https://charmhub.io/nginx-ingress-integrator). You must first make sure to have an Nginx Ingress Controller deployed. To enable TLS connections, you must have a TLS certificate stored as a k8s secret (default name is “ranger-tls”). A self-signed certificate for development purposes can be created as follows:

```
# Generate private key
openssl genrsa -out server.key 2048

# Generate a certificate signing request
openssl req -new -key server.key -out server.csr -subj "/CN=ranger-k8s"

# Create self-signed certificate
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt -extfile <(printf "subjectAltName=DNS:ranger-k8s")

# Create a k8s secret
kubectl create secret tls ranger-tls --cert=server.crt --key=server.key
```

This operator can then be deployed and connected to the Ranger operator using the Juju command line as follows:

```
# Deploy ingress controller.
microk8s enable ingress:default-ssl-certificate=ranger-k8s/ranger-tls

juju deploy nginx-ingress-integrator --channel edge --revision 71
juju relate ranger-k8s nginx-ingress-integrator
```

Once deployed, the hostname will default to the name of the application (ranger-k8s), and can be configured using the external-hostname configuration on the Ranger operator.

## Contributing

Please see the [Juju SDK documentation](https://juju.is/docs/sdk) for more information about developing and improving charms and [Contributing](https://github.com/canonical/ranger-k8s-operator/blob/main/CONTRIBUTING.md) for developer guidance.

## License

The Charmed Ranger K8s Operator is free software, distributed under the Apache Software License, version 2.0. See [License](https://github.com/canonical/ranger-k8s-operator/blob/main/LICENSE) for more details.

---
