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

Add info about C2 cluster #396

Merged
merged 17 commits into from
Oct 1, 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
52 changes: 12 additions & 40 deletions public-site/Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,15 @@
.PHONY: lint
lint:
npm run "lint"
npm run "lint-ts"
.PHONY: dev-up
dev-up:
docker compose --profile dev up --build

.PHONY: dev-down
dev-down:
docker compose --profile dev down

.PHONY: lint-strict
lint-strict:
npm run "lint-strict"

.PHONY: run
run:
npm run start

.PHONY: build-dist run-dist run-dist-rebuilt

build-dist:
npm run build

run-dist:
npm run serve

run-dist-rebuilt: build-dist run-dist

.PHONY: run-docker-dev
run-docker-dev:
docker compose -f docker-compose.yml up

.PHONY: build-docker
build-docker:
docker build . -t public-site

.PHONY: run-docker
run-docker:
docker run -it -p 8080:8080 public-site

.PHONY: run-docker-rebuilt
run-docker-rebuilt: build-docker run-docker

.PHONY: down
down:
docker compose down
.PHONY: prod-up
prod-up:
docker compose --profile prod up --build

.PHONY: prod-down
prod-down:
docker compose --profile prod down
62 changes: 11 additions & 51 deletions public-site/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Radix Public Site

This is the public site for promoting, documenting & showcasing the Radix
platform. It is a static site built with [VuePress 2](https://v2.vuepress.vuejs.org/).
platform. It is a static site built with [Docusaurus](https://docusaurus.io).

## Running, building

### The easy way

`docker compose --profile dev up --build`
`make dev-up`: Starts Docker compose services beloning to the`dev` profile.

This starts the Docusaurus developer server on port 8000, and NGINX on port 8080 which proxies requests to the docusaurus server. This ensures that your browser receives the same security related headers (defined in ./proxy/headers) as when you build and run the Dockerfile container image. Changes to source files are immediatly shown in the browser.

You can see the site on <http://localhost:8080>

Stop the server with Ctrl+C, but also run `docker compose --profile dev down` to clean up the
Stop the server with Ctrl+C, but also run `make dev-down` to clean up the
Docker state.

If you need a shell in the container:
Expand All @@ -22,71 +22,31 @@ If you need a shell in the container:

NB: The search plugin does not work when running the docusaurus development server.

You can also build and run the container image intended for production environments by running `docker compose --profile prod up --build`. To stop and cleanup you run `docker compose --profile prod down`.

**Windows**: There is currently [a
problem](https://github.com/docker/for-win/issues/56) with Docker that prevents
auto-reload of the development server from working when source files change. A
simple workaround is to use [a little watcher
process](https://github.com/FrodeHus/docker-windows-volume-watcher/releases).
You can also build and run the container image intended for production environments by running `make prod-up`. To stop and cleanup you run `make prod-down`.

### The other way

You can also run docusurus locally. All that is needed is NodeJS and NPM. In the root folder of the project run `npm i` to fetch dependencies followed by `npm run start` to start serving the development environment of the Public Site. The disadvantage is that you will not catch errors caused by the security headers set by NGINX.

## Folder structure

The site content is organised within `/docs/src/`. In here you'll find:
## Files and folder structure

- `/.vuepress/`: The Vuepress source folder containing the main site configuration.
- `/.vuepress/components/`: Custom user-created Vuepress components.
- `/.vuepress/public/`: All public content for the Public Site, such as images and general stylesheets.
- `/.vuepress/styles/`: Style override files for Vuepress. See the [CSS Section](#CSS) below.

But the interesting bits are the actual content:
File `docusaurus.config.ts` contains the main configuration for Docusaurus. This is where we configure the overall page layout like headers, footers, navbar, themes etc. `sidebars.ts` contains configuration for the sidebars.

- `/community/`: Information about the Radix community and team.
- `/docs/`: General concepts (topics).
- `/feature/`: List of all fratures in Radix.
- `/guides/`: User-friendly, conversational guides on how to achieve specific objectives.
- `/references/`: Reference documentation for end-users.
- `/other/`: Documentation not directly related to any specific category.
- `/radix-config/`: Reference documentation for end-users.
- `/start/`: Getting started guide

## docusaurus

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

[Create an application](https://docusaurus.io/docs/installation)
```bash
npx create-docusaurus@latest public-site classic --typescript
```

## docusaurus development

`npm start`
Starts the development server.

`npm run build`
Bundles your website into static files for production.

`npm run serve`
Serves the built website locally.

`npm run deploy`
Publishes the website to GitHub pages.

We recommend that you begin by typing:

`cd public-site`
`npm start`

## Production build

The production build is containerised in the project's `Dockerfile`. To run the
build image locally:

docker build -t radix-public-site-prod .
docker run --name radix-public-site-prod_container --rm -p 8080:8080 radix-public-site-prod

The web server will be available on <http://localhost:8080>

# Credits

trees by Made x Made from the Noun Project: <https://thenounproject.com/term/trees/1723897/>
Expand Down
87 changes: 46 additions & 41 deletions public-site/docs/docs/topic-domain-names/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,95 +4,100 @@ title: Domain names

# Domain names

There can be several domain names mapped to [application components](/start/radix-concepts/index.md#component) in Radix. In general you will want to use the [public name](#public-name), but you should understand all options.
There can be several domain names mapped to [application components](/start/radix-concepts/index.md#component) in Radix.

:::tip Domain names
Some domain names include a `clusterEnvNamepace` component. This varies depending on the type of cluster. In Radix there are two(three) **cluster types**; these are the values for `clusterEnvNamepace` in each type
The domain names are composed with information from the application, and the [Radix cluster](../../start/radix-clusters/) where the application is hosted:

- platform (_blank_) - (eu-"weeknumber")
- playground (`playground`) - (playground-"weeknumber")
- (dev (`dev`))
:::

## Canonical name

```text
[componentName]-[appName]-[envName].[clusterName].[clusterEnvNamepace].radix.equinor.com
```

The authoritative name for a specific component in a specific cluster. The _canonical name_ can be useful when debugging, however.

- Always allocated
- Automatically allocated
- One per component

Examples:

- `frontend-myapp-production.playground-92.playground.radix.equinor.com`
- `backend-myapp-production.playground-92.playground.radix.equinor.com`
- `serializer-oneapp-qa.eu-12.radix.equinor.com`
- `component-name`: The name of the component, e.g. `frontend`.
- `app-name`: The name of the application, e.g. `myapp`.
- `env-name`: The name of the environment where the component is deployed to, e.g. `production`.
- `cluster-name`: Exists only in [canonical name](./#canonical-name). The name of the underlying Kubernetes cluster used for hosting a specific [Radix cluster](../../start/radix-clusters/), e.g. `eu-18`. This value can change, for example during upgrade of a Radix cluster. Domain names using this value should only be used for debugging purposes, and should never be used by end users/services.
- `cluster-dns-zone`: The DNS zone for the [Radix cluster](../../start/radix-clusters/) where the application is hosted, e.g. `radix.equinor.com`, `playground.radix.equinor.com`.

## Public name

```text
[componentName]-[appName]-[envName].[clusterEnvNamepace].radix.equinor.com
[component-name]-[app-name]-[env-name].[cluster-dns-zone]
```

- Automatically allocated
- One per component
- Unique for each component in each environment

Examples:

- `frontend-myapp-production.playground.radix.equinor.com`
- `backend-myapp-production.playground.radix.equinor.com`
- `serializer-oneapp-qa.radix.equinor.com`
- `frontend-myapp-production.c2.radix.equinor.com`
- `backend-myapp-production.playground.radix.equinor.com`

## App default alias

```text
[appName].app.[clusterEnvNamepace].radix.equinor.com
[app-name].app.[cluster-dns-zone]
```

The _app default alias_ is a convenience domain name to make it easier to publish and use your application. It points to a specific component and environment in your application, and allows a reasonable URL to be distributed to end-users without the hassle of setting up [external aliases](#external-alias).
The _app default alias_ is a convenience domain name to make it easier to publish and use your application. It points to a specific component and environment in your application, and allows a reasonable URL to be distributed to end users/services without the hassle of setting up [external aliases](#external-alias).

- One per application
- [Defined in `radixconfig.yaml`](/radix-config/index.md#dnsappalias)

Examples:

- `myapp.app.playground.radix.equinor.com`
- `oneapp.app.radix.equinor.com`
- `otherapp.app.c2.radix.equinor.com`
- `myapp.app.playground.radix.equinor.com`

## App alias

```text
[appName].[clusterEnvNamepace].radix.equinor.com
[subdomain].[cluster-dns-zone]
```
`dnsAlias` creates one or several DNS aliases in the form of `<alias>.radix.equinor.com` for the specified environment and component. There are few reserved aliases which cannot be used:

- Difference from App default alias - it does not have `app.` domain before `radix.equinor.com` and there can be multiple aliases per application, per environment, per component
The _app alias_ allows you to configure a custom subdomain in the `[cluster-dns-zone]` where the application is hosted. With the exception of a few reserved names, the rule is _"first come, first served"_.


- Multiple allowed per component
- [Defined in `radixconfig.yaml`](/radix-config/index.md#dnsalias)

Examples:

- `myapp.playground.radix.equinor.com`
- `oneapp.radix.equinor.com`
- `otherapp.c2.radix.equinor.com`
- `myapp.playground.radix.equinor.com`

## External alias

```text
[whatever]
[a valid external DNS name]
```

For ultimate customisation of your domain names, you can "bring your own" domain into Radix with an _external alias_. There is a [detailed guide](/guides/external-alias/) on how to configure this.

- Multiple allowed per component
- [Defined in `radixconfig.yaml`](/radix-config/index.md#dnsexternalalias)
- Requires external DNS alias management
- Requires custom TLS certificate
- [Bring your own TLS](../../guides/external-alias-certificate/index.md) certificate, or let [Radix handle](../../guides/external-alias/index.md#configure-certificate-automation-service) it

Examples:

- `cowabunga.equinor.com`
- `cheap-domains-r-us.net`
- `go0gle.com`
- `myapp.equinor.com`
- `www.mydomain.com`
## Canonical name

```text
[component-name]-[app-name]-[env-name].[cluster-name].[cluster-dns-zone]
```

The authoritative name for a specific component in a specific Kubernetes- and Radix-cluster.

- Automatically allocated
- One per component

:::warning
The _canonical name_ should never be used by end users/services because `[cluster-name]` is not considered stable, and can change without warning.
:::

Examples:

- `serializer-oneapp-qa.eu-18.radix.equinor.com`
- `frontend-myapp-production.c2-11.c2.radix.equinor.com`
- `backend-myapp-production.playground-92.playground.radix.equinor.com`
4 changes: 2 additions & 2 deletions public-site/docs/docs/topic-dynatrace-int/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ spec:
- DT_CONNECTION_POINT # formattedCommunicationEndpoints from response
```
After changing your `radixconfig.yaml` file and pushing the changes, you must log in to your Application Configuration page in [Radix Console](https://console.radix.equinor.com) and paste in the PaaS-Token in **Private image hubs** under **App Secrets**.
Then you must update environment secrets in each component with corresponding Dynatrace configuration: `DT_TENANT`, `DT_TENANTTOKEN` (`tenantToken`) and `DT_CONNECTION_POINT` (`formattedCommunicationEndpoints`).
After changing your `radixconfig.yaml` file and pushing the changes, you must open the application's configuration page in [Web Console](https://console.radix.equinor.com) and paste in the PaaS-Token in **Private image hubs** under **App Secrets**.
You must then update environment secrets in each component with corresponding Dynatrace configuration: `DT_TENANT`, `DT_TENANTTOKEN` (`tenantToken`) and `DT_CONNECTION_POINT` (`formattedCommunicationEndpoints`).
```request
GET https://spa-equinor.kanari.com/e/<DT_TENANT>/api/v1/deployment/installer/agent/connectioninfo
accept: application/json
Expand Down
44 changes: 11 additions & 33 deletions public-site/docs/docs/topic-radix-cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,35 @@ title: Radix CLI

## Purpose

[Radix command line interface](https://github.com/equinor/radix-cli) is an application to execute commands for getting information, creating a Radix application or pipeline jobs, setting values of secrets, start and stop Radis components and other operations, described below. The Radix CLI, available for multiple platforms, it can be downloaded from the [GitHub repository](https://github.com/equinor/radix-cli/tags).
[Radix CLI](https://github.com/equinor/radix-cli) is an application to execute commands for getting information, creating a Radix application or pipeline jobs, setting values of secrets, start and stop Radis components and other operations, described below. The Radix CLI, available for multiple platforms, it can be downloaded from the [GitHub repository](https://github.com/equinor/radix-cli/releases).

## Use

The Radix CLI can be used on local PC, in CI workflow, in a docker container.
Radix CLI can be installed and run from your local PC, as a Docker container, or in CI workflows, like GitHub actions.

Commands can be executed for `platform` or `playground` cluster, specified by an option `--context` or `-c`. Example: `--context platform` or `-c playground`. When no context specified, `platform` is used.
Commands can be executed towards all Radix cluster, either by setting the `--context` flag when executing a command, or by configuring the default context. `platform` is used if no context is specified.

The default context can be changed
Set the default context:
```shell
rx set context --context playground
```
Check the current context
Check the current context:
```shell
rx get context
```

Only applications, permitted for users or Azure AD groups, where they are member of, are available to execute commands for.

The command `rx --version` or `rx -v` shows the version, installed on the PC.

To get debug information about request, sent by the Radix CLI prefix the command with set of environment variable `DEBUG`: `DEBUG=true rx get application -a your-app-name`

### Run on a local PC

Download a [version of a Radix CLI](https://github.com/equinor/radix-cli/tags) for a required platform, extract an executable binary from an archive and move it to a folder, where executables usually located on the PC (or it can remain the folder, from it can be run). Example for a Linux or Mac:

```shell
LATEST_VERSION=$(
curl --silent "https://api.github.com/repos/equinor/radix-cli/releases/latest" |
grep '"tag_name":' |
sed -E 's/.*"v([^"]+)".*/\1/'
)

rx_tar=radix-cli_${LATEST_VERSION}_Darwin_x86_64.tar.gz
curl -OL "https://github.com/equinor/radix-cli/releases/download/v${LATEST_VERSION}/${rx_tar}"
tar -xf ${rx_tar}

sudo mv rx /usr/local/bin/rx
rm ${rx_tar}
```
Install Radix CLI locally by following the installation instructions in the [Radix CLI GitHub repository](https://github.com/equinor/radix-cli#installation).

To start working with Radix CLI, first login to the cluster:
To start working with Radix CLI you must first login:
```shell
rx login
```
Follow the provided Microsoft sign in device login URL and enter the provided code.

On successful login - commands can be executed within your user permissions to the Radix.
After successful login, you can start executing commands.

To clean up the login data - logout from the Radix:
To clean up the login data, logout from the Radix:
```shell
rx logout
```
Expand Down Expand Up @@ -107,7 +85,7 @@ Scope can be specified for most commands:
:::tip
An option `job` of commands `create`, `get logs` is replaced with `pipeline-job`. It will be supported for backward compatibility.
:::
* Create a new "deploy only" pipeline job with specified image tags. When `radixconfig.yaml` contains `image` option with dynamic [imageTagName](https://radix.equinor.com/radix-config/index.md#imagetagname), this `imageTagName` can be altered in the Radix CLI `create pipeline-job deploy` command option `image-tag-name`. This option will override values defined in the `radixconfig.yaml` and can be defined for multiple components in the command. `image-tag-name`, provided as an option in the command `rx create pipeline-job deploy` is shown in the Radix pipeline orchestration job log. Component names that does not exist within the Radix application environment will be ignored.
* Create a new "deploy only" pipeline job with specified image tags. When `radixconfig.yaml` contains `image` option with dynamic [imageTagName](../../radix-config/index.md#imagetagname), this `imageTagName` can be altered in the Radix CLI `create pipeline-job deploy` command option `image-tag-name`. This option will override values defined in the `radixconfig.yaml` and can be defined for multiple components in the command. `image-tag-name`, provided as an option in the command `rx create pipeline-job deploy` is shown in the Radix pipeline orchestration job log. Component names that does not exist within the Radix application environment will be ignored.
```shell
rx create pipeline-job deploy --application your-app-name --environment dev --image-tag-name web-app=stable-123 --image-tag-name api=1.22.0
rx create pipeline-job deploy -a your-app-name -e dev -t web-app=stable-123 -t api=1.22.0
Expand Down Expand Up @@ -190,7 +168,7 @@ An option `job` of commands `create`, `get logs` is replaced with `pipeline-job`
```
:::info
This scale will persist after re-deployment, so remember to reset the component when you are finished.
After reset, scaled component gets replicas specified in the `radixconfig.yaml`, "1" if not specified, or set by [horizontal scaling](https://radix.equinor.com/radix-config/index.md#environmentconfig)
After reset, scaled component gets replicas specified in the [`radixconfig.yaml`](../../radix-config/index.md), "1" if not specified, or set by [`horizontal scaling`](../../radix-config/index.md#horizontalscaling)
:::
#### Manage components
* Set a value of a component secret (runtime secret)
Expand Down
Loading