* Delete the parameter "--google-json-key string" Delete the parameter "--google-json-key string" * Fix apimachinery vendored dependencies in examples_test. * package apt-transport-https should be installed Ubuntu default install not include apt-transport-https. so if you want to download package from https repo, you need install apt-transport-https package first * doc-walkthrough-content modify * limitrange-update I think it's redundant that the second to ,in order to do sth and do sth!thanks! * fix command kubectl get svc,pod output fix command kubectl get svc,pod output * Fix typo: federation-controller-mananger => federation-controller-manager * Fix typo: federation-controller-mananger => federation-controller-manager * Clarify minimum version of kubernetes supporting PSP authz * Provide correct location for KUBE_ETCD_SERVERS Provide correct location for KUBE_ETCD_SERVERS configuration key. It was previously listed as being in /etc/kubernetes/config but is actually in /etc/kubernetes/apiserver. Related: https://github.com/kubernetes/kubernetes.github.io/issues/1600 * Move Compute Resources topic to Concepts. (#2410) * Delete the parameter "--google-json-key string" “# kube-scheduler -help”can not find --google-json-key option # kubectl version Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1+82450d0", GitCommit:"f5ef9802914a47c848fd84c287333f8b4d28bbc1", GitTreeState:"dirty", BuildDate:"2017-01-23T00:04:39Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64", USEEVersion:"V1.02.01_alpha", USEEPublishDate:"2017-1-10 00:00:00"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1+82450d0", GitCommit:"f5ef9802914a47c848fd84c287333f8b4d28bbc1", GitTreeState:"dirty", BuildDate:"2017-01-22T23:56:57Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64", USEEVersion:"V1.02.01_alpha", USEEPublishDate:"2017-1-10 00:00:00"} * Add diagnose tips when you face problem. * Update grammar for kubeadm.md, thanks @chenopis * Merge two pieces to one words * add http proxy infomation in kubeadm * Update landing pages for Tasks and Tutorials. (#2634) * Update static-pods.md It works. Please review it again. * Move Guide Topic: Multi-container pods. (#2642) * fix link to go to pod-lifecycle page * fix the command output fix the command output * mirantis_logo.png ,/images/community_logos/mirantis_logo.png updated per Mirantis request * kubeadm reference -- / set up/manage mean set up or manage ? it's better use or? * Prototype for deprecating User Guide topic. * missing word The return of the OCD. * Move Guide topic: Using Environment Variables. (#2645) * fix typo (#2656) fix typo * Move Guide topic: Using Port Forwarding. (#2661) * Move Guide topic: Bootstrapping Pet Sets. (#2662) * Move Guide topic: Bootstrapping Pet Sets. * Add TOC entry. * Move Guide topic: Connect with Proxies. (#2663) * Move Guide topic: Connect with Proxies. * Fix link. * add DefaultTolerationSeconds admission controller * getting-started-guides: add CoreOS Tectonic * Correct the certificate name * Update index.md * Update installation.md * Update validation.md * Update backups.md * Update backups.md * Spell fixes * Using it vs Juju Kubernetes * Q1 update to k8s tech and service partner list New partners registered to K8s Partner Ecosystem sign-up form. Logo updates companion to this edit still WIP * Logo file updates for new registrants Logos for new registrants * The attribute [allowfullscree] must have a value Signed-off-by: yupengzte <yu.peng36@zte.com.cn> * Remove newline before passing to base64 * Use single quote to avoid string interpolation, update output * Update command as files contain no newline * Remove all dead links, use just filename As user can guess that it is file copied from the shown content * Fix link to dev guide. * Add --leader-elect=false Second scheduler could not start without disabling leader-elect. * cluster-components-could be running could be doing sth * update cluster-components.md In theory,Master components can be run.... * update cluster-components--add a space add a space after the comma: "In theory, Master components..." * Highlighted command --kubectl describe In web page ,there is no space ,need some empty space,thanks! * Revert "Highlighted command --kubectl describe" This reverts commit a70d0a3e3537c3f91b197b23f949e1e506c951d1. * Add example show how to configure proxy for kube * Revision as the suggestion describe * move ha-master-gce.png to images/docs Signed-off-by: Xiuyu Li <nickleefly@gmail.com> * use relative path for ha-master-gce image Signed-off-by: Xiuyu Li <nickleefly@gmail.com> * The attribute [calendarWrapper] must be unique Signed-off-by: yupengzte <yu.peng36@zte.com.cn> * add required images in kubeadm init step * Add links to Docker/rtk in cluster-intro.html * s/acomplish/accomplish/ * Modify the link URL of [kubelet eviction design doc] [kubelet eviction design doc] should be linked to kubernetes.github.io instead of community/design-proposal. * fix CronJob object name fix CronJob object name * remove redundant a Signed-off-by: Xiuyu Li <nickleefly@gmail.com> * kubeadm reference--change any to some (#2683) * modify one word examples to example * doc-walkthrough-content modify * limitrange-update I think it's redundant that the second to ,in order to do sth and do sth!thanks! * cluster-components-could be running could be doing sth * update cluster-components.md In theory,Master components can be run.... * update cluster-components--add a space add a space after the comma: "In theory, Master components..." * Highlighted command --kubectl describe In web page ,there is no space ,need some empty space,thanks! * Revert "Highlighted command --kubectl describe" This reverts commit a70d0a3e3537c3f91b197b23f949e1e506c951d1. * kubeadm reference--change any to some kubeadm can install any add-on ? * Move Guide topics: Logging (#2687) * Disallow indexing for liveness/index (#2689) * Deprecate Guide topics. (#2691) * Wrong label and kubectl get completed pods The label `app=jobexample` should be `jobgroup=jobexample`. Also, for get completed pods the flag `--show-all` is necessary. * Update garbage-collection.md change “any” to "every" * Deprecate Guide topic: Persistent Volume Walkthrough. (#2692) * Reimplement PR #2525 Fixes typo by removing the word "controller" * remove extra space * Update multiple-schedulers doc (#2063) * Update tutorial * Fix md formatting. * Remove extraneous space * Deprecate Guide topic: Secrets Walkthrough. (#2695) * Deprecate Guide topics: quick-start ... (#2696) * Update Tasks landing page. (#2697) * Remove redundant section in deployments The status of the deployment is already covered in a later section in this doc. * Repair Spotinst logo Corrected size * fixed ASM blurb * Correct ASM logo filename * Highlighted command for `kubectl proxy`. * Update ubuntu install instructions. * Update local instructions to new method. * update init-containers.md add one word. * Minor spelling correction -- "rtk" to "rkt" * fixing typo * Doc formatting update Corrected indentation for the `nonResourcePath` and got a bit zealous with restructuring that section... * Repair Spotinst logo Corrected size * fixed ASM blurb * Correct ASM logo filename * Update garbage-collection.md change "any" to "every" * Update Weave Net's title. * fix unsupported parameter of wget command * update to be retained change "retain" to "to be retained". * Update pod.md * update init-containers.md change "a different filesystem view" to "different filesystem views". different init container should have different filesystem. * Highlighted command --kubectl describe In web page ,there is no space ,need some empty space,thanks! * cluster-management--3 change 3 to three is better or not ?thanks! * fix typo 1、Parameters “--allow-verification-with-non-compliant-keys” is missed. 2、Delete the parameter "--google-json-key string"; see the "# kube-controller-manager -help" # kubectl version Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1+82450d0", GitCommit:"f5ef9802914a47c848fd84c287333f8b4d28bbc1", GitTreeState:"dirty", BuildDate:"2017-01-23T00:04:39Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64", USEEVersion:"V1.02.01_alpha", USEEPublishDate:"2017-1-10 00:00:00"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1+82450d0", GitCommit:"f5ef9802914a47c848fd84c287333f8b4d28bbc1", GitTreeState:"dirty", BuildDate:"2017-01-22T23:56:57Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64", USEEVersion:"V1.02.01_alpha", USEEPublishDate:"2017-1-10 00:00:00"} * fix typo 1、Delete the parameter "--google-json-key string"; 2、Parameters "--ir-data-source string"、"--ir-dbname string"、"--ir-hawkular string"、"--ir-influxdb-host string"、"--ir-namespace-only"、"--ir-password string"、"--ir-percentile int"、"--ir-user string" is missed. see the "# kube-prxoy -help" # kubectl version Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1+82450d0", GitCommit:"f5ef9802914a47c848fd84c287333f8b4d28bbc1", GitTreeState:"dirty", BuildDate:"2017-01-23T00:04:39Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64", USEEVersion:"V1.02.01_alpha", USEEPublishDate:"2017-1-10 00:00:00"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1+82450d0", GitCommit:"f5ef9802914a47c848fd84c287333f8b4d28bbc1", GitTreeState:"dirty", BuildDate:"2017-01-22T23:56:57Z", GoVersion:"go1.7", Compiler:"gc", Platform:"linux/amd64", USEEVersion:"V1.02.01_alpha", USEEPublishDate:"2017-1-10 00:00:00"} * Update garbage-collection.md modify the url and link * update garbage-collection.md change the url to relative path. * update out-of-resource.md change "in cases when" to "in case that" * update out-of-resource.md use a shorter and simpler expression. * update out-of-resource.md change "support" to "supports" * Create a top-level CN directory to hold future md files for the Chinese kubernetes site * Removed `=` at the end of the flags. * Remove autogenerate todo - This should be captured via a GitHub issue and not a TODO in the README documentation which leads to confusion. * Move Guide topics: Federation Tasks. (#2799) * Move Guide topics: Federation tutorial and concept. (#2802) * Move Guide topics: Federation tutorial and concept. * Add title. * Fix link. * Move kubectl Concept topics to Tutorials. (#2804) * Move kubectl Concept topics to Tutorials. * Add redirects and update links. * The calendarWrapper attribute should be unique Signed-off-by: yupengzte <yu.peng36@zte.com.cn> * Fix links. (#2808) * Fix link. (#2806) * Move topic from clusters to cluster-administration. (#2812) * Move a batch of cluster admin topics. (#2813) * Move Guide topic: Limit storage consumption. (#2814) * Move Guide topic: Limit storage consumption. * Add title. * Move Guide topic: Networking. (#2816) * Move Guide topic: Network Plugins. (#2819) * Move Guide topic: Network Plugins. * Fix link. * Move Guide topic: Static Pods. (#2820) * User Guide content migration: post notice (#2818) * Add User Guide content migration notice. * Fix formatting * Tweek formatting to block highlight text in light gray. * Try table instead of code block * remove extra lines * try table format * fix links * incorporate @ddonnelly feedback * Move Guide topic: Out of Resource. (#2821) * Move Guide topic: Monitoring Node Health. (#2822) * Move Guide topic: Monitoring Node Health. * Move to Tasks. * Move Guide topic: AppArmor. (#2823) * Apparmor (#2825) * Move Guide topic: AppArmor. * Add included files. * Move Guide topic: Audit. (#2824) * Added 1.6 Upgrade notes to outline changes for etcd 3. * Move Guide topic: Disruption Budget. (#2834) * Move Guide topic: Limit range. (#2835) * Quota (#2836) * Move Guide topic: Limit range. * Move Guide topic: Resource Quota and Limits. * Quota2 (#2838) * Move Guide topic: Limit range. * Move Guide topic: Resource Quota concept. * Dns (#2839) * Move Guide topic: Limit range. * Move Guide topic: DNS. * Delete CNAME * Create CNAME * Delete CNAME * Create CNAME * Move docs/user-guide/managing-deployments.md to /docs/concepts/cluster-administration/manage-deployment.md * add nginx-app.yaml file * add back missing / * fix link * Move Guide topic: Replication Controller Operations * Move Guide topic: Resizing a replication controller * Concepts toc (#2840) * Move Guide topic: Limit range. * Adjust Concepts Overview TOC. * Move Guide topic: Rolling Updates * Move Kubernetes API page. (#2849) * Move What is Kubernetes topic. (#2851) * Move Guide topic: Rolling Update Demo (#2850) * Move Guide topic: Rolling Update Demo * rename file * Move Guide topic: Configuration Best Practices * Move Guide topic: Jobs (#2853) * Move Guide topic: Jobs * add job.yaml file * change title * Move Pod overview. (#2865) * Move Pod overview. * Fix redirection. * Move Guide topic: Parallel Processing using Expansions (#2867) * Move Guide topic: Parallel Processing using Expansions * fix links to /docs/user-guide/jobs/ * Move Init Containers topic. (#2866) * Move Guide topic: Coarse Parallel Processing Using a Work Queue * Move Guide topic: Fine Parallel Processing using a Work Queue (#2870) * Move Guide topic: Fine Parallel Processing using a Work Queue * add migration notice * fixed capitalization * Rename /docs/tasks/job/work-queue-1/ * Move StatefulSets topic. (#2869) * Move StatefulSets topic. * Fix TOC. * Move Guide topic: Pod Templates (#2872) * Move Guide topic: Pod Templates * tweak header level and capitalization * Move PetSets topic. (#2873) * Move Garbage Collection topic. (#2874) * Move Garbage Collection topic. * Fix included file. * Move Guide topic: Prereqs * Move Guide topic: Sharing Clusters * Move Accessing Clusters topic to Concepts. (#2875) * Move Accessing Clusters topic to Concepts. * Update concepts.yml * Move Guide topic: Kubeconfig File * Move Guide topic: Config Provider Firewalls. (#2883) * Move Guide topic: Federation Service Discovery. (#2884) * Move Guide topic: Connecting Apps with Services. (#2885) * Added example and docu for hostPort ranges * Move Guide topic: Service. (#2891) * Move Guide topic: Service. * Move Guide topic: External Load Balancer. * Fix TOC. * Move Guide topic: Resource Monitoring. (#2895) * docs/admin: document OpenID Connect plugin's claim prefixing * Move Guide topic: Admin Guide * fix the command output fix the command output * Update manage-compute-resources-container.md Change "he" to "The" * update out-of-resource.md change "thresholds" to "threshold" * update init-containers.md change "apply" to "application" * amend monitor-node-health.md Amend the url link. * Fix monitor-node-health.md The url link does not exist. * fix a typo in /docs/user-guide/configmap/index.md change "value" to "values" * View $PAGE on Github without forking the repo Adding a "View docs/bla-bla.md on GitHub" button next to the "Edit docs/bla-bla.md" button so that people can view the file first without clicking the Edit button (which does not work without forking the repository). I did not need this because I was trying to do something without forking. I just found it to be bit difficult to view source of a page on GitHub. I'm open to ideas, perhaps we can instead add an article footer button named "View on GitHub" next to the "Edit this Page". Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com> * Move Guide topics: Container Lifestyle Hooks, Images, Volumes * fix to taint the master node * Add files via upload * fix the link of ogging-elasticsearch-kibana.md fix the link of url * Remove from TOC/Search: pods/init-containers ... (#2694) * Fix typo * Add files via upload * Create hyperlink Create hyperlink for kubernetes repo link. * updated PSP documentation with RBAC (#2552) Added info about controller manager setup and current implementation when using PSP with RBAC support. * Use kubectl config current-context to simplify the instructions * fix typeo (#2856) * fix typeo * Update kargo.md * Fix typo in kubectl_completion.md evaluation --> evaluated * Apply typo fixes from #2791 (#2949) * Apply typo fixes from #2791 * remove style typos * Fix the typos Signed-off-by: yupengzte <yu.peng36@zte.com.cn> * Fix typo * Fix typo (#2842)
7.1 KiB
title
| title |
|---|
| Installing Kubernetes on AWS with kops |
Overview
This quickstart shows you how to easily install a Kubernetes cluster on AWS.
It uses a tool called kops.
kops is an opinionated provisioning system:
- Fully automated installation
- Uses DNS to identify clusters
- Self-healing: everything runs in Auto-Scaling Groups
- Limited OS support (Debian preferred, Ubuntu 16.04 supported, early support for CentOS & RHEL)
- High-Availability support
- Can directly provision, or generate terraform manifests
If your opinions differ from these you may prefer to build your own cluster using kubeadm as a building block. kops builds on the kubeadm work.
Creating a cluster
(1/5) Install kops
Requirements
You must have kubectl installed in order for kops to work.
Installation
Download kops from the releases page (it is also easy to build from source):
On MacOS:
wget https://github.com/kubernetes/kops/releases/download/v1.4.1/kops-darwin-amd64
chmod +x kops-darwin-amd64
mv kops-darwin-amd64 /usr/local/bin/kops
On Linux:
wget https://github.com/kubernetes/kops/releases/download/v1.4.1/kops-linux-amd64
chmod +x kops-linux-amd64
mv kops-linux-amd64 /usr/local/bin/kops
(2/5) Create a route53 domain for your cluster
kops uses DNS for discovery, both inside the cluster and so that you can reach the kubernetes API server from clients.
kops has a strong opinion on the cluster name: it should be a valid DNS name. By doing so you will no longer get your clusters confused, you can share clusters with your colleagues unambiguously, and you can reach them without relying on remembering an IP address.
You can, and probably should, use subdomains to divide your clusters. As our example we will use
useast1.dev.example.com. The API server endpoint will then be api.useast1.dev.example.com.
A Route53 hosted zone can serve subdomains. Your hosted zone could be useast1.dev.example.com,
but also dev.example.com or even example.com. kops works with any of these, so typically
you choose for organization reasons (e.g. you are allowed to create records under dev.example.com,
but not under example.com).
Let's assume you're using dev.example.com as your hosted zone. You create that hosted zone using
the normal process, or
with a command such as aws route53 create-hosted-zone --name dev.example.com --caller-reference 1.
You must then set up your NS records in the parent domain, so that records in the domain will resolve. Here,
you would create NS records in example.com for dev. If it is a root domain name you would configure the NS
records at your domain registrar (e.g. example.com would need to be configured where you bought example.com).
This step is easy to mess up (it is the #1 cause of problems!) You can double-check that your cluster is configured correctly if you have the dig tool by running:
dig NS dev.example.com
You should see the 4 NS records that Route53 assigned your hosted zone.
(3/5) Create an S3 bucket to store your clusters state
kops lets you manage your clusters even after installation. To do this, it must keep track of the clusters that you have created, along with their configuration, the keys they are using etc. This information is stored in an S3 bucket. S3 permissions are used to control access to the bucket.
Multiple clusters can use the same S3 bucket, and you can share an S3 bucket between your colleagues that administer the same clusters - this is much easier than passing around kubecfg files. But anyone with access to the S3 bucket will have administrative access to all your clusters, so you don't want to share it beyond the operations team.
So typically you have one S3 bucket for each ops team (and often the name will correspond to the name of the hosted zone above!)
In our example, we chose dev.example.com as our hosted zone, so let's pick clusters.dev.example.com as
the S3 bucket name.
-
Export
AWS_PROFILE(if you need to select a profile for the AWS CLI to work) -
Create the S3 bucket using
aws s3 mb s3://clusters.dev.example.com -
You can
export KOPS_STATE_STORE=s3://clusters.dev.example.comand then kops will use this location by default. We suggest putting this in your bash profile or similar.
(4/5) Build your cluster configuration
Run "kops create cluster" to create your cluster configuration:
kops create cluster --zones=us-east-1c useast1.dev.example.com
kops will create the configuration for your cluster. Note that it only creates the configuration, it does
not actually create the cloud resources - you'll do that in the next step with a kops update cluster. This
give you an opportunity to review the configuration or change it.
It prints commands you can use to explore further:
- List your clusters with:
kops get cluster - Edit this cluster with:
kops edit cluster useast1.dev.example.com - Edit your node instance group:
kops edit ig --name=useast1.dev.example.com nodes - Edit your master instance group:
kops edit ig --name=useast1.dev.example.com master-us-east-1c
If this is your first time using kops, do spend a few minutes to try those out! An instance group is a set of instances, which will be registered as kubernetes nodes. On AWS this is implemented via auto-scaling-groups. You can have several instance groups, for example if you wanted nodes that are a mix of spot and on-demand instances, or GPU and non-GPU instances.
(5/5) Create the cluster in AWS
Run "kops update cluster" to create your cluster in AWS:
kops update cluster useast1.dev.example.com --yes
That takes a few seconds to run, but then your cluster will likely take a few minutes to actually be ready.
kops update cluster will be the tool you'll use whenever you change the configuration of your cluster; it
applies the changes you have made to the configuration to your cluster - reconfiguring AWS or kubernetes as needed.
For example, after you kops edit ig nodes, then kops update cluster --yes to apply your configuration, and
sometimes you will also have to kops rolling-update cluster to roll out the configuration immediately.
Without --yes, kops update cluster will show you a preview of what it is going to do. This is handy
for production clusters!
Explore other add-ons
See the list of add-ons to explore other add-ons, including tools for logging, monitoring, network policy, visualization & control of your Kubernetes cluster.
What's next
- Learn more about Kubernetes concepts and kubectl in Kubernetes 101.
- Learn about
kopsadvanced usage
Cleanup
- To delete you cluster:
kops delete cluster useast1.dev.example.com --yes
Feedback
- Slack Channel: #sig-aws has a lot of kops users
- GitHub Issues