Skip to content

Commit

Permalink
Merge branch 'develop' into feature/new-docs-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
nmelehan committed Oct 20, 2020
2 parents c8abc3a + 9847b50 commit fd2bb17
Show file tree
Hide file tree
Showing 32 changed files with 674 additions and 89 deletions.
6 changes: 6 additions & 0 deletions ci/vale/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ backticks
backupninja
bampton
balarin
bantime
barebones
base64
basearch
Expand Down Expand Up @@ -181,6 +182,7 @@ chrooting
chrooted
citad
cjones
clamav
clearsign
clearspace
cli
Expand Down Expand Up @@ -437,6 +439,7 @@ filesystem
filesystems
filezilla
filimonov
findtime
finnix
firewalld
firewalling
Expand Down Expand Up @@ -614,6 +617,7 @@ ifnames
iframe
iframes
ifup
ignoreip
ikiwiki
im
imagize
Expand Down Expand Up @@ -789,6 +793,7 @@ logdir
logfile
logfiles
loglevel
logpath
logrotate
logstash
logwatch
Expand Down Expand Up @@ -838,6 +843,7 @@ matplotlib
mawk
maxconn
maxdepth
maxretry
mbit
mbits
mbox
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const app = express();
{{< file "server/app.js" js >}}
// add after 'const app = express();'

app.get('/video', function(req, res) {
app.get('/video', (req, res) => {
res.sendFile('assets/sample.mp4', { root: __dirname });
});
{{< /file >}}
Expand All @@ -119,7 +119,7 @@ app.get('/video', function(req, res) {
{{< file "server/app.js" js >}}
// add to end of file

app.listen(4000, function () {
app.listen(4000, () => {
console.log('Listening on port 4000!')
});
{{< /file >}}
Expand Down Expand Up @@ -425,9 +425,7 @@ const cors = require('cors');
// add after existing app.get('/video', ...) route

app.use(cors());
app.get('/videos', function(req, res) {
res.json(videos);
});
app.get('/videos', (req, res) => res.json(videos));
{{< /file >}}

First, we enable `cors` on the server since we’ll be making the requests from a different origin (domain). `cors` was installed in the [Application Setup](#application-setup) section. Then the `/videos` route is declared, which returns the array we just created in `json` format.
Expand All @@ -443,7 +441,7 @@ Our React application fetches the video by `id`, so we can use the `id` to get t
{{< file "server/app.js" js >}}
// add after app.get('/videos', ...) route

app.get('/video/:id/data', function(req, res) {
app.get('/video/:id/data', (req, res) => {
const id = parseInt(req.params.id, 10);
res.json(videos[id]);
});
Expand Down Expand Up @@ -472,34 +470,34 @@ We now need to implement two new features that are not supported by that endpoin
{{< file "server/app.js" js >}}
// add after app.get('/video/:id/data', ...) route

app.get('/video/:id', function(req, res) {
app.get('/video/:id', (req, res) => {
const path = `assets/${req.params.id}.mp4`;
const stat = fs.statSync(path);
const fileSize = stat.size;
const range = req.headers.range;
if (range) {
const parts = range.replace(/bytes=/, "").split("-")
const start = parseInt(parts[0], 10)
const parts = range.replace(/bytes=/, "").split("-");
const start = parseInt(parts[0], 10);
const end = parts[1]
? parseInt(parts[1], 10)
: fileSize-1
const chunksize = (end-start)+1
const file = fs.createReadStream(path, {start, end})
: fileSize-1;
const chunksize = (end-start) + 1;
const file = fs.createReadStream(path, {start, end});
const head = {
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
'Accept-Ranges': 'bytes',
'Content-Length': chunksize,
'Content-Type': 'video/mp4',
}
};
res.writeHead(206, head);
file.pipe(res);
} else {
const head = {
'Content-Length': fileSize,
'Content-Type': 'video/mp4',
}
res.writeHead(200, head)
fs.createReadStream(path).pipe(res)
};
res.writeHead(200, head);
fs.createReadStream(path).pipe(res);
}
});
{{< /file >}}
Expand Down Expand Up @@ -528,29 +526,29 @@ else {
const head = {
'Content-Length': fileSize,
'Content-Type': 'video/mp4',
}
res.writeHead(200, head)
fs.createReadStream(path).pipe(res)
};
res.writeHead(200, head);
fs.createReadStream(path).pipe(res);
}
{{< / highlight >}}

Subsequent requests will include a range, which we handle in the `if` block:

{{< highlight js >}}
if (range) {
const parts = range.replace(/bytes=/, "").split("-")
const start = parseInt(parts[0], 10)
const parts = range.replace(/bytes=/, "").split("-");
const start = parseInt(parts[0], 10);
const end = parts[1]
? parseInt(parts[1], 10)
: fileSize-1
const chunksize = (end-start)+1
const file = fs.createReadStream(path, {start, end})
: fileSize-1;
const chunksize = (end-start) + 1;
const file = fs.createReadStream(path, {start, end});
const head = {
'Content-Range': `bytes ${start}-${end}/${fileSize}`,
'Accept-Ranges': 'bytes',
'Content-Length': chunksize,
'Content-Type': 'video/mp4',
}
};
res.writeHead(206, head);
file.pipe(res);
}
Expand Down Expand Up @@ -587,9 +585,9 @@ const thumbsupply = require('thumbsupply');
{{< file "server/app.js" js >}}
// add after app.get('/video/:id', ...) route

app.get('/video/:id/poster', function(req, res) {
app.get('/video/:id/poster', (req, res) => {
thumbsupply.generateThumbnail(`assets/${req.params.id}.mp4`)
.then(thumb => res.sendFile(thumb))
.then(thumb => res.sendFile(thumb));
});
{{< / highlight >}}

Expand Down Expand Up @@ -667,9 +665,7 @@ With the `track` element set up, we can now create the endpoint that will handle
{{< file "server/app.js" js >}}
// add after the app.get('/video/:id/poster', ...) route

app.get('/video/:id/caption', function(req, res) {
res.sendFile('assets/captions/sample.vtt', { root: __dirname });
});
app.get('/video/:id/caption', (req, res) => res.sendFile('assets/captions/sample.vtt', { root: __dirname }));
{{< /file >}}

This route will serve the same caption file, regardless of which `id` is passed as a parameter. In a more complete application, you could serve different caption files for different `id`s.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The Linode Kubernetes Engine (LKE) is a fully-managed container orchestration en

{{< disclosure-note "Additional LKE features">}}
* **etcd Backups** : A snapshot of your cluster's metadata is backed up continuously, so your cluster is automatically restored in the event of a failure.
* **High Availability** : All of your control plane components are monitored and will automatically recover if they fail.
* **High Availability** : All of your control plane components are monitored and automatically recover if they fail.
{{</ disclosure-note>}}

### In this Guide
Expand All @@ -48,7 +48,7 @@ In this guide you will learn:
- [Next Steps after deploying your cluster.](#next-steps)

{{< caution >}}
This guide's example instructions will create several billable resources on your Linode account. If you do not want to keep using the example cluster that you create, be sure to [remove it](#delete-a-cluster) when you have finished the guide.
This guide's example instructions create several billable resources on your Linode account. If you do not want to keep using the example cluster that you create, be sure to [remove it](#delete-a-cluster) when you have finished the guide.

If you remove the resources afterward, you will only be billed for the hour(s) that the resources were present on your account.
{{< /caution >}}
Expand All @@ -57,7 +57,7 @@ If you remove the resources afterward, you will only be billed for the hour(s) t

### Install kubectl

You will need to install the kubectl client to your computer before proceeding. Follow the steps corresponding to your computer's operating system.
You need to install the kubectl client to your computer before proceeding. Follow the steps corresponding to your computer's operating system.

{{< content "how-to-install-kubectl" >}}

Expand All @@ -67,21 +67,21 @@ You will need to install the kubectl client to your computer before proceeding.

## Connect to your LKE Cluster with kubectl

After you've created your LKE cluster using the Cloud Manager, you can begin interacting with and managing your cluster. You connect to it using the kubectl client on your computer. To configure kubectl, you'll download your cluster's *kubeconfig* file.
After you've created your LKE cluster using the Cloud Manager, you can begin interacting with and managing your cluster. You connect to it using the kubectl client on your computer. To configure kubectl, download your cluster's *kubeconfig* file.

### Access and Download your kubeconfig

{{< content "kubernetes-download-kubeconfig-shortguide" >}}

### Persist the Kubeconfig Context

If you create a new terminal window, it will not have access to the context that you specified using the previous instructions. This context information can be made persistent between new terminals by setting the [`KUBECONFIG` environment variable](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable) in your shell's configuration file.
If you create a new terminal window, it does not have access to the context that you specified using the previous instructions. This context information can be made persistent between new terminals by setting the [`KUBECONFIG` environment variable](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable) in your shell's configuration file.

{{< note >}}
If you are using Windows, review the [official Kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable) for how to persist your context.
{{< /note >}}

These instructions will persist the context for users of the Bash terminal. They will be similar for users of other terminals:
These instructions persist the context for users of the Bash terminal. They are similar for users of other terminals:

1. Navigate to the `$HOME/.kube` directory:

Expand Down Expand Up @@ -158,15 +158,15 @@ kube-system kube-proxy-qcjg9 1/1 Running 0

## Modify a Cluster's Node Pools

You can use the Linode Cloud Manager to modify a cluster's existing node pools by adding or removing nodes. You can also recycle your node pools to replace all of their nodes with new ones that are upgraded to the most recent patch of your cluster's Kubernetes version, or remove entire node pools from your cluster. This section will cover completing those tasks. For any other changes to your LKE cluster, you should use kubectl.
You can use the Linode Cloud Manager to modify a cluster's existing node pools by adding or removing nodes. You can also recycle your node pools to replace all of their nodes with new ones that are upgraded to the most recent patch of your cluster's Kubernetes version, or remove entire node pools from your cluster. This section covers completing those tasks. For any other changes to your LKE cluster, you should use kubectl.

### Access your Cluster's Details Page

1. Click the **Kubernetes** link in the sidebar. The Kubernetes listing page will appear and you will see all your clusters listed.
1. Click the **Kubernetes** link in the sidebar. The Kubernetes listing page appears and you see all of your clusters listed.

![Kubernetes cluster listing page](kubernetes-listing-page.png "Kubernetes cluster listing page.")

1. Click the cluster that you wish to modify. The Kubernetes cluster's details page will appear.
1. Click the cluster that you wish to modify. The Kubernetes cluster's details page appears.

![Kubernetes cluster's details page](cluster-details-page.png "Kubernetes cluster's details page.")

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ The Linode CCM accepts annotations that configure the behavior and settings of y
|---------------------|--------|---------------|-------------|
| `throttle` | &bull; integer <br>&bull; `0`-`20` <br> &bull; `0` disables the throttle | `20` | The client connection throttle limits the number of new connections-per-second from the same client IP. |
| `default-protocol` | &bull; string <br> &bull;`tcp`, `http`, `https` | `tcp` | Specifies the protocol for the NodeBalancer to use. |
| `proxy-protocol` | &bull; string <br> &bull;`none`, `v1`, `v2` | `none` | Enables Proxy Protocol on the underlying NodeBalancer and specifies the version of Proxy Protocol to use. The Proxy Protocol allows TCP client connection information, like IP address and port number, to be transferred to cluster nodes. See the [Using Proxy Protocol with NodeBalancers](/docs/platform/nodebalancer/nodebalancer-proxypass-configuration/#what-is-proxy-protocol) guide for details on each Proxy Protocol version. |
| `port-*`| A JSON object of port configurations<br> For example: <br> `{ "tls-secret-name": "prod-app-tls", "protocol": "https"})` | None | &bull; Specifies a NodeBalancer port to configure, i.e. `port-443`. <br><br> &bull; Ports `1-65534` are available for balancing. <br><br> &bull; The available port configurations are: <br><br> `"tls-secret-name"` use this key to provide a Kubernetes secret name when setting up TLS termination for a service to be accessed over HTTPS. The secret type should be `kubernetes.io/tls`. <br><br> `"protocol"` specifies the protocol to use for this port, i.e. `tcp`, `http`, `https`. The default protocol is `tcp`, unless you provided a different configuration for the `default-protocol` annotation. |
| `check-type` | &bull; string <br> &bull; `none`, `connection`, `http`, `http_body` | None | &bull; The type of health check to perform on Nodes to ensure that they are serving requests. The behavior for each check is the following: <br><br> `none` no check is performed <br><br> `connection` checks for a valid TCP handshake <br><br> `http` checks for a `2xx` or `3xx` response code <br><br> `http_body` checks for a specific string within the response body of the healthcheck URL. Use the `check-body` annotation to provide the string to use for the check. |
| `check-path` | string | None | The URL path that the NodeBalancer will use to check on the health of the back-end Nodes. |
Expand All @@ -150,10 +151,6 @@ To view a list of deprecated annotations, visit the [Linode CCM GitHub repositor

This section describes how to set up TLS termination on your Linode NodeBalancers so a Kubernetes Service can be accessed over HTTPS.

{{< note >}}
While Linode NodeBalancers do support ProxyProtocol, the Linode CCM does not. For this reason, the Linode Kubernetes Engine does not support ProxyProtocol yet. This means you cannot both terminate TLS inside your Kubernetes cluster and whitelist client IP addresses. ProxyProtocol support is coming soon to the Linode CCM.
{{</ note >}}

#### Generating a TLS type Secret

Kubernetes allows you to store sensitive information in a Secret object for use within your cluster. This is useful for storing things like passwords and API tokens. In this section, you will create a Kubernetes secret to store Transport Layer Security (TLS) certificates and keys that you will then use to configure TLS termination on your Linode NodeBalancers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ This guide will show you how to:
- Create two instances of sample application Deployments to create two separate mock websites on a single Kubernetes cluster served over port 80.
- Create an Ingress and a NodeBalancer to route traffic from the internet to Kubernetes Services.

{{< note >}}
[Linode NodeBalancers](https://www.linode.com/products/nodebalancers/0) do not currently support ProxyProtocol. For this reason, Kubernetes LoadBalancer Services running on Linode do not support ProxyProtocol either. This means you cannot both terminate TLS inside your Kubernetes cluster and whitelist client IP addresses. ProxyProtocol support is coming soon to Linode NodeBalancers.
{{</ note >}}

## Before You Begin

- You should have a working knowledge of Kubernetes' key concepts, including master and worker nodes, Pods, Deployments, and Services. For more information on Kubernetes, see our [Beginner's Guide to Kubernetes](/docs/kubernetes/beginners-guide-to-kubernetes/) series.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ example.com. 86400 IN NS ns4.linode.com.
;; ADDITIONAL SECTION:
ns1.linode.com. 86400 IN A 69.93.127.10
ns2.linode.com. 86400 IN A 65.19.178.10
ns3.linode.com. 86400 IN A 75.127.96.10
ns3.linode.com. 86400 IN A 74.207.225.10
ns4.linode.com. 86400 IN A 207.192.70.10
ns5.linode.com. 86400 IN A 109.74.194.10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ Creating a domain also creates its corresponding domain zone.

![This page lets you add a new domain](add-new-domain.png "This page lets you add a new domain")

1. If you want to add a *slave zone* instead of a master zone, click the **Slave** radio button.
1. If you want to add a *slave zone* instead of a master zone, click the **Slave** radio button. If not, you may skip to the next step.

{{< note >}}
In order for Linode's DNS servers to function as slaves, your DNS master server must notify and allow AXFR requests from the following IP addresses:

104.237.137.10
Expand All @@ -42,7 +41,10 @@ In order for Linode's DNS servers to function as slaves, your DNS master server
2600:3c02::a
2600:3c03::a
2a01:7e00::a
{{< /note >}}

{{< caution >}}
On **December 15th, 2020** the IP address `75.127.96.10` will be replaced with the IP address `74.207.225.10`. While both IP addresses currently provide AXFR support, users will need to replace `75.127.96.10` with `74.207.225.10` in their configurations by the 15th of December, 2020, for long term AXFR support.
{{< /caution >}}

1. Enter your domain name in the **Domain** field. An example is shown above.
1. Enter an administrator's email address in the **SOA Email Address** field.
Expand Down
Loading

0 comments on commit fd2bb17

Please sign in to comment.