projectriff-archive / cnab-k8s-installer-base

A CNAB bundle that allows creation of other declarative CNAB bundles
Apache License 2.0
0 stars 6 forks source link

handle new docker-desktop name #42

Closed sbawaska closed 5 years ago

sbawaska commented 5 years ago

replaces #37 by fixing unit test failures. Also, replace the master server URL for docker desktop from localhost to host.docker.internal so that it can be discovered from within the container executing CNAB install

closes #39.

codecov[bot] commented 5 years ago

Codecov Report

Merging #42 into master will increase coverage by 0.41%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   86.03%   86.44%   +0.41%     
==========================================
  Files          13       13              
  Lines         580      583       +3     
==========================================
+ Hits          499      504       +5     
+ Misses         54       53       -1     
+ Partials       27       26       -1
Impacted Files Coverage Δ
pkg/kab/patch_manifest.go 88.05% <100%> (+3.68%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 830de84...471ac6e. Read the comment docs.

sbawaska commented 5 years ago

I tried to come up with instructions first, but there is no good way to simplify the steps. The problem is outlined here: https://github.com/projectriff/cnab-k8s-installer-base/issues/39#issuecomment-498382850 To make the cnab install work on docker-desktop, users will have to

  1. change ~/.kube/config to replace localhost with host.docker.internal
  2. run duffle install
  3. change back host.docker.internal to localhost in ~/.kube/config otherwise kubectl will not work ( since host.docker.internal is not resolvable from the host itself).

Then repeat the same steps for uninstall.

Also, if the user has watch kubectl get pods --all-namespaces running during install (as we have documented previously) that will now break, since ~/.kube/config is pointing at host.docker.internal which is not resolvable from host.

If the user misses any of the steps outlined, they are going to have problems installing OR running kubectl after install. I feel that the above prescriptive flow for our users is more brittle than us trying to patch kubeconfig.

scothis commented 5 years ago

To make the cnab install work on docker-desktop, users will have to

Yea, we don't want users to manually edit the kube config.

We can do better by either:

We can figure out what the right balance of config options.

scothis commented 5 years ago

Another option, run the invocation image inside the k8s cluster. This way we don’t need a local docker daemon.

glyn commented 5 years ago

How does the CNAB community manage k8s configurations? I have to imagine the Docker folks have solved this.

I'm investigating this.

glyn commented 5 years ago

docker-app patches the kube config for docker desktop when creating a CNAB from a docker application package. However, they hit the same problem as duffle when using an CNAB which has not undergone this patching.

sbawaska commented 5 years ago

We now run the invocationImage in cluster, hence this is not longer applicable.