{"_id":"57acceed71d2991900b9a631","__v":0,"category":{"_id":"57acceed71d2991900b9a62c","version":"57acceed71d2991900b9a62b","project":"570086efa565e20e001573b3","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-03T02:58:55.770Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"project":"570086efa565e20e001573b3","user":"569d7767ec29360d00f667c7","version":{"_id":"57acceed71d2991900b9a62b","project":"570086efa565e20e001573b3","__v":1,"createdAt":"2016-08-11T19:15:57.383Z","releaseDate":"2016-08-11T19:15:57.383Z","categories":["57acceed71d2991900b9a62c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-08-02T22:10:34.680Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"Spread templating enables users to easily configure and deploy containerized applications to Kubernetes. Parameters exposed in the command line provide a simple interface for entering in required information without needing to manually edit Kubernetes object files. This is our first release of templating, and we've focused on the user experience around configuring parameters for pre-defined templates. In the near future, we will update the documentation to show how to author templates.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"1. Setting up Spread\"\n}\n[/block]\nIf you haven't already done so, go ahead and [set up Spread](https://redspread.readme.io/docs).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"2. Using Parameters to Deploy Templated Applications\"\n}\n[/block]\nFor this tutorial, we've set up an example application you can deploy with Spread from our Spread Library: a virtual private network (VPN). The following instructions will take you through deploying the application step-by-step.\n\n**Virtual Private Network (VPN)** \n\nA virtual private network (VPN) is a private network that extends across a public network or internet. It enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network. A VPN is useful for securely and remotely accessing a corporate intranet, sending wireless transactions, and connecting to proxy servers to protect personal information or location, among other uses. (Source: [Wikipedia](https://en.wikipedia.org/wiki/Virtual_private_network))\n\n**1. Use one of the following commands to initiate deployment:**\n\n* If you are using the local cluster solution, [Minikube](https://github.com/kubernetes/minikube): `spread deploy vpn`\n* If you are using a remote cluster on GKE: `spread deploy vpn-gke`\n* If you are using a remote cluster on AWS: `spread deploy vpn-aws`\n\n**2. If you are on GKE or AWS, set up your volume:**\n\nNote: Setting up volumes is not required, but if the Pod dies, all configuration and certs will be lost (and the VPN will be useless).\n\n* For GKE, enter this command, filling in the placeholders: `gcloud compute disks create --size=400GB my-vpn --project <projectName>`\n* For AWS, enter this command, filling in the placeholders: `ec2-create-volume --size 200 --region <regionName> --availability-zone <availabilityZoneName>`\n\nIf you are using Minikube, there are no volumes to set up and you can skip on to the next step.\n\n**3. Next, you will be prompted to fill in the only required parameter:**\n\n`OVPN_HOST` (required) - Hostname to be used to connect to OpenVPN (i.e. vpn.example.com)\n\nThe following parameters are optional, as they are populated with sane defaults if left blank. Hit enter to click through them.\n\n* `KUBE_DNS` - Kubernetes DNS Nameserver\n* `KUBE_DNS_SEARCH` - DNS Search path to be used (i.e. cluster.local)\n* `KUBE_SVC_NET` - IP of Kubernetes Service Network\n* `KUBE_SVC_MASK` - Subnet Mask of Kubernetes Service Network\n\nOnce you have filled in your parameter(s), Spread will deploy your newly configured VPN to either a local cluster or your specified remote cluster. \n\n**4. Set up your client.**\n\nNow you’ve set up the server, and you want to get people to access the server. Let’s set up your client. \n\n* Find the pod that’s running: `kubectl get pods` \n* Create the certificate on the server using the pod name that you just found\n\n`kubectl exec -it <POD_NAME> easyrsa build-client-full CLIENTNAME novas`\n\n* Write the certificate to a file, with the file name at the end\n\n`kubectl exec -it <POD_NAME> ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn`\n\nIf you're using [Tunnelblick](https://tunnelblick.net/) (OS X), you can double click that file to get access to the VPN server. For connecting client configuration for other operating systems, check out [this handy link](https://openvpn.net/index.php/access-server/docs/admin-guides-sp-859543150/howto-connect-client-configuration.html).\n\nWoo! You're all set! \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Authoring Templates (to be continued)\"\n}\n[/block]\nWe will update this section with documentation on how to author Spread templates.","excerpt":"Overview of Spread templating concepts with tutorials","slug":"spread-templating-and-tutorials","type":"basic","title":"Spread Templating and Parameters"}

Spread Templating and Parameters

Overview of Spread templating concepts with tutorials

Spread templating enables users to easily configure and deploy containerized applications to Kubernetes. Parameters exposed in the command line provide a simple interface for entering in required information without needing to manually edit Kubernetes object files. This is our first release of templating, and we've focused on the user experience around configuring parameters for pre-defined templates. In the near future, we will update the documentation to show how to author templates. [block:api-header] { "type": "basic", "title": "1. Setting up Spread" } [/block] If you haven't already done so, go ahead and [set up Spread](https://redspread.readme.io/docs). [block:api-header] { "type": "basic", "title": "2. Using Parameters to Deploy Templated Applications" } [/block] For this tutorial, we've set up an example application you can deploy with Spread from our Spread Library: a virtual private network (VPN). The following instructions will take you through deploying the application step-by-step. **Virtual Private Network (VPN)** A virtual private network (VPN) is a private network that extends across a public network or internet. It enables users to send and receive data across shared or public networks as if their computing devices were directly connected to the private network. A VPN is useful for securely and remotely accessing a corporate intranet, sending wireless transactions, and connecting to proxy servers to protect personal information or location, among other uses. (Source: [Wikipedia](https://en.wikipedia.org/wiki/Virtual_private_network)) **1. Use one of the following commands to initiate deployment:** * If you are using the local cluster solution, [Minikube](https://github.com/kubernetes/minikube): `spread deploy vpn` * If you are using a remote cluster on GKE: `spread deploy vpn-gke` * If you are using a remote cluster on AWS: `spread deploy vpn-aws` **2. If you are on GKE or AWS, set up your volume:** Note: Setting up volumes is not required, but if the Pod dies, all configuration and certs will be lost (and the VPN will be useless). * For GKE, enter this command, filling in the placeholders: `gcloud compute disks create --size=400GB my-vpn --project <projectName>` * For AWS, enter this command, filling in the placeholders: `ec2-create-volume --size 200 --region <regionName> --availability-zone <availabilityZoneName>` If you are using Minikube, there are no volumes to set up and you can skip on to the next step. **3. Next, you will be prompted to fill in the only required parameter:** `OVPN_HOST` (required) - Hostname to be used to connect to OpenVPN (i.e. vpn.example.com) The following parameters are optional, as they are populated with sane defaults if left blank. Hit enter to click through them. * `KUBE_DNS` - Kubernetes DNS Nameserver * `KUBE_DNS_SEARCH` - DNS Search path to be used (i.e. cluster.local) * `KUBE_SVC_NET` - IP of Kubernetes Service Network * `KUBE_SVC_MASK` - Subnet Mask of Kubernetes Service Network Once you have filled in your parameter(s), Spread will deploy your newly configured VPN to either a local cluster or your specified remote cluster. **4. Set up your client.** Now you’ve set up the server, and you want to get people to access the server. Let’s set up your client. * Find the pod that’s running: `kubectl get pods` * Create the certificate on the server using the pod name that you just found `kubectl exec -it <POD_NAME> easyrsa build-client-full CLIENTNAME novas` * Write the certificate to a file, with the file name at the end `kubectl exec -it <POD_NAME> ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn` If you're using [Tunnelblick](https://tunnelblick.net/) (OS X), you can double click that file to get access to the VPN server. For connecting client configuration for other operating systems, check out [this handy link](https://openvpn.net/index.php/access-server/docs/admin-guides-sp-859543150/howto-connect-client-configuration.html). Woo! You're all set! [block:api-header] { "type": "basic", "title": "Authoring Templates (to be continued)" } [/block] We will update this section with documentation on how to author Spread templates.