We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose. Learn more.
Hidden smoketest page
Use this page to test your changes and ensure that there are not any issues, unwanted behaviors, or regression that are caused by your changes.
Below are a set of site elements that have causes issues in the past.
Lists
- Top level:
- A nested list item.
- another level lower
- Nested code sample:
Syntax:{
{< readfile file="../community/samples/serving/helloworld-java-quarkus/service.yaml" code=“true” lang=“yaml” >}
}
Example:apiVersion: serving.knative.dev/v1 kind: Service metadata: name: helloworld-java-quarkus spec: template: spec: containers: - image: docker.io/saturnism/helloworld-java-quarkus env: - name: TARGET value: "Quarkus Sample v1"
- This should be the third bullet (3.).
- More nested code:
Shortcode:{
{< readfile file="/serving/samples/hello-world/helloworld-go/Dockerfile" code=“true” lang=“go” >}
}
Example:# Use the official Golang image to create a build artifact. # This is based on Debian and sets the GOPATH to /go. FROM golang:1.13 as builder # Create and change to the app directory. WORKDIR /app # Retrieve application dependencies using go modules. # Allows container builds to reuse downloaded dependencies. COPY go.* ./ RUN go mod download # Copy local code to the container image. COPY . ./ # Build the binary. # -mod=readonly ensures immutable go.mod and go.sum in container builds. RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server # Use the official Alpine image for a lean production container. # https://hub.docker.com/_/alpine # https://docs.docker.com/develop/develop-images/multistage-build/#use-multi-stage-builds FROM alpine:3 RUN apk add --no-cache ca-certificates # Copy the binary to the production image from the builder stage. COPY --from=builder /app/server /server # Run the web service on container startup. CMD ["/server"]
- Another nested ordered list item (2.)
- More nested code:
- A nested list item.
Code samples
The following use the
readfile
shortcode
Shortcode: {
renders as:
{< readfile file="../hack/reference-docs-gen-config.json" code=“true” lang=“json” >}
}
{
"hideMemberFields": [
"TypeMeta"
],
"hideTypePatterns": [
"ParseError$",
"List$"
],
"externalPackages": [
{
"typeMatchPrefix": "^k8s\\.io/apimachinery/pkg/apis/meta/v1\\.Duration$",
"docsURLTemplate": "https://godoc.org/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"
},
{
"typeMatchPrefix": "^k8s\\.io/(api|apimachinery/pkg/apis)/",
"docsURLTemplate": "https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#{{lower .TypeIdentifier}}-{{arrIndex .PackageSegments -1}}-{{arrIndex .PackageSegments -2}}"
},
{
"typeMatchPrefix": "^knative\\.dev/pkg/apis/duck",
"docsURLTemplate": "https://pkg.go.dev/knative.dev/pkg/apis/duck/{{arrIndex .PackageSegments -1}}#{{.TypeIdentifier}}"
},
{
"typeMatchPrefix": "^knative\\.dev/pkg/apis\\.URL$",
"docsURLTemplate": "https://pkg.go.dev/knative.dev/pkg/apis#URL"
},
{
"typeMatchPrefix": "^knative\\.dev/networking/pkg/apis/networking",
"docsURLTemplate": "https://pkg.go.dev/knative.dev/networking/pkg/apis/networking#{{.TypeIdentifier}}"
},
{
"typeMatchPrefix": "^time\\.Duration$",
"docsURLTemplate": "https://golang.org/pkg/time/#Duration"
}
],
"typeDisplayNamePrefixOverrides": {
"k8s.io/api/": "Kubernetes ",
"k8s.io/apimachinery/pkg/apis/": "Kubernetes "
},
"markdownDisabled": false
}
Shortcode: {
renders as:
{< readfile file="./serving/samples/cloudevents/cloudevents-nodejs/service.yaml" code=“true” lang=“yaml” >}
}
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: cloudevents-nodejs
namespace: default
spec:
template:
spec:
containers:
- image: <registry/repository/image:tag>
# Uncomment this to send events somewhere.
# env:
# - name: K_SINK
# value: http://default-broker.default.svc.cluster.local
Install version numbers and Clone branch commands
Examples of how the manual and dynamic version number or branch name can be
added in-line with the
version
shortcode
(uses the define values from
config/_default/params.toml)
-
Shortcode:
{
renders as: v0.22.0{< version >}
}Example:
kubectl apply version/v0.22.0/is-the-latest/docs-version.yaml
-
Shortcode:
{
renders as: v0.2.2{< version override=“v0.2.2” >}
}Example:
kubectl apply the-version-override/v0.2.2/is-manually-specified.yaml
-
Shortcode:
{
renders as: v0.22.20{< version patch=".20" >}
}Example:
kubectl apply this-is-a-point-release/v0.22.20/filename.yaml
-
Shortcode:
{
renders as: main{< branch >}
}Example:
git clone -b "main" https://github.com/knative/docs knative-docs
-
Shortcode:
{
renders as: release-0.NEXT{< branch override=“release-0.NEXT” >}
}Example:
git clone -b "release-0.NEXT" https://github.com/knative/docs knative-docs
Tabs
How to include tabbed content in your page. Note that you can set a default tab.
# Copyright 2020 The Knative Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: multi-container
namespace: default
spec:
template:
spec:
containers:
- image: docker.io/savita3020/servingcontainer
ports:
- containerPort: 8881
- image: docker.io/savita3020/sidecarcontainer