Coder Social home page Coder Social logo

oracle-oke-terraform's Introduction

Terraform Kubernetes cluster on Oracle Cloud

The repository contains the necessary Terraform configuration for creating a multi-node Kubernetes cluster on Oracle Cloud.

The repo is based on this article by Arnold Galovic.

Setup in a nutshell

  1. Get the following data from your Oracle Cloud account
    • User OCID
    • Tenancy OCID
    • Compartment OCID

    You can get these automatically, based on your OCI configuration, and export them as environment variables for Terraform to consume, using source scripts/oci_env.sh

  2. Initialise the Terraform working directory
    terraform init
  3. Execute a terraform apply
    terraform apply
  4. Once done, run source scripts/oci_env.sh to expose a few convenience bash wrapper functions. These functions are wrappers around oci commands, including generating kube config or create a bastion forwarding session.
  5. Create the kube config using oci_cluster_kubeconfig

    This command with generate a kubeconfig using the cluster APIs private IP and then replace it with 127.0.0.1 / localhost so that port-forwarding can be used.

  6. Run export KUBECONFIG="${HOME}/.kube/ociconfig" to set the kube config to the generated config
  7. Run oci_bastion_session_kube_api -v to create a bastion session (if one doesn't exist) and establish a port-forwarding session.

    I have noticed that if you create the session, the first ssh connection fails. Just re-run the script to connect.

  8. To verify cluster access, do a kubectl get nodes
  9. Enjoy

Useful queries

There are some useful oci wrapper commands in the scripts directory. You can run source scripts/oci_env.sh to expose a few convenience bash wrapper functions in the terminal.

References

oracle-oke-terraform's People

Contributors

lackerman avatar

Watchers

 avatar  avatar

Forkers

rajaps369

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.