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

docs: copy content to new docs engine #2605

Merged
merged 19 commits into from
Nov 30, 2023
1 change: 1 addition & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
- 'epic/*'
paths-ignore:
- "docs/**"
- "docs-new/**"
- "**.md"
- "netlify.toml"

Expand Down
1 change: 1 addition & 0 deletions docs-new/assets/javascripts/versions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// VERSION WARNINGS
window.addEventListener("DOMContentLoaded", function() {
return; //TODO: decide if we want this
thisthat marked this conversation as resolved.
Show resolved Hide resolved
var rtdData = window['READTHEDOCS_DATA'] || { version: 'latest' };
var margin = 30;
var headerHeight = document.getElementsByClassName("md-header")[0].offsetHeight;
Expand Down
5 changes: 5 additions & 0 deletions docs-new/docs/404/index.md
thisthat marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Page Not Found

The page can't be found.

Please try the search on the top to look for it or go back to [the homepage](../../index.md).
23 changes: 23 additions & 0 deletions docs-new/docs/assets/crd/analysis-definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: metrics.keptn.sh/v1beta1
kind: AnalysisDefinition
metadata:
name: ad-my-proj-dev-svc1
namespace: keptn-system
spec:
objectives:
- analysisValueTemplateRef:
name: response-time-p95
namespace: keptn-system
target:
failure:
lessThan:
fixedValue: 600
warning:
inRange:
lowBound: 300
highBound: 500
weight: 1
keyObjective: false
totalScore:
passPercentage: 90
warningPercentage: 75
15 changes: 15 additions & 0 deletions docs-new/docs/assets/crd/analysis-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: metrics.keptn.sh/v1beta1
kind: AnalysisValueTemplate
metadata:
labels:
app.kubernetes.io/name: analysisvaluetemplate
app.kubernetes.io/instance: analysisvaluetemplate-sample
app.kubernetes.io/part-of: metrics-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: metrics-operator
name: response-time-p95
namespace: keptn-system
spec:
provider:
name: prometheus
query: "sum(kube_pod_container_resource_limits{node='{{.nodename}}'}) - sum(kube_node_status_capacity{node='{{.nodename}}'})"
21 changes: 21 additions & 0 deletions docs-new/docs/assets/crd/analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: metrics.keptn.sh/v1beta1
kind: Analysis
metadata:
labels:
app.kubernetes.io/name: analysis
app.kubernetes.io/instance: analysis-sample
app.kubernetes.io/part-of: metrics-operator
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/created-by: metrics-operator
name: analysis-sample
spec:
timeframe:
recent: 5m
args:
project: my-project
stage: dev
service: svc1
nodename: test # can be any key/value pair; NOT only project/stage/service
analysisDefinition:
name: ad-my-proj-dev-svc1
namespace: keptn-system
11 changes: 11 additions & 0 deletions docs-new/docs/assets/crd/eval.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnEvaluationDefinition
metadata:
name: app-pre-deploy-eval-2
namespace: podtato-kubectl
spec:
objectives:
- keptnMetricRef:
name: available-cpus
namespace: podtato-kubectl
evaluationTarget: ">1"
10 changes: 10 additions & 0 deletions docs-new/docs/assets/crd/metric.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: metrics.keptn.sh/v1beta1
kind: KeptnMetric
metadata:
name: available-cpus
namespace: podtato-kubectl
spec:
provider:
name: my-provider
query: "sum(kube_node_status_capacity{resource='cpu'})"
fetchIntervalSeconds: 10
13 changes: 13 additions & 0 deletions docs-new/docs/assets/crd/task-definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: lifecycle.keptn.sh/v1alpha3
kind: KeptnTaskDefinition
metadata:
name: container-sleep
namespace: podtato-kubectl
spec:
container:
name: testy-test
image: busybox:1.36.1
command:
- 'sh'
- '-c'
- 'sleep 30'
65 changes: 65 additions & 0 deletions docs-new/docs/components/certificate-operator/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Keptn Certificate Manager

## Keptn Cert Manager
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

The Keptn Cert Manager automatically configures TLS certificates to
[secure communication with the Kubernetes API](https://kubernetes.io/docs/concepts/security/controlling-access/#transport-security).
You can instead
[use cert-manager.io](../../installation/configuration/cert-manager.md)
for this purpose.

Keptn includes a Mutating Webhook
that requires TLS certificates to be mounted as a volume in its pod.
In version 0.6.0 and later, the certificate creation
is handled automatically by
the [keptn-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/keptn-cert-manager/README.md).

How it works:

* The certificate is created as a secret
in the `keptn-system` namespace
with a renewal threshold of 12 hours.
* If the certificate expires,
the [keptn-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/keptn-cert-manager/README.md)
renews it.
* The Keptn `lifecycle-operator` waits for a valid certificate to be ready.
* When the certificate is ready,
it is mounted on an empty dir volume in the operator.

`keptn-cert-manager` is a customized certificate manager
that is installed with Keptn by default.
It is included to simplify installation for new users
and because it is much smaller than most standard certificate managers.
However, Keptn is compatible with most certificate managers
and can be configured to use another certificate manager if you prefer.
See [Use Keptn with cert-manager.io](../../installation/configuration/cert-manager.md)
for instructions.

## Invalid certificate errors

When a certificate is left over from an older version,
the webhook or the operator may generate errors
because of an invalid certificate.
To solve this, delete the certificate and restart the operator.

The Keptn cert-manager certificate is stored as a secret in the
`keptn-system` namespace.
To retrieve it:

```shell
kubectl get secrets -n keptn-system
```

This returns something like:

```shell
NAME TYPE DATA AGE
keptn-certs Opaque 5 4d23h
```

Specify the `NAME` of the Keptn certificate (`keptn-certs` in this case)
to delete the Keptn certificate:

```shell
kubectl delete secret keptn-certs -n keptn-system
```
24 changes: 24 additions & 0 deletions docs-new/docs/components/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Components
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

## Keptn Components
StackScribe marked this conversation as resolved.
Show resolved Hide resolved

Keptn consists of two main components:

* Keptn Lifecycle Operator, which splits into two separate operators
in Release 0.7.0 and later:
* Lifecycle-Operator
* Metrics-Operator
* Keptn Lifecycle Scheduler

```mermaid
graph TD;
KeptnComponents-->Operators;
KeptnComponents-->Scheduler
Operators-->Lifecycle-Operator
Operators-->Metrics-Operator
style KeptnComponents fill:#006bb8,stroke:#fff,stroke-width:px,color:#fff
style Operators fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
style Scheduler fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
style Lifecycle-Operator fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
style Metrics-Operator fill:#d8e6f4,stroke:#fff,stroke-width:px,color:#006bb8
```
186 changes: 186 additions & 0 deletions docs-new/docs/components/lifecycle-operator/deployment-flow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Flow of deployment

Keptn deploys a
[Kubernetes Workload](https://kubernetes.io/docs/concepts/workloads/)
by passing through a well-defined execution flow.

The execution flow goes through six main phases:

* Pre-deployments-tasks
* Pre-deployment-evaluation
* Deployment
* Post-deployment-tasks
* Post-deployment-evaluation
* Completed

Within each phase, all tasks and evaluations for each phase
are executed in parallel.
They are not affected by the order
in which evaluations and tasks are listed in the
[KeptnApp](../../reference/crd-reference/app.md)
resource
or in the order of the pre/post-tasks and pre/post-evaluations
that are listed in the Workflow manifests.

## Kubernetes and Cloud Events

[Kubernetes Events](https://kubernetes.io/docs/reference/kubernetes-api/cluster-resources/event-v1/)
and [CloudEvents](https://cloudevents.io/)
are emitted at each phase
to provide additional Observability of the execution flow.

Keptn implements a
[Permit Scheduler Plugin](https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/#permit)
that blocks the binding of the pods to a node
until all the pre-conditions are fulfilled.

A Kubernetes deployment is started by the deployment engine
that is implemented
(such as Flux or Argo)
or can be started by the following command:

```shell
kubectl apply -f deployment.yaml
```

Keptn does not care how a deployment manifest is applied to the cluster.
Both `kubectl` and Flux/Argo send the manifest to the Kubernetes API
so Keptn does not differentiate the actual deployment options.
This also means that one Keptn Application
can include services that are deployed with different methods.

The deployment is created
but the created pods are blocked and in pending state
until all the required pre-deployment tasks/evaluations
defined on either the `KeptnApp` or `KeptnWorkload` level pass.
Only then are the pods bound to a node and deployed.
If any pre-deployment evaluation or task fails,
the `KeptnApp` issues an appropriate `*Errored` event
and the deployment remains pending indefinitely,
until further changes or external intervention
If all evaluations and tasks in a phase are successful,
the `KeptnApp` issues the appropriate `*Succeeded` event
and initiates the next phase.

## Summary of deployment flow

To view these events on your cluster, execute:

```shell
kubectl get events -n <namespace> .
```

### Pre-deployment phase

Pre-deployment tasks can perform any kind of action needed
to prepare for the deployment, including unit tests, load tests or other similar tests.

```shell
AppPreDeployTasks
AppPreDeployTasksStarted
AppPreDeployTasksSucceeded OR AppPreDeployTasksErrored
```

### Pre-deployment evaluation phase

Pre-deployment evaluation can be used to assert the status of the cluster
or of services the [workload](https://kubernetes.io/docs/concepts/workloads/) depends on,
to assure it is deployed only if the specified prerequisites are met.

```shell
AppPreDeployEvaluations
AppPreDeployEvaluationsStarted
AppPreDeployEvaluationsSucceeded OR AppPreDeployEvaluationsErrored
```

### Deployment phase

The `AppDeploy` phase basically covers
the entire deployment and check phase of the [workloads](https://kubernetes.io/docs/concepts/workloads/).
The `KeptnApp` just observes whether
all pre and post-deployment tasks/evaluation are successful
and that the pods are deployed successfully.
When all activities are successful,
the `KeptnApp` issues the `AppDeploySucceeded` event
and continues to the next phase.
If any of these activities fail,
the `KeptnApp` issues the `AppDeployErrored` event
and terminates the deployment.

```shell
AppDeploy
AppDeployStarted
WorkloadPreDeployTasks
WorkloadPreDeployTasksStarted
WorkloadPreDeployTasksSucceeded OR WorkloadPreDeployTasksErrored
WorkloadPreDeployEvaluations
WorkloadPreDeployEvaluationsStarted
WorkloadPreDeployEvaluationsSucceeded OR WorkloadPreDeployErrored
WorkloadDeploy
WorkloadDeployStarted
WorkloadDeploySucceeded OR WorkloadDeployErrored
WorkloadPostDeployTasks
WorkloadPostDeployTasksStarted
WorkloadPostDeployTasksSucceeded OR WorkloadPostDeployTasksErrored
WorkloadPostDeployEvaluations
WorkloadPostDeployEvaluationsStarted
WorkloadPostDeployEvaluationsSucceeded OR WorkloadPostDeployEvaluationsErrored
AppDeploySucceeded OR AppDeployErrored
```

### Post-deployment phase

The post-deployment phase is typically used
to run tests on the freshly deployed application,
such as gathering performance data.

```shell
AppPostDeployTasks
AppPostDeployTasksStarted
AppPostDeployTasksSucceeded OR AppPostDeployTasksErrored
```

### Post-deployment evaluation phase

The post-deployment evaluation can be used
to analyze the cluster/application status after the new workload is deployed.
The result of this phase does not revert or influence the deployment
but can be used by other external tools, for instance, to react to a failure.

```shell
AppPostDeployEvaluations
AppPostDeployEvaluationsStarted
AppPostDeployEvaluationsSucceeded OR AppPostDeployEvaluationsErrored
```

### Completed phase

```shell
Completed
```

## Events that are not part of the deployment flow

Additional phases/states exist,
such as those that describe what happens when something fails.

Whenever something in the system happens (we create a new resource, etc.)
a Kubernetes event is generated.
The following events are defined as part of Keptn
but they are not part of the deployment flow.
These include:

```shell
CreateEvaluation
ReconcileEvaluation
ReconcileTask
CreateTask
CreateApp
CreateAppVersion
CreateWorkload
CreateWorkloadVersion
Completed
Deprecated
WorkloadDeployReconcile
WorkloadDeployReconcileErrored
```
Loading
Loading