-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kustomize variation to deploy Online Boutique apps without the grpc-health-probe
bin
#1102
Kustomize variation to deploy Online Boutique apps without the grpc-health-probe
bin
#1102
Conversation
🚲 PR staged at http://35.224.222.105 |
grpc-health-probe
bin
🚲 PR staged at http://35.224.222.105 |
…stomize otherwise)
🚲 PR staged at http://35.224.222.105 |
🚲 PR staged at http://35.224.222.105 |
1 similar comment
🚲 PR staged at http://35.224.222.105 |
🚲 PR staged at http://35.224.222.105 |
🚲 PR staged at http://35.224.222.105 |
Ready for your review, thanks! |
🚲 PR staged at http://35.224.222.105 |
🚲 PR staged at http://35.224.222.105 |
@@ -28,7 +28,7 @@ patchesStrategicMerge: | |||
- name: server | |||
env: | |||
- name: REDIS_ADDR | |||
value: "{{REDIS_ADDR}}" | |||
value: "REDIS_ADDR" |
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.
Question: Is there a reason we remove the curly braces?
Should we also fix:
sed -i "s/{{REDIS_ADDR}}/${REDIS_IP}:${REDIS_PORT}/g" components/memorystore/kustomization.yaml
inside kustomize/components/memorystore/README.md
?
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.
Maybe it was an accident?
value: "REDIS_ADDR" | |
value: "{{REDIS_ADDR}}" |
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.
Hey Nim, good question, actually I had that in the description: Review the setup of tokens to avoid issues with Kustomize and bash session
. So that's on purpose otherwise we have issue in bash session when doing the sed
part and/or when doing kustomize build .
without these tokens replaced. Let me know if you need more info. But the tl,dr is we should have token just like this REDIS_ADDR
not with any {}
nor {{}}
, etc.
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.
Following this today, one possible unintended side effect is that the sed
now matches the name and value. So I end up with:
- name: 10.34.24.75:6379
value: "10.34.24.75:6379"
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.
Yep, that's why we document this like this: f60a67f. But yeah if someone is not doing the \"
it could land to this error. Open for suggestions to improve this for the different files having tokens like this. PR about that are more than welcome ;)
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.
Correct. I checked that I pulled latest and just reran the terraform deploy. I see the escape characters and the quote \"
and it still seems to be replacing all of them.
To clarify, it worked in the sense that the application deployed beautifully, it just replaced all instances of REDIS_ADDR
with 10.34.24.75:6379
. (Including the instance at the top of the /microservices-demo/kustomize/components/memorystore/kustomization.yaml
file.)
-# cartservice - replace REDIS_ADDR to target new Memorystore (redis) instance
+# cartservice - replace 10.34.24.75:6379 to target new Memorystore (redis) instance
- |-
apiVersion: apps/v1
kind: Deployment
@@ -27,8 +27,8 @@ patchesStrategicMerge:
containers:
- name: server
env:
- - name: REDIS_ADDR
- value: "REDIS_ADDR"
+ - name: 10.34.24.75:6379
+ value: "10.34.24.75:6379"
# redis - remove the redis-cart Deployment
- |-
apiVersion: apps/v1
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.
Gotcha, thanks. Do you mind reporting this as a dedicated issue please? We will need to tackle this to fix this broken Terraform deployment with Memorystore. Thanks!
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'll do that!
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.
FYI: this will be fixed via #1202. Thanks!
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.
Nice!
I also had a solution (all the backslashes!!) that I was going to PR today, but that is much cleaner.
From the `kustomize/` folder at the root level of this repository, execute this command: | ||
``` | ||
REGISTRY=my-registry # Example: gcr.io/my-project/my-directory | ||
sed -i "s|CONTAINER_IMAGES_REGISTRY|${REGISTRY}|g" components/container-images-registry/kustomization.yaml |
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.
Rationale for my change:
I've changed "s/CONTAINER_IMAGES_REGISTRY/$REGISTRY/g"
to "s|CONTAINER_IMAGES_REGISTRY|$REGISTRY|g"
because the /
s inside gcr.io/my-project/my-directory
were breaking the sed
command. Now we're no longer using regexes (we're using |
s instead) to avoid /
s from the ${REGISTRY}
variable being interpreted as special characters.
@@ -47,7 +47,7 @@ components: | |||
``` | |||
|
|||
Update current Kustomize manifest to target this Memorystore (Redis) instance. | |||
```bash | |||
```sh | |||
REDIS_IP=$(gcloud redis instances describe redis-cart --region=${REGION} --format='get(host)') | |||
REDIS_PORT=$(gcloud redis instances describe redis-cart --region=${REGION} --format='get(port)') | |||
sed -i "s/{{REDIS_ADDR}}/${REDIS_IP}:${REDIS_PORT}/g" components/memorystore/kustomization.yaml |
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.
Suggestion: Should we update this sed
command?
sed -i "s/{{REDIS_ADDR}}/${REDIS_IP}:${REDIS_PORT}/g" components/memorystore/kustomization.yaml | |
sed -i "s/REDIS_ADDR/${REDIS_IP}:${REDIS_PORT}/g" components/memorystore/kustomization.yaml |
Regarding: #1102 (comment)
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.
Oh yeah, maybe a merge issue, let me check that and update this.
🚲 PR staged at http://35.224.222.105 |
…//github.com/GoogleCloudPlatform/microservices-demo into mathieu-benoit/without-grpc-health-probe-bin
🚲 PR staged at http://35.224.222.105 |
1 similar comment
🚲 PR staged at http://35.224.222.105 |
🚲 PR staged at http://35.224.222.105 |
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.
Thanks again, Mathieu, for proactively figuring (and implementing) this out! 👏
Everything looks good.
I have tested all the Kustomize building.
I've committed some minor fixes/edits to avoid back-and-forth.
But I have not deployed the new -native-grpc-probes
to a GKE cluster, but I trust that they work.
Feel free to merge whenever.
…health-probe` bin (GoogleCloudPlatform#1102) * without-grpc-health-probe-bin * fix docker build for cartservice * kustomize - add container-image-registry * kustomize - add container-image-tag * kustomize - add container-image-tag-suffix * fix container-images-registry * fix container-images-tag * complete native-grpc-health-check Kustomize variation * Review tokens in Kustomize files: $() instead of {{}} (issues with Kustomize otherwise) * docker build -t "${image}-native-grpc" * Bonify the custom test in Kustomize CI * Review token to avoid issue in bash with sed: @() instead of $() * Fix token issues with Kustomize * More documentation for the new Kustomize variations * fix docs * update docs * fix link in doc * Fix container-images-registry/README.md * Update container-images-registry/README.md * Update container-images-tag-suffix/README.md * Update container-images-tag-suffix/README.md * Update native-grpc-health-check/README.md * yaml|bash|output in docs * Remove {{ }} around REDIS_ADDR * fix "REDIS_ADDR" token Co-authored-by: minherz <minherz@users.noreply.github.com> Co-authored-by: Nim Jayawardena <nimjay@google.com>
livenessProbe
andreadinessProbe
since GKE 1.24.loadgenerator
andfrontend
are not impacted by that (not gRPC apis/apps)container-images-registry
(not needed, but similar to the one below)container-images-tag
(not needed, but similar to the one below)container-images-tag-suffix
(needed for this new Kustomize variation)make-docker-images.sh
) in order to build a second image next to the default/official one by adding a prefix-native-grpc-probes
.-native-grpc-probes
images are not built at every PR nor merge intomain
, they are only built during the release process.sed
examples tooTests realized on a GKE 1.24 now available on
rapid
channel:Build the containers for all the Online Boutique apps with the
-native-grpc-probes
image tag, you can leverage the script here.Then, deploy this like:
Note: for this variation,
kubectl apply -k .
won't work because there is a known issue currently in Kustomize where thetagSuffix
is duplicated. The command lines above are a temporary workaround.We won't make this the default configuration yet, GKE 1.24 is the default version for the
rapid
channel. We need to make the choice in the future when this configuration will be the default ones. GKE just got 1.24 in rapid channel in 2022-08-12 and is planned to have its end of life on 2023-09-30. So it's 1 year from now. Will it be a good time then, after 2023-09-30?