Code Monkey home page Code Monkey logo

fun-with-concourse's Introduction

Please note this project is just a spike to play a bit around with concourse, a simple node app on AWS and k8s.

It might not follow all security regulations, please use it on your own risk.

Concourse:

fly -t test set-pipeline --load-vars-from credentials.yml -p smoke -c pipeline.yml

AWS & k8s

create a bucket

aws s3api create-bucket \ --bucket kops-k8s-de-state-store \ --region eu-central-1 \ --create-bucket-configuration LocationConstraint=eu-central-1

aws s3api put-bucket-versioning --bucket kops-k8s-de-state-store --versioning-configuration Status=Enabled

access the dashboard ui at any time

run kubectl proxy and call ${URL_AND_PORT}/ui in the browser

creating cluster with public topology

export NAME=myfirstprivatecluster.kops-k8s.de export KOPS_STATE_STORE=s3://kops-k8s-de-state-store

kops create cluster \ --zones us-west-2a \ --ssh-public-key ~/.ssh/kops-k8s.pub \ --alsologtostderr \ --log_dir ~/projects/kops/logs \ ${NAME}

create cluster with private topology, bastion and no public ip

kops create cluster --node-count 3 --zones eu-central-1a,eu-central-1b,eu-central-1c --master-zones eu-central-1a --topology private --networking weave --node-size t2.medium --master-size t2.large --associate-public-ip=false --bastion=true --authorization RBAC --ssh-public-key ~/.ssh/id_rsa.pub ${NAME}

kops update cluster --yes ${NAME}

install tiller and init helm

helm init kubectl create serviceaccount --namespace kube-system tiller kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' helm install stable/concourse

access concourse locally

export POD_NAME=$(kubectl get pods --namespace default -l "app=knobby-tiger-web" -o jsonpath="{.items[0].metadata.name}") kubectl port-forward --namespace default $POD_NAME 8080:8080

access k8s dashboard locally

kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml kubectl create -f dashboard-admin.yaml //you can get this yaml file in fun-with-concourse repo kubectl proxy

create service account for concourse to access kubernetes from pipeline

kubectl create serviceaccount concourse kubectl get serviceaccounts concourse -o yaml

create role and role binding to give concourse user the specific rights to deploy pods.

kubectl create -f deployer-role.yaml kubectl create -f deployer-role-binding.yaml

after deployment, you can access the app by port forwarding like a superstar:

kubectl port-forward pod-name 3000:3000

install nginx ingress to acess services from outside

helm install --name nginx-ingress1 stable/nginx-ingress --set rbac.create=true

wait for the pods and services to be ready and create the ingress for the service with the following command:

kubectl apply -f fun-ingress.yaml

wait again for the route to be avaiable and reach it.
HURRAAYYYYYYYYYYY!

fun-with-concourse's People

Contributors

mshahidaslam avatar zariye avatar

Watchers

 avatar  avatar  avatar

Forkers

mshahidaslam

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.