Giter VIP home page Giter VIP logo

terraform-eks's Introduction

Terraform module for simplified management of Kubernetes servers using EKS

Software License Donate

🔆 Highlights

  • EKS Cluster AWS managed Kubernetes cluster of master servers
  • AutoScaling Group contains 2 m4.large instances based on the latest EKS Amazon Linux 2 AMI
  • Associated VPC, Internet Gateway, Security Groups, and Subnets Operator managed networking resources for the EKS Cluster and worker node instances
  • Associated IAM Roles and Policies Operator managed access resources for EKS and worker node instances

🎨 Architecture

🔰Getting Started

Follow the steps below to get started

🔨 Setting Up Kubectl

Create a kubeconfig file for manging the EKS Cluster.

Login to your kubectl node and insert the codeblock to .kube/config

apiVersion: v1
clusters:
- cluster:
    server: EKS_ENDPOINT_URL
    certificate-authority-data: BASE64_ENCODED_CA_CERT   
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: aws
  name: aws
current-context: aws
kind: Config
preferences: {}
users:
- name: aws
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      command: heptio-authenticator-aws
      args:
        - "token"
        - "-i"
        - "CLUSTER_NAME"
        - "-r"
        - ""

Replace EKS_ENDPOINT_URL with your EKS Endpoint URL, BASE64_ENCODED_CA_CERT with certificateAuthority and CLUSTER_NAME with EKS Cluster name.

Save the configuration file and execute following commands to use it.

export KUBECONFIG=$KUBECONFIG:~/.kube/config

echo 'export KUBECONFIG=$KUBECONFIG:~/.kube/config' >> ~/.bashrc

Now test your configuration

kubectl get all

If everything is fine, you will get your cluster details :)

📚Refrence :

👬 Contribution

  • Open pull request with improvements

  • Discuss ideas in issues

  • Reach out with any feedback Twitter URL

terraform-eks's People

Contributors

anmolnagpal avatar slikk66 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

terraform-eks's Issues

terraform plan raw output

root@CPX-KLK3T0TNPT9:/home/ubuntu/Downloads/terraform-eks# terraform plan -out=plan.tr

Error: Unsupported block type

on cluster.tf line 19, in resource "aws_security_group" "eks-cluster":
19: tags {

Blocks of type "tags" are not expected here. Did you mean to define argument
"tags"? If so, use the equals sign to assign it a value.

Error: Unsupported block type

on main.tf line 55, in resource "aws_internet_gateway" "igw":
55: tags {

Blocks of type "tags" are not expected here. Did you mean to define argument
"tags"? If so, use the equals sign to assign it a value.

Error: Error in function call

on main.tf line 64, in resource "aws_key_pair" "eks-prod-key":
64: public_key = "${file("./it-admin-key.pub")}"

Call to function "file" failed: no file exists at it-admin-key.pub.

root@CPX-KLK3T0TNPT9:/home/ubuntu/Downloads/terraform-eks# terraform --version
Terraform v0.12.5

  • provider.aws v2.20.0
  • provider.http v1.1.1

/terraform-eks# kubens hola-mundo-naranja
Context "arn:aws:eks:us-east-1:947293917990:cluster/regulado-develop-eks" modified.
Active namespace is "hola-mundo-naranja".
root@CPX-KLK3T0TNPT9:/home/ubuntu/Downloads/terraform-eks# kubectl get all
NAME READY STATUS RESTARTS AGE
pod/hello-world-5fdc9bc659-48c99 1/1 Running 0 21d
pod/hello-world-5fdc9bc659-6q7kl 1/1 Running 0 21d
pod/hello-world-5fdc9bc659-pvxpb 1/1 Running 0 21d
pod/hello-world-5fdc9bc659-zvw6v 1/1 Running 0 21d
pod/hello-world-5fdc9bc659-zxhnl 1/1 Running 0 21d
pod/tuservicio-594495857f-hcq59 1/1 Running 0 21d

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/my-service LoadBalancer 10.100.19.245 8080:32628/TCP 21d

NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/hello-world 5 5 5 5 21d
deployment.apps/tuservicio 1 1 1 1 21d

NAME DESIRED CURRENT READY AGE
replicaset.apps/hello-world-5fdc9bc659 5 5 5 21d
replicaset.apps/tuservicio-594495857f 1 1 1 21d

root@CPX-KLK3T0TNPT9:/home/ubuntu/Downloads/terraform-eks#
root@CPX-KLK3T0TNPT9:/home/ubuntu/Downloads/terraform-eks# aws s3 ls
2019-07-24 09:57:09 elasticbeanstalk-us-east-1-947293917990
2019-07-02 16:18:45 fin-reg-develop-public
2019-06-11 16:37:37 terraform-regulado-devops
root@CPX-KLK3T0TNPT9:/home/ubuntu/Downloads/terraform-eks#

cluster.tf -- Incorrect attribute value type

terraform plan -out=plan.tr

provider.aws.region
The region where AWS operations will take place. Examples
are us-east-1, us-west-2, etc.

Enter a value: us-east-1

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.

data.aws_region.current: Refreshing state...
data.aws_availability_zones.available: Refreshing state...


Error: Incorrect attribute value type

on cluster.tf line 52, in resource "aws_eks_cluster" "eks-cluster":
52: subnet_ids = [

Inappropriate value for attribute "subnet_ids": element 0: string required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.