Skip to content

Commit

Permalink
docs: minor UI tweaks and remove unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
a-hilaly committed Nov 11, 2024
1 parent 779b9d8 commit 403a9e7
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 176 deletions.
25 changes: 24 additions & 1 deletion examples/application/Readme.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,66 @@
# KRO Application example
This example creates a ResourceGroup called `App` and then instaciates it with the default nginx container image.

This example creates a ResourceGroup called `App` and then instaciates it with
the default nginx container image.

### Create ResourceGroup called App

Apply the RG to your cluster:

```
kubectl apply -f rg.yaml
```

Validate the RG status is Active:

```
kubectl get rg app.kro.run
```

Expected result:

```
NAME APIVERSION KIND STATE AGE
app.kro.run v1alpha1 App Active 6m
```

### Create an Instance of kind App

Apply the provided instance.yaml

```
kubectl apply -f instance.yaml
```

Validate instance status:

```
kubectl get apps test-app
```

Expected result:

```
NAME STATE SYNCED AGE
test-app ACTIVE True 16m
```

### Validate the app is working

Get the ingress url:

```
kubectl get ingress test-app -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
```

Either navigate in the browser or curl it:

```
curl -s $(kubectl get ingress test-app -o jsonpath='{.status.loadBalancer.ingress[0].hostname}') | sed -n '/<body>/,/<\/body>/p' | sed -e 's/<[^>]*>//g'
```

Expected result:

```
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and
Expand All @@ -56,11 +75,15 @@ Thank you for using nginx.
```

### Clean up

Remove the instance:

```
kubectl delete apps test-app
```

Remove the resourcegroup:

```
kubectl delete rg app.kro.run
```
2 changes: 1 addition & 1 deletion website/docs/docs/concepts/00-resource-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 1
---

# 1. ResourceGroups
# ResourceGroups

**ResourceGroups** are the fundamental building blocks in KRO. They provide a
way to define, organize, and manage sets of related Kubernetes resources as a
Expand Down
11 changes: 6 additions & 5 deletions website/docs/docs/concepts/10-simple-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 2
---

# 2. Simple Schema
# Simple Schema

KRO's Simple Schema provides a powerful yet intuitive way to define the
structure of your ResourceGroup. Here is comprehensive example:
Expand Down Expand Up @@ -173,13 +173,14 @@ Common condition types include:

### 2. State

The `state` field provides a high-level summary of the instance's current status.
The `state` field provides a high-level summary of the instance's current
status.

```yaml
status:
state: string | enum="Ready,Progressing,Degraded,Error,Terminating,Unknown"
```

> These default status fields are automatically added to every instance's status,
> providing a consistent way to check the health and state of resources across
> different **ResourceGroups**.
> These default status fields are automatically added to every instance's
> status, providing a consistent way to check the health and state of resources
> across different **ResourceGroups**.
40 changes: 23 additions & 17 deletions website/docs/docs/concepts/15-instances.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 15
---

# 3. Instances
# Instances

Instances are a fundamental concept in **KRO** that represent instances of
ResourceGroups. They define the desired state of a set of resources, which KRO
Expand Down Expand Up @@ -37,8 +37,12 @@ spec:
LOG_LEVEL: debug
```
:::tip The spec fields of an Instance correspond to the parameters defined in the
ResourceGroup. :::
:::
tip The spec fields of an Instance correspond to the parameters defined in the
ResourceGroup.
:::
## The reconciliation loop
Expand All @@ -53,8 +57,8 @@ KRO manages Instances through a continuous reconciliation process:
- **State Reconciliation**: KRO takes necessary actions to align the current
state with the desired state. This may involve creating, updating, or deleting
resources as needed.
- **Status Updates**: The Instance's status is updated to reflect the current state
of reconciliation and any issues encountered.
- **Status Updates**: The Instance's status is updated to reflect the current
state of reconciliation and any issues encountered.
- **Continuous Loop**: This process repeats regularly, ensuring the cluster
state always converges towards the desired state defined in the Instance.
Expand All @@ -69,16 +73,18 @@ KRO manages Instances through a continuous reconciliation process:
- **Auditability**: The Instance serves as a single source of truth for the
application's desired state.
:::tip Best Practices
:::tip[Best Practices]
- Treat instances as declarative definitions of your application's desired state.
Use version control for your Instances to track changes over time.
- Treat instances as declarative definitions of your application's desired
state. Use version control for your Instances to track changes over time.
- Leverage labels and annotations in Instances for organization and filtering.
- Regularly review Instances to ensure they reflect current requirements.
- Use KRO's dry-run feature to preview reconciliation actions before applying
changes to Instances.
- Monitor Instance statuses to understand the current state of your applications.
:::
- Monitor Instance statuses to understand the current state of your
applications.
:::
## Common Status Fields
Expand All @@ -93,8 +99,8 @@ detailed status information. Each condition represents a specific aspect of the
instance's state. Common conditions include:
- **Ready**: Indicates whether the instance is fully reconciled and operational.
- **Progressing**: Shows if the instance is in the process of reaching the desired
state.
- **Progressing**: Shows if the instance is in the process of reaching the
desired state.
- **Degraded**: Signals that the instance is operational but not functioning
optimally.
- **Error**: Indicates that an error has occurred during reconciliation.
Expand All @@ -121,8 +127,8 @@ status:
### 2. State
The State field provides a high-level summary of the instance's current status. It
is typically one of the following values:
The State field provides a high-level summary of the instance's current status.
It is typically one of the following values:
- **Pending**: The instance is being processed, but resources are not yet fully
created or configured.
Expand All @@ -140,6 +146,6 @@ status:
```
These common status fields provide users with a consistent and informative way
to check the health and state of their instances across different ResourceGroups.
They are essential for monitoring, troubleshooting, and automating operations
based on the status of KRO-managed resources.
to check the health and state of their instances across different
ResourceGroups. They are essential for monitoring, troubleshooting, and
automating operations based on the status of KRO-managed resources.
118 changes: 0 additions & 118 deletions website/docs/docs/concepts/20-collections.md

This file was deleted.

5 changes: 0 additions & 5 deletions website/docs/docs/concepts/30-conditionals.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions website/docs/docs/concepts/40-imports.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions website/docs/docs/concepts/50-validation.mdx

This file was deleted.

7 changes: 0 additions & 7 deletions website/docs/docs/concepts/60-managing-state.mdx

This file was deleted.

5 changes: 3 additions & 2 deletions website/docs/docs/concepts/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"label": "Concepts",
"position": 40,
"link": {
"type": "generated-index",
"description": "Learn about the core concepts of KRO"
}
},
"collapsible": true,
"collapsed": false
}
5 changes: 2 additions & 3 deletions website/docs/docs/getting-started/_category_.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"label": "Getting started",
"position": 20,
"link": {
"type": "generated-index"
}
"collapsible": true,
"collapsed": false
}
Loading

0 comments on commit 403a9e7

Please sign in to comment.