Skip to content

Commit

Permalink
Use skaffold v2 and kustomize v5 (#4249)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Dec 28, 2023
1 parent 8665d83 commit 9879341
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 124 deletions.
2 changes: 2 additions & 0 deletions kurl_proxy/kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- rbac.yaml
- deployment.yaml
Expand Down
10 changes: 5 additions & 5 deletions kurl_proxy/kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bases:
- ../../base

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./secret.yaml
- ./configmap.yaml
- ./secret.yaml
- ./configmap.yaml
- ../../base
2 changes: 1 addition & 1 deletion kustomize/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
restartPolicy: Always
containers:
- name: kotsadm
image: kotsadm
image: kotsadm-api
imagePullPolicy: IfNotPresent
resources:
limits:
Expand Down
6 changes: 4 additions & 2 deletions kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./deployment.yaml
- ./service.yaml
- ./deployment.yaml
- ./service.yaml
26 changes: 13 additions & 13 deletions kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
bases:
- ../../base
- ../rbac
- ../../../web/kustomize/overlays/dev
- ../../../kurl_proxy/kustomize/overlays/dev

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml

patchesStrategicMerge:
- ./deployment.yaml

commonLabels:
app.kubernetes.io/name: kotsadm
- ./namespace.yaml
- ../../base
- ../rbac
- ../../../web/kustomize/overlays/dev
- ../../../kurl_proxy/kustomize/overlays/dev
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/name: kotsadm
patches:
- path: ./deployment.yaml
14 changes: 8 additions & 6 deletions kustomize/overlays/kotsstore/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
bases:
- ../dev
- ./minio
- ../../../migrations/kustomize/overlays/dev

patchesStrategicMerge:
- ./deployment.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../dev
- ./minio
- ../../../migrations/kustomize/overlays/dev
patches:
- path: ./deployment.yaml
8 changes: 5 additions & 3 deletions kustomize/overlays/kotsstore/minio/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./service.yaml
- ./secret.yaml
- ./statefulset.yaml
- ./service.yaml
- ./secret.yaml
- ./statefulset.yaml
13 changes: 6 additions & 7 deletions kustomize/overlays/ocistore/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
bases:
- ../dev

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./distribution/distribution.yaml

patchesStrategicMerge:
- ./deployment.yaml
- ./distribution/distribution.yaml
- ../dev
patches:
- path: ./deployment.yaml
16 changes: 8 additions & 8 deletions kustomize/overlays/okteto/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# - ../../../kurl_proxy/kustomize/overlays/dev

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../base
- ../../../web/kustomize/overlays/dev
- ../../../migrations/kustomize/overlays/okteto
- ../kotsstore/minio

patchesStrategicMerge:
- ./deployment.yaml

commonLabels:
app.kubernetes.io/name: kotsadm
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/name: kotsadm
patches:
- path: ./deployment.yaml
5 changes: 3 additions & 2 deletions kustomize/overlays/rbac/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./cluster-rbac.yaml
- ./cluster-rbac.yaml
4 changes: 3 additions & 1 deletion migrations/kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
bases: []
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources: []
10 changes: 5 additions & 5 deletions migrations/kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bases:
- ../../base

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./rqlite.yaml
- ./job.yaml
- ./rqlite.yaml
- ./job.yaml
- ../../base
10 changes: 5 additions & 5 deletions migrations/kustomize/overlays/okteto/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bases:
- ../../base

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./rqlite.yaml
- ./migrations.yaml
- ./rqlite.yaml
- ./migrations.yaml
- ../../base
88 changes: 42 additions & 46 deletions skaffold.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,45 @@
apiVersion: skaffold/v2beta2
apiVersion: skaffold/v4beta8
kind: Config

profiles:
- name: kotsstore
activation:
- env: KOTSSTORE=
deploy:
kustomize:
paths:
- "./kustomize/overlays/kotsstore"
- name: debug
activation:
- env: DEBUG_KOTSADM=1
patches:
- op: add
path: /build/artifacts/1/docker/buildArgs
value:
DEBUG_KOTSADM: 1

build:
local:
concurrency: 0
useBuildkit: true

artifacts:
- image: kotsadm-web
context: "./web"
context: ./web
sync:
manual:
- src: "src/**/*.jsx"
dest: "./"
- src: "src/**/*.js"
dest: "./"
- src: "src/**/*.png"
dest: "./"
- src: "src/**/*.scss"
dest: "./"
- src: "src/**/*.css"
dest: "./"
- src: src/**/*.jsx
dest: ./
- src: src/**/*.js
dest: ./
- src: src/**/*.png
dest: ./
- src: src/**/*.scss
dest: ./
- src: src/**/*.css
dest: ./
docker:
dockerfile: ./skaffold.Dockerfile

- image: kotsadm
context: "./"
- image: kotsadm-api
context: ./
docker:
dockerfile: ./hack/dev/skaffold.Dockerfile

- image: kotsadm-migrations
context: "./migrations"
context: ./migrations
docker:
dockerfile: ./skaffold.Dockerfile

- image: kurl-proxy
context: "./kurl_proxy"
context: ./kurl_proxy
docker:
dockerfile: ./skaffold.Dockerfile

deploy:
statusCheckDeadlineSeconds: 240
local:
useBuildkit: true
concurrency: 0
manifests:
kustomize:
paths:
- "./kustomize/overlays/dev"

- ./kustomize/overlays/dev
deploy:
kubectl: {}
statusCheckDeadlineSeconds: 240
portForward:
- resourceType: service
resourceName: kotsadm
Expand All @@ -71,3 +49,21 @@ portForward:
resourceName: kurl-proxy
port: 8800
localPort: 30880
profiles:
- name: kotsstore
activation:
- env: KOTSSTORE=
manifests:
kustomize:
paths:
- ./kustomize/overlays/kotsstore
deploy:
kubectl: {}
- name: debug
activation:
- env: DEBUG_KOTSADM=1
patches:
- op: add
path: /build/artifacts/1/docker/buildArgs
value:
DEBUG_KOTSADM: 1
8 changes: 3 additions & 5 deletions web/kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./deployment.yaml



- ./deployment.yaml
13 changes: 6 additions & 7 deletions web/kustomize/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
bases:
- ../../base

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./service.yaml

patchesStrategicMerge:
- ./deployment.yaml
- ./service.yaml
- ../../base
patches:
- path: ./deployment.yaml
15 changes: 7 additions & 8 deletions web/kustomize/overlays/kotsadm/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
bases:
- ../../base

patchesStrategicMerge:
- ./deployment.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./configmap.yaml
- ./service.yaml
- ./configmap.yaml
- ./service.yaml
- ../../base
patches:
- path: ./deployment.yaml

0 comments on commit 9879341

Please sign in to comment.