- create a simple service
- expose stable address
- expose through Env var and DNS
- services should be created b4 client pods for th8 service
- service name is hostname for service apart from IP, which is maintained in DNS server pod in
kube-system
namespace - Expose/Impose the external machines to Cluster and make them available to pods in the cluster -> 1) create service without selector and create Endpoints resource with external IPs. now Pods can access out of cluster nodes throough that service.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"time" | |
) | |
func main() { | |
queue := NewQueue("amqp://guest:guest@localhost:5672/", "hello") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wget -i this_file | |
http://www.oreilly.com/programming/free/files/files/microservices-for-java-developers.pdf | |
http://www.oreilly.com/programming/free/files/modern-java-ee-design-patterns.pdf | |
http://www.oreilly.com/programming/free/files/object-oriented-vs-functional-programming.pdf | |
http://www.oreilly.com/programming/free/files/java-the-legend.pdf | |
http://www.oreilly.com/programming/free/files/functional-programming-python.pdf | |
http://www.oreilly.com/programming/free/files/reactive-microservices-architecture-orm.pdf | |
http://www.oreilly.com/programming/free/files/migrating-cloud-native-application-architectures.pdf | |
http://www.oreilly.com/programming/free/files/software-architecture-patterns.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Logger struct { | |
Prop1 string | |
Prop2 string | |
} | |
type Option func(l *Logger) error | |
func Prop1Option() Option { | |
return func(l *Logger) error { | |
l.Prop1 = "hello" |
Getting started:
Related tutorials:
Main/Summary points of Go for Industrial Programming, Video
- Do not decide your project Structure at the very end, it evolves!
- Make configuration based sysytem, and flags are the best way to change the behaviour of your syetem function.
- Manage goroutines lifecycle, thy are prone to leak,
Always think of how this gorouting will finish/interrupt
. Always try to pass some sort of interrupt func/context to interrupt e.g.func foo(execFunc func(...args interface{}) error, interupptFunc func() error)
or listening to context.Done - Use interface at the consumer side not at the implementation package, interfaces are really good to mock the dependencies.
- Must watch, Advanced Testing with go
- Do not misuse context, make context Value only request scoped like request ID for DT or au
- When you use a bind mount, a file or directory on the host machine is mounted into a container. The file or directory is referenced by its full or relative path on the host machine. By contrast, when you use a volume, a new directory is created within Docker’s storage directory on the host machine, and Docker manages that directory’s contents.
- The file or directory does not need to exist on the Docker host already. It is created on demand if it does not yet exist.
- Both allow sharing contents amoung containers
- Prepopulated contents obsucured in case of Bind Mount while Volume sync the contents from containers to Docker host.
- Bind Propagation exixt only in Bind Mount.
- Unlike a bind mount, you can create and manage volumes outside the scope of any container.
- Create a volume:
$ docker volume create my-vol
- Create a volume:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase --interactive HEAD~2 | |
# we are going to squash c into b | |
pick b76d157 b | |
pick a931ac7 c | |
# squash c into b | |
pick b76d157 b | |
s a931ac7 c |
Install Zsh using OhMyZsh https://github.com/robbyrussell/oh-my-zsh
For setting default user - ohmyzsh/ohmyzsh#2033 to remove the user and computer name on command prompt.
set DEFAULT_USER=whoami
with backquotes around whoami
Choose theme - agnoster
Install Plugins
git, golan, kubectl, sudo, docker, docker-compose, iterm2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pattern to start all go routines only after all are created. | |
func goRoutine() { | |
<-start | |
// do whatever | |
} | |
func main() { | |
start := make(chan, struct{}) |