페이지

2021년 4월 2일 금요일

Types of Services

 Cluster IP => Set up an easy-to-remember URL to access a pod. 

                   Only exposes pods in the cluster


Node Port => Makes a pod accessible from outside the cluster.

                   Usually only used for dev purposes


Load Balancer =>  Makes a pod accessible from outside the cluster. 

                         This is the right way to expose a pod to the outside world


External Name => Redirects an in-cluster request to a CNAME url...


_______________________________________________________________________________________


Load Balancer Service =>  Tells Kubernetes to reach out to its provider

                                   and provision a load balancer. 

                                  Gets traffic in to a single pod


Ingress or Ingress Controller => 

A pod with a set of routing rules to distribute traffic to other services

2021년 3월 27일 토요일

Kubernetes Config Files

 1. Thells Kubernetes about the different Deployments, Pods, and Services 
(referred to as 'Objects') that we want to create

 


2. Written in YAML syntax


3. Always store these files with our project source code - they are documentation!


4. We can create Objects without config files - do not do this. Config files 

provide a precise definition of what your cluster is running.


 Install MiniKube (https://kubernetes.io/docs/tasks/tools/install-minikube/)

minikube start


kubectl version


kubectl get all


kubectl apply -f first-pod.yaml


kubectl get all


minikube ip


kubectl describe pod webapp


kubectl exec webapp ls


kubectl -it exec webapp sh

wget http://localhost:80


cat index.html








kubernetes

 Kubernetes Cluster       => A collections of nodes + a master to manage them

 Node                        => A virtual machine that will run our containers

Pod                           => More or less a running container.

                                     Technically, a pod can run multiple containers

                                     (we won't do this)

Deployment                => Monitors a set of pods, make sure they are running

                                    and restarts them if they crash

Service                      => Provides an easy-to-remember URL to access 

                                    a running container


 



2021년 3월 26일 금요일

node js building docker

 FROM                  node:alpine       => Specify base image

 WORKDIR             /app                => Set the working directory to '/app' in the                                                                  container. All following commands will be 

                                                      issued relative to this dir

 COPY                   package.json ./   => Copy over only the package.json file

 RUN                    npm install        => Install all dependencies

 COPY                   ./ ./                 => Copy over all of our remaining source code

 CMD                    ["npm", "start"]  => Set the command to run when the container

                                                      starts up


Dockerfile


FROM node:alpine


WORKDIR /app

COPY package.json ./

RUN npm install

COPY ./ ./


CMD ["npm", "start"]




.dockerignore


node_modules


docker build .


Successfully built eb521ea6b7e6


docker run eb521ea6b7e6

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


docker build -t abcdefg/efgh .            => Build an image based on the dockerfile in the 

                                                        current directory. Tag it as 'abcdefg/efgh'

docker run [image id or image tag]     => Create and start a container based on the

                                                        provided image id or tag

docker run -it [image id or image tag] [cmd] => Create and start container, but also

                                                                override the default command

docker ps                                    => Print out information about all of the 

                                                      running containers

docker exec -it [container id] [cmd]    => Execute the given command in a running 

                                                      container

docker logs [container id]                => Print out logs from the given container








         


2020년 6월 20일 토요일

Local Environment Setup

* If you are still willing to set up your environment for Go programming language, you need the following software available on your computer:
- A text editor
- Go compiler

The source code written in source file is the human readable source for your program. It needs to be compiled and turned into machine language so that your CPU can actually execute the program as per the instructions given. The Go programming language compiler compiles the source code into its final executable program.

Go distribution comes as a binary installable for FreeBSD(release 8 and above), Linux, Mac OS X(Snow Leopard and above), and Windows operating systems with 32-bit(386) and 64-bit(amd64) x86 processor architectures.
The following section explains how to install Go binary distribution on various OS.


- Download Go Archive
Download the latest version of Go installable archive file from Go Downloads. The following version is used in this tutorial: go1.4.windows-and64.msi.

it is copied it into C:\>go folder.

Installation on UNIX/Linux/Mac OS X, and FreeBSD
Extract the download archive into the folder /usr/local, createing a Go tree in
/usr/local/go. For example:
tar -C /user/local -xzf go1.4.linux-amd64.tar.gz
Add /usr/local/go/bin to the PATH environment variable.


export PATH=$PATH:/usr/local/go/bin






 





2020년 6월 19일 금요일

Try it Option Online

* You really do not need to set up your own environment to start learning Go programming language. Reason is very simple, we already have set up Go Programming environment online, so that you can compile and execute all the available examples online at the same time when you are doing your theory work.

* This gives you confidence in what you are reading and to check the result with different options. Feel free to modify any example and execute it online.

Try the following example using the Try it option available at the top right corner of the following sample code displayed on our website:

package main

import "fmt"

func main() {fmt.Println("Hello, World!")
}

For most of the examples given in this tutorial, you will find a Try it option.