initial commit
Change-Id: I12a20fc994c2a94df96de9d3393b06bf6687f77a
This commit is contained in:
46
kustomize/components/container-images-tag/README.md
Normal file
46
kustomize/components/container-images-tag/README.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Update the container image tag of the Online Boutique apps
|
||||
|
||||
By default, the Online Boutique apps are targeting the latest release version (see the list of versions [here](https://github.com/GoogleCloudPlatform/microservices-demo/releases)). You may need to change this image tag to target a specific version, this Kustomize variation will help you setting this up.
|
||||
|
||||
## Change the default container image tag via Kustomize
|
||||
|
||||
To automate the deployment of the Online Boutique apps with a specific container imag tag, you can leverage the following variation with [Kustomize](../..).
|
||||
|
||||
From the `kustomize/` folder at the root level of this repository, execute this command:
|
||||
|
||||
```bash
|
||||
TAG=v1.0.0
|
||||
sed -i "s/CONTAINER_IMAGES_TAG/$TAG/g" components/container-images-tag/kustomization.yaml
|
||||
kustomize edit add component components/container-images-tag
|
||||
```
|
||||
|
||||
_Note: this Kustomize component will update the container image tag of the `image:` field in all `Deployments`._
|
||||
|
||||
This will update the `kustomize/kustomization.yaml` file which could be similar to:
|
||||
|
||||
```yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- base
|
||||
components:
|
||||
- components/container-images-tag
|
||||
```
|
||||
|
||||
You can locally render these manifests by running `kubectl kustomize .` as well as deploying them by running `kubectl apply -k .`.
|
||||
|
||||
**Important notes:** if combining with the other variations, here are some considerations:
|
||||
|
||||
- should be placed before `components/container-images-registry`
|
||||
|
||||
So for example here is the order respected:
|
||||
|
||||
```yaml
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- base
|
||||
components:
|
||||
- components/container-images-tag
|
||||
- components/container-images-registry
|
||||
```
|
||||
39
kustomize/components/container-images-tag/kustomization.yaml
Normal file
39
kustomize/components/container-images-tag/kustomization.yaml
Normal file
@@ -0,0 +1,39 @@
|
||||
# Copyright 2022 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
apiVersion: kustomize.config.k8s.io/v1alpha1
|
||||
kind: Component
|
||||
images:
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/adservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/cartservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/checkoutservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/currencyservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/emailservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/frontend
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/loadgenerator
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/paymentservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/productcatalogservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/recommendationservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
- name: us-central1-docker.pkg.dev/google-samples/microservices-demo/shippingservice
|
||||
newTag: CONTAINER_IMAGES_TAG
|
||||
Reference in New Issue
Block a user