Skip to content

Commit

Permalink
doc: fix links in preparation for new docs (#223)
Browse files Browse the repository at this point in the history
* docgen: add tags to template, update paths for outputs

* fix links to docs in spec

Co-authored-by: Johnny Horvi <johnny@horvi.no>

---------

Co-authored-by: Johnny Horvi <johnny@horvi.no>
  • Loading branch information
tronghn and jhrv authored May 15, 2024
1 parent 37eb7a6 commit 674c94b
Show file tree
Hide file tree
Showing 15 changed files with 71 additions and 49 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ jobs:
- name: Commit documentation to nais/doc
run: |
cd naisdoc
cp -v ../liberator/doc/output/application/reference.md docs/reference/application-spec.md
cp -v ../liberator/doc/output/application/example.md docs/reference/application-example.md
cp -v ../liberator/doc/output/naisjob/reference.md docs/reference/naisjob-spec.md
cp -v ../liberator/doc/output/naisjob/example.md docs/reference/naisjob-example.md
cp -v ../liberator/doc/output/topic/reference.md docs/reference/kafka-topic-spec.md
cp -v ../liberator/doc/output/topic/example.md docs/reference/kafka-topic-example.md
cp -v ../liberator/doc/output/application/reference.md docs/workloads/application/reference/application-spec.md
cp -v ../liberator/doc/output/application/example.md docs/workloads/application/reference/application-example.md
cp -v ../liberator/doc/output/naisjob/reference.md docs/workloads/jobs/reference/naisjob-spec.md
cp -v ../liberator/doc/output/naisjob/example.md docs/workloads/jobs/reference/naisjob-example.md
cp -v ../liberator/doc/output/topic/reference.md docs/persistence/kafka/reference/kafka-topic-spec.md
cp -v ../liberator/doc/output/topic/example.md docs/persistence/kafka/reference/kafka-topic-example.md
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
Expand Down
8 changes: 4 additions & 4 deletions charts/templates/nais.io_applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ spec:
envVarPrefix:
description: |-
Prefix to add to environment variables made available for database connection.
If switching to `EnvVarPrefix` you need to [reset database credentials](https://docs.nais.io/persistence/postgres/#reset-database-credentials).
If switching to `EnvVarPrefix` you need to [reset database credentials](https://doc.nais.io/persistence/postgres/#reset-database-credentials).
type: string
name:
description: |-
Expand Down Expand Up @@ -739,7 +739,7 @@ spec:
idporten:
description: |-
Configures ID-porten authentication for this application.
See [ID-porten](https://doc.nais.io/explanation/auth/idporten/) for more details.
See [ID-porten](https://doc.nais.io/security/auth/idporten/) for more details.
properties:
enabled:
description: Enable ID-porten authentication. Requires `.spec.idporten.sidecar.enabled=true`.
Expand Down Expand Up @@ -919,7 +919,7 @@ spec:
maskinporten:
description: |-
Configures a Maskinporten client for this application.
See [Maskinporten](https://doc.nais.io/explanation/auth/maskinporten/) for more details.
See [Maskinporten](https://doc.nais.io/security/auth/maskinporten/) for more details.
properties:
enabled:
description: If enabled, provisions and configures a Maskinporten
Expand Down Expand Up @@ -1151,7 +1151,7 @@ spec:
type: string
prometheus:
description: |-
Prometheus is used to [scrape metrics from the pod](https://doc.nais.io/explanation/observability/metrics/).
Prometheus is used to [scrape metrics from the pod](https://doc.nais.io/observability/metrics/).
Use this configuration to override the default values.
properties:
enabled:
Expand Down
4 changes: 2 additions & 2 deletions charts/templates/nais.io_naisjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ spec:
envVarPrefix:
description: |-
Prefix to add to environment variables made available for database connection.
If switching to `EnvVarPrefix` you need to [reset database credentials](https://docs.nais.io/persistence/postgres/#reset-database-credentials).
If switching to `EnvVarPrefix` you need to [reset database credentials](https://doc.nais.io/persistence/postgres/#reset-database-credentials).
type: string
name:
description: |-
Expand Down Expand Up @@ -785,7 +785,7 @@ spec:
maskinporten:
description: |-
Configures a Maskinporten client for this Naisjob.
See [Maskinporten](https://doc.nais.io/explanation/auth/maskinporten/) for more details.
See [Maskinporten](https://doc.nais.io/security/auth/maskinporten/) for more details.
properties:
enabled:
description: If enabled, provisions and configures a Maskinporten
Expand Down
8 changes: 4 additions & 4 deletions config/crd/bases/nais.io_applications.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ spec:
envVarPrefix:
description: |-
Prefix to add to environment variables made available for database connection.
If switching to `EnvVarPrefix` you need to [reset database credentials](https://docs.nais.io/persistence/postgres/#reset-database-credentials).
If switching to `EnvVarPrefix` you need to [reset database credentials](https://doc.nais.io/persistence/postgres/#reset-database-credentials).
type: string
name:
description: |-
Expand Down Expand Up @@ -739,7 +739,7 @@ spec:
idporten:
description: |-
Configures ID-porten authentication for this application.
See [ID-porten](https://doc.nais.io/explanation/auth/idporten/) for more details.
See [ID-porten](https://doc.nais.io/security/auth/idporten/) for more details.
properties:
enabled:
description: Enable ID-porten authentication. Requires `.spec.idporten.sidecar.enabled=true`.
Expand Down Expand Up @@ -919,7 +919,7 @@ spec:
maskinporten:
description: |-
Configures a Maskinporten client for this application.
See [Maskinporten](https://doc.nais.io/explanation/auth/maskinporten/) for more details.
See [Maskinporten](https://doc.nais.io/security/auth/maskinporten/) for more details.
properties:
enabled:
description: If enabled, provisions and configures a Maskinporten
Expand Down Expand Up @@ -1151,7 +1151,7 @@ spec:
type: string
prometheus:
description: |-
Prometheus is used to [scrape metrics from the pod](https://doc.nais.io/explanation/observability/metrics/).
Prometheus is used to [scrape metrics from the pod](https://doc.nais.io/observability/metrics/).
Use this configuration to override the default values.
properties:
enabled:
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/nais.io_naisjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ spec:
envVarPrefix:
description: |-
Prefix to add to environment variables made available for database connection.
If switching to `EnvVarPrefix` you need to [reset database credentials](https://docs.nais.io/persistence/postgres/#reset-database-credentials).
If switching to `EnvVarPrefix` you need to [reset database credentials](https://doc.nais.io/persistence/postgres/#reset-database-credentials).
type: string
name:
description: |-
Expand Down Expand Up @@ -785,7 +785,7 @@ spec:
maskinporten:
description: |-
Configures a Maskinporten client for this Naisjob.
See [Maskinporten](https://doc.nais.io/explanation/auth/maskinporten/) for more details.
See [Maskinporten](https://doc.nais.io/security/auth/maskinporten/) for more details.
properties:
enabled:
description: If enabled, provisions and configures a Maskinporten
Expand Down
4 changes: 4 additions & 0 deletions doc/templates/example/application.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
tags: [application, reference]
---

# NAIS Application example YAML

<!--
Expand Down
4 changes: 4 additions & 0 deletions doc/templates/example/naisjob.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
tags: [job, reference]
---

# NAIS Job example YAML

<!--
Expand Down
4 changes: 4 additions & 0 deletions doc/templates/example/topic.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
tags: [kafka, reference]
---

# NAIS Topic example YAML

<!--
Expand Down
4 changes: 4 additions & 0 deletions doc/templates/reference/application.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
tags: [application, reference]
---

# NAIS Application reference

<!--
Expand Down
4 changes: 4 additions & 0 deletions doc/templates/reference/naisjob.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
tags: [job, reference]
---

# NAIS Job reference

<!--
Expand Down
4 changes: 4 additions & 0 deletions doc/templates/reference/topic.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
tags: [kafka, reference]
---

# NAIS Topic reference

<!--
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/nais.io/v1/digdirator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ type ConsumedScope struct {

type ExposedScope struct {
// If Enabled the configured scope is available to be used and consumed by organizations granted access.
// +nais:doc:Link="https://doc.nais.io/naisjob/reference/#maskinportenscopesexposesconsumers"
// +kubebuilder:validation:Required
Enabled bool `json:"enabled"`
// The actual subscope combined with `Product`.
Expand Down
21 changes: 10 additions & 11 deletions pkg/apis/nais.io/v1/naiserator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ type GCP struct {
// +nais:doc:Availability=GCP
SqlInstances []CloudSqlInstance `json:"sqlInstances,omitempty"`
// List of _additional_ permissions that should be granted to your application for accessing external GCP resources that have not been provisioned through NAIS.
// +nais:doc:Link="https://doc.nais.io/nais-application/permissions-in-gcp/"
// +nais:doc:Availability=GCP
Permissions []CloudIAMPermission `json:"permissions,omitempty"`
}
Expand Down Expand Up @@ -291,7 +290,7 @@ type Kafka struct {
Pool string `json:"pool"`

// Allow this app to use kafka streams
// +nais:doc:Link="https://doc.nais.io/persistence/kafka/application/#using-kafka-streams-with-internal-topics"
// +nais:doc:Link="https://doc.nais.io/persistence/kafka/how-to/internal"
// +nais:doc:Availability=GCP
// +nais:doc:Default="false"
Streams bool `json:"streams,omitempty"`
Expand Down Expand Up @@ -369,7 +368,7 @@ type Replicas struct {
// +nais:doc:Default="false"
DisableAutoScaling bool `json:"disableAutoScaling,omitempty"`
// ScalingStrategy configures how automatic scaling is performed.
// +nais:doc:link:https://doc.nais.io/nais-application/automatic-scaling/
// +nais:doc:link:https://doc.nais.io/workloads/application/reference/automatic-scaling/
ScalingStrategy *ScalingStrategy `json:"scalingStrategy,omitempty"`
}

Expand Down Expand Up @@ -498,7 +497,7 @@ type CloudSqlDatabase struct {
// +kubebuilder:validation:Required
Name string `json:"name"`
// Prefix to add to environment variables made available for database connection.
// If switching to `EnvVarPrefix` you need to [reset database credentials](https://docs.nais.io/persistence/postgres/#reset-database-credentials).
// If switching to `EnvVarPrefix` you need to [reset database credentials](https://doc.nais.io/persistence/postgres/#reset-database-credentials).
EnvVarPrefix string `json:"envVarPrefix,omitempty"`
// Add extra users for database access. These users need to be manually given access to database tables.
Users []CloudSqlDatabaseUser `json:"users,omitempty"`
Expand Down Expand Up @@ -669,15 +668,15 @@ func (envVars EnvVars) ToKubernetes() []corev1.EnvVar {
type Wonderwall struct {
// Automatically redirect the user to login for all proxied GET requests.
// +nais:doc:Default="false"
// +nais:doc:Link="https://doc.nais.io/explanation/auth/wonderwall/#12-autologin"
// +nais:doc:Link="https://doc.nais.io/security/auth/wonderwall/#12-autologin"
AutoLogin bool `json:"autoLogin,omitempty"`
// Comma separated list of absolute paths to ignore when auto-login is enabled.
// +nais:doc:Link="https://doc.nais.io/explanation/auth/wonderwall/#12-autologin"
// +nais:doc:Link="https://doc.nais.io/security/auth/wonderwall/#12-autologin"
AutoLoginIgnorePaths []WonderwallIgnorePaths `json:"autoLoginIgnorePaths,omitempty"`
// Enable the sidecar.
Enabled bool `json:"enabled"`
// Resource requirements for the sidecar container.
// +nais:doc:Link="https://doc.nais.io/explanation/auth/wonderwall/#4-resource-requirements"
// +nais:doc:Link="https://doc.nais.io/security/auth/wonderwall/#4-resource-requirements"
Resources *ResourceRequirements `json:"resources,omitempty"`
}

Expand All @@ -688,7 +687,7 @@ type FrontendGeneratedConfig struct {
// If specified, a Javascript file with application specific frontend configuration variables
// will be generated and mounted into the pod file system at the specified path.
// You can import this file directly from your Javascript application.
// +nais:doc:Link="https://doc.nais.io/explanation/observability/frontend/#auto-configuration"
// +nais:doc:Link="https://doc.nais.io/observability/frontend/#auto-configuration"
MountPath string `json:"mountPath"`
}

Expand Down Expand Up @@ -716,7 +715,7 @@ type Logging struct {
Enabled bool `json:"enabled,omitempty"`

// Log destinations for where to forward application logs for persistent storage. Leave empty to use default destinations.
// +nais:doc:Link="https://doc.nais.io/explanation/observability/logging/#log-destinations"
// +nais:doc:Link="https://doc.nais.io/observability/logging/#log-destinations"
Destinations []LogDestination `json:"destinations,omitempty"`
}

Expand All @@ -728,11 +727,11 @@ type Observability struct {
// Enable application performance monitoring with traces collected using OpenTelemetry and the OTLP exporter.
// +nais:doc:Availability="GCP"
// +nais:doc:Experimental=true
// +nais:doc:Link="https://doc.nais.io/explanation/observability/tracing/"
// +nais:doc:Link="https://doc.nais.io/observability/tracing/"
Tracing *Tracing `json:"tracing,omitempty"`

// Configure logging for your application.
// +nais:doc:Link="https://doc.nais.io/explanation/observability/logging/"
// +nais:doc:Link="https://doc.nais.io/observability/logging/"
Logging *Logging `json:"logging,omitempty"`

// Enable auto-instrumenting your application using the OpenTelemetry Agent.
Expand Down
12 changes: 6 additions & 6 deletions pkg/apis/nais.io/v1/naisjob_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type NaisjobSpec struct {
// By default, no traffic is allowed between naisjobs inside the cluster.
// Configure access policies to explicitly allow communication between naisjobs.
// This is also used for granting inbound access in the context of Azure AD and TokenX clients.
// +nais:doc:Link="https://doc.nais.io/explanation/zero-trust/"
// +nais:doc:Link="https://doc.nais.io/workloads/explanations/zero-trust/"
AccessPolicy *AccessPolicy `json:"accessPolicy,omitempty"`

// Once a Naisjob reaches activeDeadlineSeconds, all of its running Pods are terminated and the Naisjob status will become type: Failed with reason: DeadlineExceeded.
Expand Down Expand Up @@ -128,7 +128,7 @@ type NaisjobSpec struct {
Logtransform string `json:"logtransform,omitempty"`

// Configures a Maskinporten client for this Naisjob.
// See [Maskinporten](https://doc.nais.io/explanation/auth/maskinporten/) for more details.
// See [Maskinporten](https://doc.nais.io/security/auth/maskinporten/) for more details.
Maskinporten *Maskinporten `json:"maskinporten,omitempty"`

// To get your own OpenSearch instance head over to the IaC-repo to provision each instance.
Expand All @@ -144,7 +144,7 @@ type NaisjobSpec struct {
// PreStopHook is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc.
// The handler is not called if the container crashes or exits by itself.
// The reason for termination is passed to the handler.
// +nais:doc:Link="https://doc.nais.io/reference/good-practices/#handles-termination-gracefully";"https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks"
// +nais:doc:Link="https://doc.nais.io/workloads/explanations/good-practices/#handles-termination-gracefully";"https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks"
PreStopHook *PreStopHook `json:"preStopHook,omitempty"`

// Sometimes, Naisjobs are temporarily unable to serve traffic. For example, an Naisjob might need
Expand All @@ -157,7 +157,7 @@ type NaisjobSpec struct {

// List of redis instances this job needs credentials for.
// Must be owned by same team.
// +nais:doc:Link="https://doc.nais.io/explanation/persistence/redis/"
// +nais:doc:Link="https://doc.nais.io/persistence/redis/"
Redis []Redis `json:"redis,omitempty"`

// RestartPolicy describes how the container should be restarted. Only one of the following restart policies may be specified.
Expand All @@ -168,7 +168,7 @@ type NaisjobSpec struct {

// When Containers have [resource requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) specified,
// the Kubernetes scheduler can make better decisions about which nodes to place pods on.
// +nais:doc:Link="https://doc.nais.io/reference/good-practices/#set-reasonable-resource-requests-and-limits"
// +nais:doc:Link="https://doc.nais.io/workloads/explanations/good-practices/#set-reasonable-resource-requests-and-limits"
Resources *ResourceRequirements `json:"resources,omitempty"`

// The [Cron](https://en.wikipedia.org/wiki/Cron) schedule for running the Naisjob.
Expand Down Expand Up @@ -206,7 +206,7 @@ type NaisjobSpec struct {
TTLSecondsAfterFinished *int32 `json:"ttlSecondsAfterFinished,omitempty"`

// Configuration options related to application observability.
// +nais:doc:Link="https://doc.nais.io/explanation/observability/"
// +nais:doc:Link="https://doc.nais.io/observability/"
Observability *Observability `json:"observability,omitempty"`

// Provides secrets management, identity-based access, and encrypting application data for auditing of secrets
Expand Down
Loading

0 comments on commit 674c94b

Please sign in to comment.