Skip to content

Commit

Permalink
Replace deprecated kustomize constructs with their new equivalent (#1937
Browse files Browse the repository at this point in the history
)

Summary: Replace deprecated kustomize constructs with their new
equivalent

Relevant Issues: N/A

Type of change: /kind cleanup

Test Plan: Modified these files with `kustomize edit fix` and verified
the following:
- [x] yaml is equivalent before and after
```
# Create 'new' file from branch
(ddelnano/replace-deprecated-kustomize-patches-config) $ for env in dev prod public staging; do kustomize build k8s/cloud_deps/$env/elastic > k8s/cloud_deps/$env/elastic/new; done

# Create 'old' file from main
(main) $ for env in dev prod public staging; do kustomize build k8s/cloud_deps/$env/elastic > k8s/cloud_deps/$env/elastic/old; done
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.
# Warning: 'patchesJson6902' is deprecated. Please use 'patches' instead. Run 'kustomize edit fix' to update your Kustomization automatically.

# Verify shas are the same
$ for env in dev prod public staging; do sha256sum k8s/cloud_deps/$env/elastic/{old,new}; done
2c7459bcc8de323dd30ced4459257d130eef9b56f417b66317e64596d047b8ea  k8s/cloud_deps/dev/elastic/old
2c7459bcc8de323dd30ced4459257d130eef9b56f417b66317e64596d047b8ea  k8s/cloud_deps/dev/elastic/new
bfe20c85b5b90ef029f536f025dc45ab5b40f71def02af19c5d5d54950ae8a01  k8s/cloud_deps/prod/elastic/old
bfe20c85b5b90ef029f536f025dc45ab5b40f71def02af19c5d5d54950ae8a01  k8s/cloud_deps/prod/elastic/new
827ceddfb37cd86b06a5b41efbc2a11ffde7848332fdfdccbc436c50cf9672ac  k8s/cloud_deps/public/elastic/old
827ceddfb37cd86b06a5b41efbc2a11ffde7848332fdfdccbc436c50cf9672ac  k8s/cloud_deps/public/elastic/new
ac25554df51e00853e419419ecdb4b3a0945c14bd4e6750303537ac7d80757e4  k8s/cloud_deps/staging/elastic/old
ac25554df51e00853e419419ecdb4b3a0945c14bd4e6750303537ac7d80757e4  k8s/cloud_deps/staging/elastic/new
```

---------

Signed-off-by: Dom Del Nano <[email protected]>
  • Loading branch information
ddelnano authored Jun 1, 2024
1 parent c7e77e2 commit bbb6ea4
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 30 deletions.
16 changes: 9 additions & 7 deletions k8s/cloud_deps/dev/elastic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: pl-cloud
namespace: plc-dev
resources:
- ../../base/elastic/cluster
patchesJson6902:
labels:
- includeSelectors: true
pairs:
app: pl-cloud
patches:
- path: elastic_storage_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
- path: elastic_replica_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
11 changes: 6 additions & 5 deletions k8s/cloud_deps/prod/elastic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: pl-cloud
namespace: plc
resources:
- ../../base/elastic/cluster
Expand All @@ -13,10 +11,13 @@ patches:
- path: node_selector_patch.yaml
target:
kind: Elasticsearch
patchesJson6902:
- path: elastic_storage_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
labels:
- includeSelectors: true
pairs:
app: pl-cloud
18 changes: 10 additions & 8 deletions k8s/cloud_deps/public/elastic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: pl-cloud
namespace: plc
resources:
- ../../base/elastic/cluster
patchesJson6902:
labels:
- includeSelectors: true
pairs:
app: pl-cloud
patches:
- path: elastic_storage_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
- path: elastic_replica_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
- path: elastic_gcs_plugin.yaml
target:
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
group: elasticsearch.k8s.elastic.co
version: v1
11 changes: 6 additions & 5 deletions k8s/cloud_deps/staging/elastic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: pl-cloud
namespace: plc-staging
resources:
- ../../base/elastic/cluster
patches:
- path: elastic_creds.yaml
target:
kind: Elasticsearch
patchesJson6902:
- path: elastic_storage_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
labels:
- includeSelectors: true
pairs:
app: pl-cloud
11 changes: 6 additions & 5 deletions k8s/cloud_deps/testing/elastic/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
app: pl-cloud
namespace: plc-testing
resources:
- ../../base/elastic/cluster
patches:
- path: elastic_creds.yaml
target:
kind: Elasticsearch
patchesJson6902:
- path: elastic_storage_patch.yaml
target:
name: pl-elastic
kind: Elasticsearch
group: elasticsearch.k8s.elastic.co
kind: Elasticsearch
name: pl-elastic
version: v1
labels:
- includeSelectors: true
pairs:
app: pl-cloud

0 comments on commit bbb6ea4

Please sign in to comment.