Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHTAPINST-74: README.md #86

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Contributing to `rhtap-cli`
---------------------------

In order to contribute to this project you need the following requirements:

- [Golang 1.16 or higher][golang]
- [GNU Make][gnuMake]

All the automation needed for the project lives in the [Makefile](Makefile). This file is the entry point for all the automation tasks in the project for CI, development and release

# Building

After you have cloned the repository and installed the requirements, you can start building. For that purpose you can simply run `make`, the default target builds the application in the `bin` directory

```bash
make
```

# Testing

Unit testing is done using the `go test` command, you can run the tests with the following target:

```bash
make test-unit
```

Alternatively, run all tests with:

```bash
make test
```

# Running

To run the application you can rely on the `run` target, this is the equivalent of `go run` command. For instance:

```bash
make run ARGS='deploy --help'
```

Which is the equivalent of:

```bash
make &&
bin/rhtap-cli deploy --help
```

[gnuMake]: https://www.gnu.org/software/make/
[golang]: https://golang.org/dl/
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
Red Hat Trusted Application Pipeline Installer (`rhtap-cli`)
------------------------------------------------------------

# Overview

The `rhtap-cli` is designed as a sophisticated installer for Kubernetes [Helm Charts][helm], addressing the complexity of managing interdependent resources in Kubernetes environments. Unlike Kubernetes, which orchestrates resources individually without acknowledging their interdependencies, `rhtap-cli` enhances the deployment process by considering these relationships, thereby improving the user experience.

This CLI leverages a [`config.yaml`](config.yaml) file to sequence Helm Chart deployments meticulously. It ensures the integrity of each deployment phase by executing a comprehensive test suite before proceeding to the next Chart installation. This methodical approach guarantees that each phase is successfully completed, enhancing reliability and stability.

Helm, serving as the foundation of `rhtap-cli`, provides a detailed blueprint of resources within Kubernetes. This allows for thorough inspection and troubleshooting of deployment issues, offering users detailed documentation and tips for resolution. By integrating with Helm Charts, `rhtap-cli` not only adheres to industry standards but also opens the door to more sophisticated features, further enriching the deployment experience.

The `rhtap-cli` is designed to be user-friendly, providing a seamless installation process for users of all skill levels.

# Configuration Overview

The `config.yaml` file is structured to outline key components essential for the setup:

```yaml
---
rhtapCLI:
namespace: rhtap
features: {}
dependencies: {}
```

The attributes of the `rhtapCLI` object are as follows:

- `.namespace`: Specifies the default namespace used by the installer, set to rhtap. This namespace acts as the primary operational area for the installation process.
- `.features`: Defines the features to be deployed by the installer. Each feature is identified by a unique name and a set of properties.
- `.dependencies`: Specifies the dependencies rolled out by the installer in the specific order defined in the configuration file.

## `rhtapCLI.features`

Defines the features the installer will deploy. Each feature is defined by a unique name and a set of properties. For instance, the following snippet defines a `featureName` block:

```yaml
---
rhtapCLI:
features:
featureName:
enabled: true
namespace: namespace
properties:
key: value
```

With the following attributes:
- `enabled`: A boolean value to toggle the unique feature
- `namespace`: The namespace in which the feature will be deployed
- `properties`: A set of key-value pairs to define the feature's properties

This data can be leveraged for templating using the [`values.yaml.tpl`](#template-functions) file.

## `rhtapCLI.dependencies`

```yaml
rhtapCLI:
dependencies:
- chart: path/to/chart/directory
namespace: namespace
enabled: true
```

# Template Functions

The following functions are available for use in the `values.yaml.tpl` file:

## `{{ .Installer.Features.* }}`

- `{{ .Installer.Features.*.Enabled }}`: Returns the boolean value of the feature's `enabled` field.
- `{{ .Installer.Features.*.Namespace }}`: Returns the namespace in which the feature will be deployed.
- `{{ .Installer.Features.*.Properties.*}}`: Returns a dictionary of key-value pairs for the feature's properties.

## `{{ .OpenShift.Ingress }}`

Helper function to inspect the target cluster's Ingress configuration.

```yaml
{{- $ingressDomain := required "OpenShift ingress domain" .OpenShift.Ingress.Domain -}}
---
developerHub:
ingressDomain: {{ $ingressDomain }}
```

# Contributing

Please refer to the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information on contributing to this project.


[helm]: https://helm.sh/