GithubHelp home page GithubHelp logo

capgemini / kubeform Goto Github PK

View Code? Open in Web Editor NEW
326.0 29.0 57.0 1.65 MB

Form your :boat: Kubernetes :anchor: cluster anywhere using CoreOS, Terraform and Ansible

Home Page: https://capgemini.github.io/kubeform

License: MIT License

HCL 3.11% Smarty 1.16% Shell 0.06% Python 95.68%
kubernetes

kubeform's Introduction

Kubeform

wercker status

Deploy yourself a high-availability Kubernetes cluster, in minutes. Built on Terraform, CoreOS and Ansible.

Our recipes for bootstrapping HA Kubernetes clusters on any cloud or on-premise.

Includes the following -

  • CoreOS as the base operating system
  • Kubernetes (in HA) mode (leader election using Podmaster)
  • SSL certs/security for Kubernetes cluster components
  • Flannel for networking
  • Kubernetes Dashboard
  • Sky/KubeDNS

and optionally -

  • Prometheus for cluster monitoring (coming soon!)
  • Fluentd, elasticsearch for cluster logging
  • Traefik as the ingress controller for the edge-routers. For configuring it to use letsencrypt you can edit this file.

See our Roadmap for future features and feel free to help us improve the project by contributing a Pull Request, or raise an issue if you run into trouble!

Getting started

Check out the instructions for provisioning on different clouds including:

Demo

Check out this demo deploying and scaling the backends for the ingress-controller on AWS and DigitalOcean

Keep up to date...

Check out the Capgemini UK Engineering blog to find out more about the stuff we do!

kubeform's People

Contributors

enxebre avatar fantomatic avatar tamsky avatar tayzlor avatar wallies avatar yossi-r 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

kubeform's Issues

Get kube-worker up properly and able to talk to the master

At the moment the service comes up but not yet properly. You cannot communicate back to the API server from the worker node. This is purely because that's as far as i've got testing for now.

This might be related to #11

The following error fills the logs -

Mar 15 13:19:49 k8s-worker-0 kubelet-wrapper[1483]: E0315 13:19:49.176393    1483 kubelet.go:1356] Failed creating a mirror pod "kube-proxy-k8s-worker-0_kube-system": Post http://46.101.30.214:8080/api/v1/namespaces/kube-system/pods: dial tcp 46.101.30.214:8080: connection refused
Mar 15 13:19:49 k8s-worker-0 kubelet-wrapper[1483]: E0315 13:19:49.176998    1483 kubelet.go:1361] Mirror pod not available

Seems like the API server isn't responding properly on it's publicly addressable URL - it only responds from localhost:8080 on the master node.

Kubelet - Can't get ip address of node k8s-worker-0, so node addresses will be stale

Following error -

Can't get ip address of node k8s-worker-0, so node addresses will be stale: lookup k8s-worker-0: no such host

This probably because all we have in /etc/hosts is

127.0.0.1 k8s-worker-0

So we need to take care of DNS better or update /etc/hosts with more config entries. You'll see a similar error across all nodes if you run journalctl -xef -u kubelet.

Create CLI

Proposal to create a CLI wrapper around creating/running/destroying kubeform clusters.
As an initial first pass this should support create and destroy.

We can potentially use this issue to hash out the details. Things to address -

Probably loads more stuff feel free to drop comments

Create a gh-pages docs site

Could do something similar to redux - use gitbook and publish via an npm script to the gh-pages branch (which will host on github.io)?

Support ingress

Would be good to have some out-of-the box options for Kubernetes Ingress controllers.

Ensure kubernetes api server certificates include correct dns_names

See https://coreos.com/kubernetes/docs/latest/openssl.html

pasting here

OpenSSL Config
This is a minimal openssl config which will be used when creating the api-server certificate. We need to create a configuration file since some of the options we need to use can’t be specified as flags. Create openssl.cnf on your local machine and replace the following values:

Replace ${K8S_SERVICE_IP}
Replace ${MASTER_HOST}
openssl.cnf

[req]
req_extensions = v3_req
distinguished_name = req_distinguished_name
[req_distinguished_name]
[ v3_req ]
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = kubernetes
DNS.2 = kubernetes.default
DNS.3 = kubernetes.default.svc
DNS.4 = kubernetes.default.svc.cluster.local
IP.1 = ${K8S_SERVICE_IP}
IP.2 = ${MASTER_HOST}
If deploying multiple master nodes in an HA configuration, you may need to add more TLS subjectAltNames (SANs). Proper configuration of SANs in each certificate depends on how worker nodes and kubectl users contact the master nodes: directly by IP address, via load balancer, or by resolving a DNS name.

Example:

DNS.5 = ${MASTER_DNS_NAME}
IP.3 = ${MASTER_IP}
IP.4 = ${MASTER_LOADBALANCER_IP}

Means we might need to set https://www.terraform.io/docs/providers/tls/r/self_signed_cert.html#dns_names

and https://www.terraform.io/docs/providers/tls/r/self_signed_cert.html#ip_addresses

when we create the certs

Move setup-network-environment.service to ansible

The below is current deployed by cloud config. Seems best to keep cloud config fairly light-touch and move this to ansible if we can to live in a 'common' role or somewhere near network related code (when we also move flannel).

name: setup-network-environment.service
      command: start
      content: |
        [Unit]
        Description=Setup Network Environment
        Documentation=https://github.com/kelseyhightower/setup-network-environment
        Requires=network-online.target
        After=network-online.target

        [Service]
        ExecStartPre=-/usr/bin/mkdir -p /opt/bin
        ExecStartPre=/usr/bin/curl -L -o /opt/bin/setup-network-environment -z /opt/bin/setup-network-environment https://github.com/kelseyhightower/setup-network-environment/releases/download/v1.0.0/setup-network-environment
        ExecStartPre=/usr/bin/chmod +x /opt/bin/setup-network-environment
        ExecStart=/opt/bin/setup-network-environment
        RemainAfterExit=yes
        Type=oneshot

Add docs for addons/dashboard

Some docs required for the kubernetes dashboard

  • how to access it
  • firewall rules (if exposing externally)
  • how to set up ingress for it etc..

kubelet on master displaying error about kube-system manifest

journalctl -xef -u kubelet (on any master node)

ile.go:123] Can't process config file "/etc/kubernetes/manifests/kube-system.yaml": /etc/kubernetes/manifests/kube-system.yaml: read 'apiVersion: v1
May 05 13:46:37 ip-10-0-1-60.eu-west-1.compute.internal kubelet-wrapper[20425]: kind: Namespace
May 05 13:46:37 ip-10-0-1-60.eu-west-1.compute.internal kubelet-wrapper[20425]: metadata:
May 05 13:46:37 ip-10-0-1-60.eu-west-1.compute.internal kubelet-wrapper[20425]: name: kube-system
May 05 13:46:37 ip-10-0-1-60.eu-west-1.compute.internal kubelet-wrapper[20425]: ', but couldn't parse as pod(invalid pod: &{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:kube-system GenerateName: Namespace: SelfLink: UID: ResourceVersion: Generation:0 CreationTimestamp:0001-01-01 00:00:00 +0000 UTC DeletionTimestamp:<nil> DeletionGracePeriodSeconds:<nil> Labels:map[] Annotations:map[]} Spec:{Finalizers:[]} Status:{Phase:Active}}).
May 05 13:46:57 ip-10-0-1-60.eu-west-1.compute.internal kubelet-wrapper[20425]: I0505 12:46:57.077822```

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.