diff --git a/config.toml b/config.toml index 08ad4bff74..e7782e5a37 100644 --- a/config.toml +++ b/config.toml @@ -55,6 +55,7 @@ deprecated = false currentUrl = "https://kubernetes.io/docs/home/" nextUrl = "http://kubernetes-io-vnext-staging.netlify.com/" githubWebsiteRepo = "github.com/kubernetes/website" +githubWebsiteRaw = "raw.githubusercontent.com/kubernetes/website" [[params.versions]] fullversion = "v1.10.3" diff --git a/content/en/docs/setup/scratch.md b/content/en/docs/setup/scratch.md index 46d0d451c9..c354785c7f 100644 --- a/content/en/docs/setup/scratch.md +++ b/content/en/docs/setup/scratch.md @@ -856,7 +856,7 @@ You should see some services. You should also see "mirror pods" for the apiserv ### Try Examples -At this point you should be able to run through one of the basic examples, such as the [nginx example](/docs/tutorials/stateless-application/deployment.yaml). +At this point you should be able to run through one of the basic examples, such as the [nginx example](/examples/application/deployment.yaml). ### Running the Conformance Test diff --git a/content/en/docs/tasks/run-application/run-stateless-application-deployment.md b/content/en/docs/tasks/run-application/run-stateless-application-deployment.md index 27b9aafb89..043c4a089f 100644 --- a/content/en/docs/tasks/run-application/run-stateless-application-deployment.md +++ b/content/en/docs/tasks/run-application/run-stateless-application-deployment.md @@ -41,7 +41,7 @@ a Deployment that runs the nginx:1.7.9 Docker image: 1. Create a Deployment based on the YAML file: - kubectl apply -f https://k8s.io/docs/artifacts/application/deployment.yaml + kubectl apply -f https://k8s.io/examples/application/deployment.yaml 1. Display information about the Deployment: @@ -99,11 +99,11 @@ a Deployment that runs the nginx:1.7.9 Docker image: You can update the deployment by applying a new YAML file. This YAML file specifies that the deployment should be updated to use nginx 1.8. -{{< code file="deployment-update.yaml" >}} +{{< codenew file="application/deployment-update.yaml" >}} 1. Apply the new YAML file: - kubectl apply -f https://k8s.io/docs/tasks/run-application/deployment-update.yaml + kubectl apply -f https://k8s.io/examples/application/deployment-update.yaml 1. Watch the deployment create pods with new names and delete the old pods: @@ -115,11 +115,11 @@ You can increase the number of pods in your Deployment by applying a new YAML file. This YAML file sets `replicas` to 4, which specifies that the Deployment should have four pods: -{{< code file="deployment-scale.yaml" >}} +{{< codenew file="application/deployment-scale.yaml" >}} 1. Apply the new YAML file: - kubectl apply -f https://k8s.io/docs/tasks/run-application/deployment-scale.yaml + kubectl apply -f https://k8s.io/examples/application/deployment-scale.yaml 1. Verify that the Deployment has four pods: diff --git a/content/en/docs/tutorials/deployment-update.yaml b/content/en/docs/tutorials/deployment-update.yaml deleted file mode 100644 index 14a7dc473b..0000000000 --- a/content/en/docs/tutorials/deployment-update.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment -spec: - selector: - matchLabels: - app: nginx - replicas: 2 - template: - metadata: - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8 - ports: - - containerPort: 80 diff --git a/content/en/docs/tutorials/deployment.yaml b/content/en/docs/tutorials/deployment.yaml deleted file mode 100644 index 485be0dabc..0000000000 --- a/content/en/docs/tutorials/deployment.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment -spec: - selector: - matchLabels: - app: nginx - replicas: 2 # tells deployment to run 2 pods matching the template - template: # create pods using pod definition in this template - metadata: - # unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is - # generated from the deployment name - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx:1.7.9 - ports: - - containerPort: 80 diff --git a/content/en/docs/tutorials/k8s201.md b/content/en/docs/tutorials/k8s201.md index a6881395b1..899b6399b9 100644 --- a/content/en/docs/tutorials/k8s201.md +++ b/content/en/docs/tutorials/k8s201.md @@ -65,7 +65,7 @@ A Deployment object defines a Pod creation template (a "cookie-cutter" if you wi Here is a Deployment that instantiates two nginx Pods: -{{< code file="deployment.yaml" >}} +{{< codenew file="application/deployment.yaml" >}} ### Deployment Management @@ -73,7 +73,7 @@ Here is a Deployment that instantiates two nginx Pods: Create an nginx Deployment: ```shell -kubectl create -f https://k8s.io/docs/tutorials/deployment.yaml +kubectl create -f https://k8s.io/examples/application/deployment.yaml ``` List all Deployments: @@ -91,10 +91,10 @@ kubectl get pods -l app=nginx Upgrade the nginx container from 1.7.9 to 1.8 by changing the Deployment and calling `apply`. The following config contains the desired changes: -{{< code file="deployment-update.yaml" >}} +{{< codenew file="application/deployment-update.yaml" >}} ```shell -kubectl apply -f https://k8s.io/docs/tutorials/deployment-update.yaml +kubectl apply -f https://k8s.io/examples/application/deployment-update.yaml ``` Watch the Deployment create Pods with new names and delete the old Pods: diff --git a/content/en/docs/tutorials/stateless-application/deployment.yaml b/content/en/docs/tutorials/stateless-application/deployment.yaml deleted file mode 100644 index 485be0dabc..0000000000 --- a/content/en/docs/tutorials/stateless-application/deployment.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx-deployment -spec: - selector: - matchLabels: - app: nginx - replicas: 2 # tells deployment to run 2 pods matching the template - template: # create pods using pod definition in this template - metadata: - # unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is - # generated from the deployment name - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx:1.7.9 - ports: - - containerPort: 80 diff --git a/content/en/docs/tasks/run-application/deployment-scale.yaml b/content/en/examples/application/deployment-scale.yaml similarity index 100% rename from content/en/docs/tasks/run-application/deployment-scale.yaml rename to content/en/examples/application/deployment-scale.yaml diff --git a/content/en/docs/tasks/run-application/deployment-update.yaml b/content/en/examples/application/deployment-update.yaml similarity index 100% rename from content/en/docs/tasks/run-application/deployment-update.yaml rename to content/en/examples/application/deployment-update.yaml diff --git a/content/en/artifacts/application/deployment.yaml b/content/en/examples/application/deployment.yaml similarity index 100% rename from content/en/artifacts/application/deployment.yaml rename to content/en/examples/application/deployment.yaml diff --git a/layouts/shortcodes/codenew.html b/layouts/shortcodes/codenew.html index 2224065aed..80a1d5017f 100644 --- a/layouts/shortcodes/codenew.html +++ b/layouts/shortcodes/codenew.html @@ -3,8 +3,8 @@ {{ $codelang := .Get "language" | default (path.Ext $file | strings.TrimPrefix ".") }} {{ $fileDir := path.Split $file }} {{ $bundlePath := path.Join .Page.Dir $fileDir.Dir }} -{{ $filename := printf "/content/%s/artifacts/%s" .Page.Lang $file | safeURL }} -{{ $ghlink := printf "https://%s/blob/master%s" .Page.Site.Params.githubWebsiteRepo $filename | safeURL }} +{{ $filename := printf "/content/%s/examples/%s" .Page.Lang $file | safeURL }} +{{ $ghlink := printf "https://%s/master%s" .Page.Site.Params.githubWebsiteRaw $filename | safeURL }} {{/* First assume this is a bundle and the file is inside it. */}} {{ $resource := $p.Resources.GetMatch (printf "%s*" $file ) }} {{ with $resource }} diff --git a/test/examples_test.go b/test/examples_test.go index a72eb50132..d1d8a2b976 100644 --- a/test/examples_test.go +++ b/test/examples_test.go @@ -440,13 +440,13 @@ func TestExampleObjectSchemas(t *testing.T) { "redis-pod": {&api.Pod{}}, "redis-service": {&api.Service{}}, }, - "artifacts/application": { + "examples/application": { "deployment": {&extensions.Deployment{}}, + "deployment-scale": {&extensions.Deployment{}}, + "deployment-update": {&extensions.Deployment{}}, }, "docs/tasks/run-application": { "deployment-patch-demo": {&extensions.Deployment{}}, - "deployment-scale": {&extensions.Deployment{}}, - "deployment-update": {&extensions.Deployment{}}, "hpa-php-apache": {&autoscaling.HorizontalPodAutoscaler{}}, "mysql-configmap": {&api.ConfigMap{}}, "mysql-deployment": {&api.Service{}, &extensions.Deployment{}}, @@ -479,11 +479,6 @@ func TestExampleObjectSchemas(t *testing.T) { "mysql-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}}, "wordpress-deployment": {&api.Service{}, &api.PersistentVolumeClaim{}, &extensions.Deployment{}}, }, - "docs/tutorials/stateless-application": { - "deployment": {&extensions.Deployment{}}, - "deployment-scale": {&extensions.Deployment{}}, - "deployment-update": {&extensions.Deployment{}}, - }, "docs/tutorials/stateless-application/guestbook": { "frontend-deployment": {&extensions.Deployment{}}, "frontend-service": {&api.Service{}},