-
Notifications
You must be signed in to change notification settings - Fork 2
kubernetes container manager #41
base: master
Are you sure you want to change the base?
Conversation
|
Hey MHBauer! Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you and the commit authors have already signed the CLA. |
|
rebased on #40 and split into two commits I suggest looking at gopkg.toml for the dep changes, and the second commit for the actual code changes so far. |
cmd/broker/main.go
Outdated
| var manager containermanager.ContainerManager | ||
|
|
||
| manager := docker.NewDockerContainerManager(logger, cli) | ||
| if cli, err := client.NewEnvClient(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make it configurable in the config file to choose the underlying engine to run the broker.
We can have smoething like "engine": "docker" or "engine": "kubernetes" in the config file and decide on what to use based on what the property is set to. defaulting to docker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in #52!
|
this is now super tiny with #52 in. yay. |
|
works e2e as demonstrated today. needs rebase. |
| Args []string `json:"args"` | ||
| }{ | ||
| Provider: fmt.Sprintf("http://%s:%s", containerInfo.InternalAddress, portBindings[0].Port), | ||
| Provider: fmt.Sprintf("http://%s:%s", containerInfo.InternalAddress, "8545"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is an important distinction and maybe our struct needs to have internalPortmap and externalPortmap
| @@ -1,4 +1,4 @@ | |||
| # client-go | |||
| re# client-go | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops
| if err != nil { | ||
| return nil, err | ||
| } | ||
| e.logger.Debug(fmt.Sprintf("%++v", config)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is helpful to see that the config was wrong
| defer os.RemoveAll(outputFile.Name()) | ||
|
|
||
| cmd := exec.Command("node", e.deployerPath, "-c", configFile.Name(), "-o", outputFile.Name(), contractInfo.ContractPath) | ||
| e.logger.Debug(fmt.Sprintf("%++v", cmd)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is heplful to see what the cmd looks like before it gets run. make sure all the args are present.
| func NewKubernetesContainerManager(logger lager.Logger, client kubernetes.Interface, host string) containermanager.ContainerManager { | ||
| return kubernetesContainerManager{ | ||
| client: client, | ||
| host: host, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
external address from config. maybe needs to be renamed
| @@ -0,0 +1,26 @@ | |||
| kind: ConfigMap | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused for now
| subjects: | ||
| - kind: ServiceAccount | ||
| name: default | ||
| namespace: default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be set to be more restrictive.
create pods and svc
delete pods and svc
| @@ -0,0 +1,45 @@ | |||
| --- | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for screwing around with ingress
| @@ -0,0 +1,16 @@ | |||
| apiVersion: extensions/v1beta1 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useful if you want to have the broker have a clean URL.
| spec: | ||
| ports: | ||
| - port: 3333 | ||
| nodePort: 30000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardcoded for ease of repros for now.
| "port": 3333, | ||
| "deployer_path":"/pusher.js", | ||
| "container_manager": "kubernetes", | ||
| "external_address": "peanuts.sng01.containers.appdomain.cloud" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
edit this line with your load-balancer DNS or ip of worker node.
|
squashed, but https://github.com/cloudfoundry-incubator/blockhead/pull/41/files#r223473358 needs resolution |
| @@ -0,0 +1,26 @@ | |||
| kind: ConfigMap | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be considered incomplete work. If we want to avoid hardcoding the config directly into the image, this needs to be loaded by changing the configuration in k8s/deploy.yaml
We can save this file into an issue and put it off to be done later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the biggest thing is that it would avoid changes to services/eth.json while also risking it becoming out of sync.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good. will create a chore to track this
|
linked appropriately |
comments on how to ingress nodeport service config bind remove ingress static build so I don't have to worry about running things also it's smaller might as well be a nodeport comments on what things are use of config configmap for config info for k8s backend configmap can't be mounted at root, as it will overwrite whole FS mount under subdir and adjust command to load config from that directory pusher config and correct slice temporarily change return values maybe mount service definitions as well fixup rebase changes start of instructions more instructions more instructions and try and make it work again internal binding for internal address missing test file specific rbac prepend an arbitrary character before service use of instance id B, for Blockhead!
Resolves #9
Resolves #66
Resolves #67
PoC on start of containermanager to get the deps right. For #9
not intended to merge yet, want to hold the deps so it's shown.