Does anyone have a build.gradle file from a working 3.9 data-service?

Have you tried Kind? We switched from Minikube to Kind a while back. Not saying we don’t support Minikube, but Kind became our default go to solution in 3.8 - we have an announcement about it here Kind vs Minikube Support if you want to read more.

And for kind - https://kind.sigs.k8s.io/

skaffold build succedes with kind context :smiley::+1:

1 Like

I am now getting this error from the service registry pod

Failed to pull image "docker-group.leidos-leaf.com/service-registry:3.3.0-dev.1": rpc error: code = Unknown desc = failed to pull and unpack image "docker-group.leidos-leaf.com/service-registry:3.3.0-dev.1": failed to resolve reference "docker-group.leidos-leaf.com/service-registry:3.3.0-dev.1": pulling from host docker-group.leidos-leaf.com failed with status code [manifests 3.3.0-dev.1]: 401 Unauthorized

That’s happening because the cluster doesn’t have the credentials to pull from the LEAF Nexus (as shown by the 401 error code).

You’ll have to create a docker registry secret in Kubernetes.

How are you deploying service-registry? If you are using leafctl, then adding the -i flag will create the registry secret for you in the namespace that service-registry is being deployed in.

leafctl deploy service-registry -i

Side note: You are using an old and developmental version of the service registry. I would recommend you use the one closest to your LFS version.

What version of LFS are you using?

what is LFS, and how do I check the version?

LFS stands for LEAF Framework Services. Look for frameworkVersion in your build.gradle, it’s the version of the LEAF Framework Library that the application will use. In the example build.gradle above, it has:

leaf {
    frameworkVersion = "3.9.0"
    platformVersion = "3.9.0"
...

I’ve been setting that to 3.9.0 as part of this update. What service registry version should I use to match?

Ok, I’d recommend using docker-group.leidos-leaf.com/service-registry:3.9.0

I get Error: failed to download "leidos-leaf/service-registry" at version "3.9.0" when I try to run leafctl deploy service-registry -i -v 3.9.0

Do you have the helm repositories added? I would recommend running leafctl credentials -A and use your LEAF workspace credentials. Then run helm repo list and make sure that leidos-leaf is there.

I think I’m able to hit the leidos-leaf repo, is that the right url?

Creating Kubernetes secret in default Namespace...
secret/service-registry-regcred created
Checking for leidos-leaf Helm chart...
leidos-leaf             https://repo.leidos-leaf.com/repository/leidos-helm/                       
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "bitnami" chart repository (https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami):
        Get "https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami/index.yaml": unexpected EOF
...Successfully got an update from the "falcon" chart repository
...Successfully got an update from the "prometheus-community" chart repository
...Successfully got an update from the "leidos" chart repository
...Successfully got an update from the "leidos-leaf" chart repository
Update Complete. ⎈Happy Helming!⎈
Deploying LEAF Service Registry...
Release "service-registry" does not exist. Installing it now.
Error: failed to download "leidos-leaf/service-registry" at version "3.9.0"

Ok, I misunderstood the error. The -v flag modifies the version of the helm path, not the docker image. If you are on 3.9.0 of leafctl, then it should deploy the 3.9.0 tag of Service Registry. Try again without the -v flag. You can also add -r flag at the end to do a dry run to ensure that everything looks correct.

leafctl deploy service-registry -ir

Remove the -r flag when you think it looks ready.

Now the pod gives this error message

Failed to pull image "docker-group.leidos-leaf.com/service-registry:3.9.0": rpc error: code = Unknown desc = failed to pull and unpack image "docker-group.leidos-leaf.com/service-registry:3.9.0": failed to resolve reference "docker-group.leidos-leaf.com/service-registry:3.9.0": pulling from host docker-group.leidos-leaf.com failed with status code [manifests 3.9.0]: 401 Unauthorized

What is the content of the secret, the special characters in my password sometimes breaks things.

If you run kubectl get secrets, do you see a service-registry-regcred?

You can inspect the contents of it and decode the secrets and double-check if special chars broke anything -

kubectl get secrets service-registry-regcred -o yaml | grep dockerconfigjson | awk '{ print $2 }' | head -n1 | base64 --decode

Also, important - if you need to fix it, you’ll need to delete it first before re-running the leafctl deploy service-registry -i step again

kubectl delete secrets service-registry-regcred

My password has a $, which seems to be breaking the secret construction script. how do I create the secret manually?

If you re-run leafctl deploy sr -i with the -r flag it’ll show you the command it uses to create the docker secret on the first few lines.

kubectl create secret docker-registry service-registry-regcred --namespace=default --docker-server=docker-group.leidos-leaf.com --docker-username="USERNAME" --docker-password="PASSWORD"

The service registry and data service pods seem to be working. But I get this when trying to deploy otter-app

skaffold run --cache-artifacts=false
Generating tags...
 - otter-app -> otter-app:4d6085a-dirty
Starting build...
Found [kind-kind] context, using local docker daemon.
Building [otter-app]...
Target platforms: [linux/amd64]
➀ YN0000: β”Œ Resolution step
➀ YN0002: β”‚ @leaf-framework/date-time-picker@npm:3.4.0-dev.5.1 [23e56] doesn't provide date-fns (p74d51), requested by date-fns-tz
➀ YN0002: β”‚ @leaf-framework/date-time-picker@npm:3.5.0-dev.1 [e38af] doesn't provide date-fns (p40841), requested by date-fns-tz
➀ YN0002: β”‚ @leaf-framework/morph-map@npm:3.4.0-dev.5 [5f364] doesn't provide leaflet (pe0ba7), requested by react-leaflet
➀ YN0002: β”‚ @nivo/core@npm:0.62.0 [1e5c3] doesn't provide react-dom (p98a6a), requested by react-measure
➀ YN0002: β”‚ @nivo/core@npm:0.62.0 [797ab] doesn't provide react-dom (p20c92), requested by react-measure
➀ YN0002: β”‚ @nivo/tooltip@npm:0.62.0 [797ab] doesn't provide react (pd0e3b), requested by react-measure
➀ YN0002: β”‚ @nivo/tooltip@npm:0.62.0 [797ab] doesn't provide react (pdabec), requested by react-motion
➀ YN0002: β”‚ @nivo/tooltip@npm:0.62.0 [797ab] doesn't provide react (p4a300), requested by @nivo/core
➀ YN0002: β”‚ @nivo/tooltip@npm:0.62.0 [797ab] doesn't provide react-dom (p99839), requested by react-measure
➀ YN0060: β”‚ craco-cesium@npm:1.2.0 [5f364] provides webpack (p568b1) with version 4.46.0, which doesn't satisfy what strip-pragma-loader requests
➀ YN0002: β”‚ nivo@npm:0.31.0 [5f364] doesn't provide react-dom (p25554), requested by react-measure
➀ YN0002: β”‚ otter-app@workspace:. doesn't provide @babel/core (p86fdb), requested by @babel/plugin-proposal-optional-chaining
➀ YN0002: β”‚ otter-app@workspace:. doesn't provide @popperjs/core (p76860), requested by bootstrap
➀ YN0060: β”‚ otter-app@workspace:. provides react (p93512) with version 16.14.0, which doesn't satisfy what @react-leaflet/core requests
➀ YN0060: β”‚ otter-app@workspace:. provides react (p99bd9) with version 16.14.0, which doesn't satisfy what @leaf-framework/map and some of its descendants request
➀ YN0060: β”‚ otter-app@workspace:. provides react (pf3b87) with version 16.14.0, which doesn't satisfy what @leaf-framework/morph-map and some of its descendants request
➀ YN0060: β”‚ otter-app@workspace:. provides react (p3f3a5) with version 16.14.0, which doesn't satisfy what react-leaflet requests
➀ YN0060: β”‚ otter-app@workspace:. provides react-dom (p86393) with version 16.14.0, which doesn't satisfy what @react-leaflet/core requests
➀ YN0060: β”‚ otter-app@workspace:. provides react-dom (pa0f5e) with version 16.14.0, which doesn't satisfy what @leaf-framework/map and some of its descendants request
➀ YN0060: β”‚ otter-app@workspace:. provides react-dom (pb76b4) with version 16.14.0, which doesn't satisfy what @leaf-framework/morph-map and some of its descendants request
➀ YN0060: β”‚ otter-app@workspace:. provides react-dom (p8fc2c) with version 16.14.0, which doesn't satisfy what react-leaflet requests
➀ YN0002: β”‚ otter-app@workspace:. doesn't provide typescript (p47c7d), requested by awesome-typescript-loader
➀ YN0002: β”‚ otter-app@workspace:. doesn't provide webpack (p63ca1), requested by sass-loader
➀ YN0002: β”‚ otter-app@workspace:. doesn't provide webpack (p6cf72), requested by source-map-loader
➀ YN0002: β”‚ react-dev-utils@npm:11.0.4 doesn't provide typescript (p79ddf), requested by fork-ts-checker-webpack-plugin
➀ YN0002: β”‚ react-dev-utils@npm:11.0.4 doesn't provide webpack (p2af19), requested by fork-ts-checker-webpack-plugin
➀ YN0002: β”‚ react-fa-icon-picker@npm:1.0.3 [5f364] doesn't provide react-is (p5915b), requested by styled-components
➀ YN0002: β”‚ react-grid-layout@npm:0.18.3 doesn't provide react (p9964f), requested by react-draggable
➀ YN0002: β”‚ react-grid-layout@npm:0.18.3 doesn't provide react (p08b23), requested by react-resizable
➀ YN0002: β”‚ react-grid-layout@npm:0.18.3 doesn't provide react-dom (p8ffc4), requested by react-draggable
➀ YN0002: β”‚ react-grid-layout@npm:0.18.3 doesn't provide react-dom (p0b1cc), requested by react-resizable
➀ YN0002: β”‚ react-leaflet-markercluster@npm:3.0.0-rc1 [5f364] doesn't provide react (p5eb07), requested by @react-leaflet/core
➀ YN0002: β”‚ react-leaflet-markercluster@npm:3.0.0-rc1 [5f364] doesn't provide react-dom (p21e1a), requested by @react-leaflet/core
➀ YN0000: β”‚ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➀ YN0000: β”” Completed in 0s 278ms
➀ YN0000: β”Œ Fetch step
➀ YN0000: β”” Completed in 1s 609ms
➀ YN0000: β”Œ Link step
➀ YN0062: β”‚ fsevents@patch:fsevents@npm%3A2.3.2#builtin<compat/fsevents>::version=2.3.2&hash=11e9ea The platform linux is incompatible with this module, link skipped.
➀ YN0062: β”‚ fsevents@patch:fsevents@npm%3A1.2.13#builtin<compat/fsevents>::version=1.2.13&hash=11e9ea The platform linux is incompatible with this module, link skipped.
➀ YN0000: β”” Completed in 3s 149ms
➀ YN0000: Done with warnings in 5s 316ms
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Failed to compile.

./src/stylesheets/main.scss
Node Sass does not yet support your current environment: Linux 64-bit with Unsupported runtime (93)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1


build [otter-app] failed: building custom artifact: exit status 1

I was able to fix that by updating node-sass to 6.0.1 in package.json
Now I am getting

Build [otter-app] succeeded
Starting test...
Tags used in deployment:
 - otter-app -> otter-app:9d093cff78c37dcb4bd95dee7ec54f37c785a0ec489697f0e4ae7f97add7b817
Starting deploy...
Loading images into kind cluster nodes...
 - otter-app:9d093cff78c37dcb4bd95dee7ec54f37c785a0ec489697f0e4ae7f97add7b817 -> Found
Images loaded in 43.0827ms
Helm release otter-app not installed. Installing...
W0223 16:44:05.505083  278073 warnings.go:70] virtualService rule #1 match #0 of prefix /otter-app is not used (duplicate/overlapping match in rule #0 of prefix / on #0)
NAME: otter-app
LAST DEPLOYED: Thu Feb 23 16:44:04 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=otter-app,app.kubernetes.io/instance=otter-app" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80
Waiting for deployments to stabilize...
 - deployment/otter-app: FailedMount: MountVolume.SetUp failed for volume "default-otter-app-data" : configmap "default-otter-app-data" not found
    - pod/otter-app-65cdf7f6dc-45jf8: FailedMount: MountVolume.SetUp failed for volume "default-otter-app-data" : configmap "default-otter-app-data" not found

That config map is supposed to be created by this section of the skaffold.yaml

deploy:
  kubectl:
    manifests:
      - values/default-data.yaml

It deployed properly with the flag --status-check=false.