mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-21 08:59:02 +01:00
readme now has instructions for basic kubectl operation testing. locals map used to aid in userdata
This commit is contained in:
@@ -6,6 +6,19 @@ This set of templates serves a few purposes. It:
|
||||
2. serves as the test infrastructure for CI on the project.
|
||||
3. provides a simple way to play with the Kubernetes cluster you create.
|
||||
|
||||
## testing with kubectl
|
||||
|
||||
Once converged, `kubeconfig` and `config-map-aws-auth.yml` should be in this directory.
|
||||
Ensure you have a recent version of `kubectl` on your PATH ([instructions here](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl))
|
||||
|
||||
```bash
|
||||
curl -o heptio-authenticator-aws https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/bin/darwin/amd64/heptio-authenticator-aws
|
||||
mv heptio-authenticator-aws ~/go/bin/
|
||||
kubectl apply -f examples/eks_test_fixture/config-map-aws-auth.yaml --kubeconfig examples/eks_test_fixture/kubeconfig
|
||||
# configmap "aws-auth" created
|
||||
kubectl get nodes --watch --kubeconfig examples/eks_test_fixture/kubeconfig
|
||||
```
|
||||
|
||||
## IAM Permissions
|
||||
|
||||
The following IAM policy is the minimum needed to execute the module from the test suite.
|
||||
|
||||
@@ -46,9 +46,9 @@ resource "random_string" "suffix" {
|
||||
special = false
|
||||
}
|
||||
|
||||
resource "local_file" "config" {
|
||||
resource "local_file" "kubeconfig" {
|
||||
content = "${module.eks.kubeconfig}"
|
||||
filename = "${path.module}/config"
|
||||
filename = "${path.module}/kubeconfig"
|
||||
}
|
||||
|
||||
resource "local_file" "config-map-aws-auth" {
|
||||
@@ -77,5 +77,5 @@ module "eks" {
|
||||
vpc_id = "${module.vpc.vpc_id}"
|
||||
workers_ami_id = "${data.aws_ami.eks_worker.id}"
|
||||
cluster_ingress_cidrs = ["${local.workstation_external_cidr}"]
|
||||
workers_instance_type = "t2.micro"
|
||||
workers_instance_type = "t2.small"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user