Last active
February 16, 2023 01:25
-
-
Save luckylittle/18ee7fea05a6e7ac352f6174cbf816a4 to your computer and use it in GitHub Desktop.
GitOps environment promotion / image version updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### BEFORE: | |
lmaly@localhost ~/Projects/gitops-environment-promotion/envs/staging-asia main cat kustomization.yml | |
--- | |
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
namespace: staging | |
namePrefix: staging-asia- | |
resources: | |
- ../../base | |
components: | |
- ../../variants/non-prod | |
- ../../variants/asia | |
patchesStrategicMerge: | |
- deployment.yml | |
- version.yml | |
- replicas.yml | |
- settings.yml | |
lmaly@localhost ~/Projects/gitops-environment-promotion/envs/staging-asia main cat version.yml | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: simple-deployment | |
spec: | |
template: | |
spec: | |
containers: | |
- name: webserver-simple | |
image: docker.io/kostiscodefresh/simple-env-app:2.0 | |
### AFTER `kustomize edit set image docker.io/kostiscodefresh/simple-env-app:3.0` | |
lmaly@localhost ~/Projects/gitops-environment-promotion/envs/staging-asia main ± cat kustomization.yml | |
apiVersion: kustomize.config.k8s.io/v1beta1 | |
kind: Kustomization | |
namespace: staging | |
namePrefix: staging-asia- | |
resources: | |
- ../../base | |
components: | |
- ../../variants/non-prod | |
- ../../variants/asia | |
patchesStrategicMerge: | |
- deployment.yml | |
- version.yml | |
- replicas.yml | |
- settings.yml | |
images: | |
- name: docker.io/kostiscodefresh/simple-env-app | |
newTag: "3.0" | |
lmaly@localhost ~/Projects/gitops-environment-promotion/envs/staging-asia main ± cat version.yml | |
--- | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: simple-deployment | |
spec: | |
template: | |
spec: | |
containers: | |
- name: webserver-simple | |
image: docker.io/kostiscodefresh/simple-env-app:2.0 | |
### PROOF | |
lmaly@localhost ~/Projects/gitops-environment-promotion/envs/staging-asia main ± kustomize build . | grep docker.io | |
image: docker.io/kostiscodefresh/simple-env-app:3.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment