cloudfoundry / cf-for-k8s

The open source deployment manifest for Cloud Foundry on Kubernetes
Apache License 2.0
300 stars 115 forks source link

The state of a deployed app differs between cf7 cli and Stratos app. #560

Open macevil opened 4 years ago

macevil commented 4 years ago

Describe the bug

The state of a deployed app differs between cf7 cli and Stratos app. See also https://github.com/cloudfoundry/stratos/issues/4741

To Reproduce*

Steps to reproduce the behavior:

  1. kapp Installation of cf-4-k8s like described here: https://github.com/cloudfoundry/cf-for-k8s/blob/develop/docs/getting-started-tutorial.md
  2. helm Installation of Stratos app: https://stratos.app/docs/deploy/kubernetes/helm-installation
  3. cf Installation of the spring-music sample app: https://github.com/cloudfoundry-samples/spring-music
  4. helm Installation of a postgres db: https://github.com/bitnami/charts/tree/master/bitnami/postgresql
image
cf7 app spring-music
Showing health and status for app spring-music in org cloudness / space java as johannes...

name:                spring-music
requested state:     started
isolation segment:   placeholder
last uploaded:       Mon 02 Nov 21:42:00 CET 2020
stack:
buildpacks:
isolation segment:   placeholder

type:           web
sidecars:
instances:      1/1
memory usage:   1024M
     state     since                  cpu    memory         disk      details
#0   running   2020-11-02T20:47:17Z   0.2%   243.1M of 1G   0 of 1G

type:           executable-jar
sidecars:
instances:      0/0
memory usage:   1024M
There are no running instances of this process.

type:           task
sidecars:
instances:      0/0
memory usage:   1024M
There are no running instances of this process.

Expected behavior

The app state is displayed correctly in both places.

Additional context

https://github.com/cloudfoundry/stratos/issues/4741

Deploy instructions

$ ./hack/generate-values.sh -d vcap.me > ${TMP_DIR}/cf-values.yml
$ cat << EOF >> ${TMP_DIR}/cf-values.yml
app_registry:
  hostname: https://index.docker.io/v1/
  repository_prefix: "<my_username>"
  username: "<my_username>"
  password: "<my_password>"

$ kapp deploy -a cf -f <(ytt -f config -f ${TMP_DIR}/cf-values.yml)

Cluster information

GKE Cluster 1.18.0-gke.1501

CLI versions

  1. ytt --version: 0.30.0
  2. kapp --version: 0.34.0
  3. kubectl version: Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.9-gke.1501", GitCommit:"9eccd76926a6de5029d61bd586d7d68fe13b545a", GitTreeState:"clean", BuildDate:"2020-10-07T18:19:12Z", GoVersion:"go1.13.15b4", Compiler:"gc", Platform:"linux/amd64"}
  4. cf version: 7.1.0+4c3168f9a.2020-09-09
cf-gitbot commented 4 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/175574198

The labels on this github issue will be updated when the story is started.

richard-cox commented 4 years ago

Stratos side we've spent some time investigating this. We've tested viewing apps in stratos pushed with cf cli v6 and v7 to KubeCF when it's in Deigo and Eirini modes and everything works as expected. Stratos still uses v2 of the api, we're waiting on v3 to be completed still. I'm hypothesising it's something to do with how cf-for-k8s handles v2 api requests.

davewalter commented 4 years ago

Thanks for the update @richard-cox. This sounds like an issue with the API endpoints that the CF API bundled into cf-for-k8s supports. We already have issue #540 open to improve the error message returned by the API for endpoints that are not supported by cf-for-k8s.

We'll leave this issue open to specifically track the incompatibility with Statos.

richard-cox commented 4 years ago

Just wanted to clarify, is this an issue with how cf-for-k8s uses the generic api bundle or with the generic cf api bundle included in cf-for-k8s itself? I'm just a bit concerned that the API, used by all, is now selectively dropping support for various v2 endpoints outside of the official deprecation plan (my understanding is that it's still in phase 0).

richard-cox commented 3 years ago

I've followed this up in slack (https://cloudfoundry.slack.com/archives/CH9LF6V1P/p1604655000088900). I'll try firing up an instance and investigate which endpoints are failing.

davewalter commented 3 years ago

Just wanted to clarify, is this an issue with how cf-for-k8s uses the generic api bundle or with the generic cf api bundle included in cf-for-k8s itself?

I think it is an issue with the CF API included in cf-for-k8s. IIRC, it was decided to not back-port support for K8s to some of the v2 endpoints that are no longer used by the CF CLI as of v7 since CF for K8s does not support the v6 CLI.

davewalter commented 3 years ago

We deployed v4.3.0 of Stratus and pushed spring-music to cf-for-k8s @ https://github.com/cloudfoundry/cf-for-k8s/commit/6819c2c36435090f9871dcfbbfb546cbd62448cd. Here is a screenshot of the app summary page:

Screen Shot 2020-11-11 at 10 51 46 AM

macevil commented 3 years ago

@davewalter can u plz check the Log Stream page