Skip to content

Commit

Permalink
update links to documentation (#217)
Browse files Browse the repository at this point in the history
Co-authored-by: Johnny Horvi <johnny@horvi.no>
  • Loading branch information
tronghn and jhrv committed May 15, 2024
1 parent 1859671 commit 60cf43c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ The final step in the build pipeline sends an API request to NAIS deploy to depl
## How it works
1. The teams pipeline use `deploy` to send a deployment request to `hookd`.
1. `hookd` receives the deployment request, verifies its integrity and authenticity, and passes the message on to `deployd` via gRPC.
1. `deployd` receives the message from `hookd`, assumes the identity of the deploying team, and applies your _Kubernetes resources_ into the specified [cluster](https://doc.nais.io/clusters).
1. `deployd` receives the message from `hookd`, assumes the identity of the deploying team, and applies your _Kubernetes resources_ into the specified [cluster](https://doc.nais.io/workloads/reference/environments).
1. If the Kubernetes resources contained any _Application_ or _Deployment_ resources, `deployd` will wait until these are rolled out successfully, or a timeout occurs.

Any fatal error will short-circuit the process with a `error` or `failure` status posted back to Github. A successful deployment will result in a `success` status.
Intermediary statuses will be posted, indicating the current state of the deployment.

## Usage
The usage documentation has been moved to [NAIS platform documentation](https://doc.nais.io/deployment).
The usage documentation has been moved to [NAIS platform documentation](https://doc.nais.io/build).

### Deploy API
_We strongly recommend that teams use the `deploy` cli to deploy, rather than posting directly to `hookd`._
Expand Down Expand Up @@ -50,16 +50,16 @@ to track the status of your deployment.
}
```

| Field | Type | Description |
|-------|------|-------------|
| resources | list[object] | Array of Kubernetes resources |
| team | string | Team tag |
| cluster | string | Kubernetes cluster, see [NAIS clusters](https://doc.nais.io/clusters) |
| environment | string | GitHub environment |
| owner | string | GitHub repository owner |
| repository | string | GitHub repository name |
| ref | string | GitHub commit hash or tag |
| timestamp | int64 | Current Unix timestamp |
| Field | Type | Description |
|-------|------|-----------------------------------------------------------------------------------------------|
| resources | list[object] | Array of Kubernetes resources |
| team | string | Team tag |
| cluster | string | Kubernetes cluster, see [NAIS clusters](https://doc.nais.io/workloads/reference/environments) |
| environment | string | GitHub environment |
| owner | string | GitHub repository owner |
| repository | string | GitHub repository name |
| ref | string | GitHub commit hash or tag |
| timestamp | int64 | Current Unix timestamp |

Additionally, the header `X-NAIS-Signature` must contain a keyed-hash message authentication code (HMAC).
The code can be derived by hashing the request body using the SHA256 algorithm together with your team's NAIS Deploy API key.
Expand Down
3 changes: 1 addition & 2 deletions actions/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Usage

See the [NAIS documentation](https://doc.nais.io/how-to-guides/github-action/).
See the [NAIS documentation](https://doc.nais.io/build/how-to/build-and-deploy).

## Configuration options

Expand All @@ -28,4 +28,3 @@ The available configuration options for the NAIS deploy GitHub action.

Note that `OWNER` and `REPOSITORY` corresponds to the two parts of a full repository identifier.
If that name is `navikt/myapplication`, those two variables should be set to `navikt` and `myapplication`, respectively.

2 changes: 1 addition & 1 deletion actions/deploy/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi
if [ -z "$APIKEY" ]; then
if [ -z "$ACTIONS_ID_TOKEN_REQUEST_TOKEN" ] || [ -z "$ACTIONS_ID_TOKEN_REQUEST_URL" ]; then
echo "Missing id-token permissions. This must be set either globally in the workflow, or for the specific job performing the deploy."
echo "For more info see https://doc.nais.io/how-to-guides/github-action and/or https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs"
echo "For more info see https://doc.nais.io/build/how-to/build-and-deploy and/or https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs"

exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions pkg/deployd/deployd/deployd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ var tests = []testSpec{
timeout: 2 * time.Second,
endStatus: &pb.DeploymentStatus{
State: pb.DeploymentState_failure,
Message: "nais.io/v1alpha1, Kind=Application, Namespace=aura, Name=myapplication-unknown-fields: creating resource: strict decoding error:\n| ⚠️ unknown field \"spec.nestedField\"\n| ⚠️ unknown field \"spec.unknownField\"\n| The fields might be misspelled, incorrectly indented, or unsupported. Fields are case sensitive.\n| Please verify your resource against the reference documentation at https://doc.nais.io/reference/application-spec/ (total of 1 errors)",
Message: "nais.io/v1alpha1, Kind=Application, Namespace=aura, Name=myapplication-unknown-fields: creating resource: strict decoding error:\n| ⚠️ unknown field \"spec.nestedField\"\n| ⚠️ unknown field \"spec.unknownField\"\n| The fields might be misspelled, incorrectly indented, or unsupported. Fields are case sensitive.\n| Please verify your resource against the reference documentation at https://doc.nais.io/workloads/application/reference/application-spec/ (total of 1 errors)",
},
deployedResources: nil,
},
Expand All @@ -168,7 +168,7 @@ var tests = []testSpec{
timeout: 2 * time.Second,
endStatus: &pb.DeploymentStatus{
State: pb.DeploymentState_failure,
Message: "nais.io/v1alpha1, Kind=Application, Namespace=aura, Name=myapplication: updating resource: strict decoding error:\n| ⚠️ unknown field \"spec.nestedField\"\n| ⚠️ unknown field \"spec.unknownField\"\n| The fields might be misspelled, incorrectly indented, or unsupported. Fields are case sensitive.\n| Please verify your resource against the reference documentation at https://doc.nais.io/reference/application-spec/ (total of 1 errors)",
Message: "nais.io/v1alpha1, Kind=Application, Namespace=aura, Name=myapplication: updating resource: strict decoding error:\n| ⚠️ unknown field \"spec.nestedField\"\n| ⚠️ unknown field \"spec.unknownField\"\n| The fields might be misspelled, incorrectly indented, or unsupported. Fields are case sensitive.\n| Please verify your resource against the reference documentation at https://doc.nais.io/workloads/application/reference/application-spec/ (total of 1 errors)",
},
deployedResources: nil,
},
Expand Down
17 changes: 8 additions & 9 deletions pkg/deployd/strategy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,14 @@ func transformStrictDecodingError(resource unstructured.Unstructured, err error)
}

docs := map[string]string{
"aiven.io/v1alpha1, Kind=OpenSearch": "https://doc.nais.io/how-to-guides/persistence/opensearch/create/",
"aiven.io/v1alpha1, Kind=Redis": "https://doc.nais.io/how-to-guides/persistence/redis/",
"aiven.io/v1alpha1, Kind=ServiceIntegration": "https://doc.nais.io/how-to-guides/persistence/opensearch/create/#serviceintegration",
"kafka.nais.io/v1, Kind=Topic": "https://doc.nais.io/how-to-guides/persistence/kafka/create/",
"krakend.nais.io/v1, Kind=ApiEndpoints": "https://doc.nais.io/explanation/auth/apigateway/",
"monitoring.coreos.com/v1, Kind=PrometheusRule": "https://doc.nais.io/how-to-guides/observability/alerts/prometheus-basic/",
"nais.io/v1alpha1, Kind=Application": "https://doc.nais.io/reference/application-spec/",
"nais.io/v1, Kind=Naisjob": "https://doc.nais.io/reference/naisjob-spec/",
"unleash.nais.io/v1, Kind=ApiToken": "https://doc.nais.io/explanation/feature-toggling/?h=#creating-a-new-api-token",
"aiven.io/v1alpha1, Kind=OpenSearch": "https://doc.nais.io/persistence/opensearch/how-to/create/",
"aiven.io/v1alpha1, Kind=Redis": "https://doc.nais.io/persistence/redis/",
"aiven.io/v1alpha1, Kind=ServiceIntegration": "https://doc.nais.io/persistence/opensearch/how-to/create/#serviceintegration",
"kafka.nais.io/v1, Kind=Topic": "https://doc.nais.io/persistence/kafka/how-to/create/",
"monitoring.coreos.com/v1, Kind=PrometheusRule": "https://doc.nais.io/observability/alerting/reference/prometheusrule/",
"nais.io/v1alpha1, Kind=Application": "https://doc.nais.io/workloads/application/reference/application-spec/",
"nais.io/v1, Kind=Naisjob": "https://doc.nais.io/workloads/job/reference/naisjob-spec/",
"unleash.nais.io/v1, Kind=ApiToken": "https://doc.nais.io/services/feature-toggling/?h=#creating-a-new-api-token",
}

s := &strings.Builder{}
Expand Down

0 comments on commit 60cf43c

Please sign in to comment.