Skip to content

Commit

Permalink
Merge branch 'main' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
StackScribe authored Apr 18, 2023
2 parents e68bbca + c9b1a42 commit bfcd4a2
Show file tree
Hide file tree
Showing 61 changed files with 616 additions and 249 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/set-date.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'START_DATE_FIELD_ID='\
$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Start Date") | .id' project_data.json) >> $GITHUB_ENV
echo 'END_DATE_FIELD_ID='\
$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "End Date") | .id' project_data.json) >> $GITHUB_ENV
echo 'START_DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Start Date") | .id' project_data.json) \
>> $GITHUB_ENV
echo 'END_DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "End Date") | .id' project_data.json) \
>> $GITHUB_ENV
- name: Get date
run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ manifests/
## Kubebuilder
**/kubebuilder
/docs/tmp/
/docs/.hugo_build.lock
/docs/resources/_gen
/docs/public
node_modules

# Helm readme generator project
readme-generator-for-helm/
Expand Down
20 changes: 20 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
config:
line-length:
line_length: 120
tables: false
code_blocks: false
no-inline-html:
allowed_elements:
- details
- summary
github-admonition: true
max-one-sentence-per-line: true

customRules:
- "./docs/rules/admonition.js"
- "./docs/rules/max-one-sentence-per-line.js"

ignores:
- "CHANGELOG.md"
- "node_modules"
- "docs/tmp"
8 changes: 0 additions & 8 deletions .markdownlint.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .markdownlintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rules:
key-duplicates: enable
key-ordering: disable
line-length:
max: 150
max: 155
new-line-at-end-of-file: enable
new-lines: enable
octal-values: enable
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ git push --set-upstream origin feature/123/foo
> Note:
All PRs must include a commit message with a description of the changes made!

Make sure you **sign off your commits**. To do this automatically check [this](https://github.com/keptn/lifecycle-toolkit/blob/main/CONTRIBUTING.md#auto-signoff-commit-messages).
Make sure you **sign off your commits**.
To do this automatically check [this](https://github.com/keptn/lifecycle-toolkit/blob/main/CONTRIBUTING.md#auto-signoff-commit-messages).
Finally, go to GitHub and create a Pull Request.
There should be a PR template already prepared for you.
If not, you will find it at `.github/pull_request_template.md`.
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ $(HELMIFY): $(LOCALBIN)
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/keptn/helmify/cmd/helmify@b1da2bb756ec4328bac7645da037a6fb4e6f30cf

.PHONY: integration-test #these tests should run on a real cluster!
integration-test:
integration-test: # to run a single test by name use --test eg. --test=expose-keptn-metric
kubectl kuttl test --start-kind=false ./test/integration/ --config=kuttl-test.yaml

.PHONY: integration-test-local #these tests should run on a real cluster!
Expand Down
52 changes: 34 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ kubectl apply -f https://github.com/keptn/lifecycle-toolkit/releases/download/v0
<!---x-release-please-end-->

The Lifecycle Toolkit uses the OpenTelemetry collector to provide a vendor-agnostic implementation of how to receive,
process and export telemetry data. To install it, follow
process and export telemetry data.
To install it, follow
their [installation instructions](https://opentelemetry.io/docs/collector/getting-started/).
We provide some information about this in our [observability example](./examples/support/observability/).

The Lifecycle Toolkit includes a Mutating Webhook which requires TLS certificates to be mounted as a volume in its pod.
The certificate creation
is handled automatically
by [klt-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/klt-cert-manager/README.md). Versions 0.5.0
by [klt-cert-manager](https://github.com/keptn/lifecycle-toolkit/blob/main/klt-cert-manager/README.md).
Versions 0.6.0
and earlier have a hard dependency on the [cert-manager](https://cert-manager.io).
See [installation guideline](https://github.com/keptn/lifecycle-toolkit/blob/main/docs/content/en/docs/snippets/tasks/install.md)
for more info.
Expand Down Expand Up @@ -117,7 +119,8 @@ app.kubernetes.io/name: myAwesomeWorkload
app.kubernetes.io/version: myAwesomeWorkloadVersion
```
In general, the Keptn Annotations/Labels take precedence over the Kubernetes recommended labels. If there is no version
In general, the Keptn Annotations/Labels take precedence over the Kubernetes recommended labels.
If there is no version
annotation/label and there is only one container in the pod, the Lifecycle Toolkit will take the image tag as version (
if it is not "latest").
Expand All @@ -130,12 +133,16 @@ keptn.sh/post-deployment-tasks: slack-notification,performance-test
The value of these annotations are
Keptn [CRDs](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
called [KeptnTaskDefinition](#keptntaskdefinition)s. These CRDs contains re-usable "functions" that can
executed before and after the deployment. In this example, before the deployment starts, a check for open problems in
called [KeptnTaskDefinition](#keptntaskdefinition)s.
These CRDs contains re-usable "functions" that can
executed before and after the deployment.
In this example, before the deployment starts, a check for open problems in
your infrastructure
is performed. If everything is fine, the deployment continues and afterward, a slack notification is sent with the
is performed.
If everything is fine, the deployment continues and afterward, a slack notification is sent with the
result of
the deployment and a pipeline to run performance tests is invoked. Otherwise, the deployment is kept in a pending state
the deployment and a pipeline to run performance tests is invoked.
Otherwise, the deployment is kept in a pending state
until
the infrastructure is capable to accept deployments again.
Expand Down Expand Up @@ -208,7 +215,8 @@ When the webhook receives a request for a new pod, it will look for the workload
keptn.sh/workload: "some-workload-name"
```
The mutation consists in changing the scheduler used for the deployment with the Keptn Scheduler. Webhook then creates a
The mutation consists in changing the scheduler used for the deployment with the Keptn Scheduler.
Webhook then creates a
workload and app resource per annotated resource.
You can also specify a custom app definition with the annotation:
Expand Down Expand Up @@ -246,12 +254,14 @@ scheduled.

### Scheduler

After the Webhook mutation, the Keptn-Scheduler will handle the annotated resources. The scheduling flow follows the
After the Webhook mutation, the Keptn-Scheduler will handle the annotated resources.
The scheduling flow follows the
default scheduler behavior,
since it implements a scheduler plugin based on
the [scheduling framework]( https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/).
For each pod, at the very end of the scheduling cycle, the plugin verifies whether the pre deployment checks have
terminated, by retrieving the current status of the WorkloadInstance. Only if that is successful, the pod is bound to a
terminated, by retrieving the current status of the WorkloadInstance.
Only if that is successful, the pod is bound to a
node.

### KeptnApp
Expand Down Expand Up @@ -287,17 +297,20 @@ new execution of app level checks.

A Workload contains information about which tasks should be performed during the `preDeployment` as well as
the `postDeployment`
phase of a deployment. In its state it keeps track of the currently active `Workload Instances`, which are responsible
phase of a deployment.
In its state it keeps track of the currently active `Workload Instances`, which are responsible
for doing those checks for
a particular instance of a Deployment/StatefulSet/ReplicaSet (e.g. a Deployment of a certain version).

### KeptnWorkloadInstance

A Workload Instance is responsible for executing the pre- and post deployment checks of a workload. In its state, it
A Workload Instance is responsible for executing the pre- and post deployment checks of a workload.
In its state, it
keeps track of the current status of all checks, as well as the overall state of
the Pre Deployment phase, which can be used by the scheduler to tell that a pod can be allowed to be placed on a node.
Workload Instances have a reference to the respective Deployment/StatefulSet/ReplicaSet, to check if it has reached the
desired state. If it detects that the referenced object has reached
desired state.
If it detects that the referenced object has reached
its desired state (e.g. all pods of a deployment are up and running), it will be able to tell that
a `PostDeploymentCheck` can be triggered.

Expand Down Expand Up @@ -332,7 +345,8 @@ spec:
In the code section, it is possible to define a full-fletched Deno script.
A further example, is available [here](./examples/taskonly-hello-keptn/inline/taskdefinition.yaml).

To runtime can also fetch the script on the fly from a remote webserver. For this, the CRD should look like the
To runtime can also fetch the script on the fly from a remote webserver.
For this, the CRD should look like the
following:

```yaml
Expand Down Expand Up @@ -423,7 +437,7 @@ spec:
key: prometheusLoginCredentials
```

> **Note:**
> **Note**
The KeptnMetricsProvider is a new resource in KLT 0.7.0.
The [migration documentation](./docs/content/en/docs/tasks/migrate-keptnevaluationprovider/_index.md)
provides information about how to upgrade from 0.6.0 and earlier versions to 0.7.0.
Expand Down Expand Up @@ -452,11 +466,13 @@ spec:
To use `KeptnMetric` as part of your evaluation, you must set the
`.spec.objectives[i].keptnMetricRef.name` and `.spec.objectives[i].keptnMetricRef.namespace` of
`KeptnEvaluationDefiniton` resource to the same value that is stored in `.metadata.name` and `metadata.namespace`
of the `KeptnMetric` resource. Specifying the `.spec.objectives[i].keptnMetricRef.namespace` is optional.
of the `KeptnMetric` resource.
Specifying the `.spec.objectives[i].keptnMetricRef.namespace` is optional.
If it's not specified, KLT searches for the `KeptnMetric` resource in the namespace where `KeptnEvaluationDefinition`
resource is stored. If the `KeptnMetric` resource cannot be found there, it searches in the default KLT namespace (`keptn-lifecycle-toolkit-system`).
resource is stored.
If the `KeptnMetric` resource cannot be found there, it searches in the default KLT namespace (`keptn-lifecycle-toolkit-system`).

> **Note:**
> **Note**
Please be aware that, if
the `.spec.objectives[i].keptnMetricRef.namespace` of `KeptnEvaluationDefinition`
resource is specified and the `KeptnMetric` resource does not exist in this namespace, the evaluation fails.
Expand Down
9 changes: 6 additions & 3 deletions dashboards/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ This folder contains the Grafana dashboards for the Keptn Lifecycle Toolkit.

## Installing the dashboards

It is assumed, that there is a Grafana Instance available. In our provided examples, the dashboards are automatically
provisioned. If you want to install the dashboards manually, you can use the following steps:
It is assumed, that there is a Grafana Instance available.
In our provided examples, the dashboards are automatically
provisioned.
If you want to install the dashboards manually, you can use the following steps:

```shell
# This defaults to http://localhost:3000, but can be changed by setting the GRAFANA_SCHEME, GRAFANA_URL and GRAFANA_PORT environment variable
Expand All @@ -15,7 +17,8 @@ make install

## Changing the dashboards

The dashboards can be changed in the Grafana UI. To export dashboards, export them using the share button and replace
The dashboards can be changed in the Grafana UI.
To export dashboards, export them using the share button and replace
them in this folder.

## Exporting the dashboards for the Examples
Expand Down
4 changes: 0 additions & 4 deletions docs/.gitignore

This file was deleted.

19 changes: 12 additions & 7 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To set up a local Docsy build:
make build
```

> **Note:**
> **Note**
To utilize the `Makefile`, you must have GNU **make**
available on your local machine.
Versions are available for all the usual Operating Systems.
Expand All @@ -68,7 +68,7 @@ Note that Hugo updates the rendered documentation each time you write the file.

`http://localhost:1314/docs-dev/`

> **Note:**
> **Note**
By default, Hugo serves the local docs on port 1313.
We have modified that port for the lifecycle-toolkit docs
to avoid conflicts with the keptn.github.io docs, which use
Expand Down Expand Up @@ -209,7 +209,8 @@ it is generally better to work on files in your local clone.
1. When you have completed the writing you want to do, close all files in your branch and run `git status` to confirm
that it correctly reflects the files you have modified, added, and deleted.

1. Add and commit your changes. Here, we commit all modified files but you can specify individual files to the
1. Add and commit your changes.
Here, we commit all modified files but you can specify individual files to the
`git add` command.
The `git commit -s` command commits the files and signs that you are contributing this intellectual property to the
Keptn project.
Expand Down Expand Up @@ -269,7 +270,8 @@ Add "WIP" (Work in Progress) or "Draft" to the title if the PR is not yet ready
You may want to record the PR number somewhere for future reference although you can always find the PR in the
GitHub lists of open and closed PRs.
* GitHub automatically populates the "Reviewers" block.
* If this PR is not ready for review, click the "Still in progress? Convert to draft" string under the list of
* If this PR is not ready for review, click the "Still in progress?
Convert to draft" string under the list of
reviewers.
People can still review the content but can not merge the PR until you remove the "Draft" status.
* The block of the PR that reports on checks will include the following item:
Expand All @@ -280,9 +282,11 @@ Add "WIP" (Work in Progress) or "Draft" to the title if the PR is not yet ready
```

* When the PR is ready to be reviewed, approved, and merged, click the "Ready to review" button to remove the "Draft"
status. Then, if you added "WIP" or "Draft" to the PR title, remove it now.
status.
Then, if you added "WIP" or "Draft" to the PR title, remove it now.

1. Your PR should be reviewed within a few days. Watch for any comments that may be added by reviewers and implement or
1. Your PR should be reviewed within a few days.
Watch for any comments that may be added by reviewers and implement or
respond to the recommended changes as soon as possible.

* If a reviewer makes a GitHub suggestion and you agree with the change, just click "Accept this change" to create a
Expand All @@ -307,7 +311,8 @@ Add "WIP" (Work in Progress) or "Draft" to the title if the PR is not yet ready

### Developer Certification of Origin (DCO)

Licensing is very important to open source projects. It helps ensure the software continues to be available under the
Licensing is very important to open source projects.
It helps ensure the software continues to be available under the
terms that the author desired.

Keptn uses [Apache License 2.0](https://github.com/keptn/lifecycle-toolkit/blob/main/LICENSE) to strike a balance
Expand Down
12 changes: 6 additions & 6 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ lint: lint-fix
#
# - .markdownlintignore holds the configuration for files to be ignored
# - .markdownlint.yaml contains the rules for markdownfiles
#
# renovate: datasource=docker depName=ghcr.io/igorshubovych/markdownlint-cli
MDL_DOCKER_VERSION := v0.33.0
MDL_CMD := docker run -v $(ROOT_DIR)../:/workdir --rm ghcr.io/igorshubovych/markdownlint-cli:$(MDL_DOCKER_VERSION) "**/*.md"
# renovate: datasource=docker depName=davidanson/markdownlint-cli2-rules
MDL_DOCKER_VERSION := v0.6.0 # TODO: remove next line on version increase from v0.6.0
MDL_DOCKER_VERSION := next
MDL_CMD := docker run -v $(ROOT_DIR)../:/workdir --rm

.PHONY: markdownlint markdownlint-fix
markdownlint:
$(MDL_CMD)
$(MDL_CMD) davidanson/markdownlint-cli2-rules:${MDL_DOCKER_VERSION} "**/*.md"

markdownlint-fix:
$(MDL_CMD) --fix
$(MDL_CMD) --entrypoint="markdownlint-cli2-fix" davidanson/markdownlint-cli2-rules:${MDL_DOCKER_VERSION} "**/*.md"
2 changes: 1 addition & 1 deletion docs/config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module:
ignoreConfig: false
mounts:
- source: ./
target: ./content/en/community
target: ./content/community
excludeFiles:
- "mentorship"
- source: "README.md"
Expand Down
4 changes: 3 additions & 1 deletion docs/content/en/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cascade:
---

<!-- markdownlint-disable MD033 -->
<!-- markdownlint-disable-next-line MD013 -->
<!-- markdownlint-disable-next-line line-length -->
{{< blocks/cover title="Welcome to the Keptn Lifecycle Toolkit Documentation" image_anchor="top" height="half" color="primary" >}}
<div class="mx-auto">
<a class="btn btn-lg btn-primary mr-3 mb-4" href="{{< relref "/docs" >}}">
Expand All @@ -48,11 +48,13 @@ git add
See Keptn [in Action](https://youtube.com/playlist?list=PL6i801Rjt9DbikPPILz38U1TLMrEjppzZ)
{{% /blocks/feature %}}

<!-- markdownlint-disable-next-line line-length no-bare-urls -->
{{% blocks/feature icon="fab fa-github" title="Contributions welcome!" url="https://github.com/keptn/lifecycle-toolkit" %}}
We do a [Pull Request](https://github.com/keptn/lifecycle-toolkit/pulls) contributions workflow on **GitHub**.
New users are always welcome!
{{% /blocks/feature %}}

<!-- markdownlint-disable-next-line line-length no-bare-urls -->
{{% blocks/feature icon="fab fa-twitter" title="Follow us on Twitter!" url="https://twitter.com/keptnProject" %}}
For announcement of latest features etc.
{{% /blocks/feature %}}
Expand Down
3 changes: 2 additions & 1 deletion docs/content/en/contribute/general/technologies/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ please submit an issue.
* **Isitobservable**
* [ ] Keptn has tight integrations with Observability tools and therefore knowing how to _Observe a System_ is important.
* [ ] [Isitobservable website](https://isitobservable.io/)
* [ ] [Is it Observable? with Henrik Rexed](https://www.youtube.com/watch?v=aMwk2qo0v40)
* [ ] [Is it Observable?
with Henrik Rexed](https://www.youtube.com/watch?v=aMwk2qo0v40)

### Understanding SLO, SLA, SLIs

Expand Down
Loading

0 comments on commit bfcd4a2

Please sign in to comment.