Skip to content

Fix kustomize5 warnings #2534

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/earlystopping/medianstop/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${EARLY_STOPPING_DIR}/ ${TARGET_DIR}/${EARLY_STOPPING_DIR}/

WORKDIR ${TARGET_DIR}/${EARLY_STOPPING_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ RUN if [ "${TARGETARCH}" = "arm64" ]; then \
rm -rf /var/lib/apt/lists/*; \
fi

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM ibmcom/tensorflow-ppc64le:2.2.0-py3
ADD . /usr/src/app/github.com/kubeflow/katib
WORKDIR /usr/src/app/github.com/kubeflow/katib/cmd/metricscollector/v1beta1/tfevent-metricscollector/
RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
ENV PYTHONPATH /usr/src/app/github.com/kubeflow/katib:/usr/src/app/github.com/kubeflow/katib/pkg/apis/manager/v1beta1/python:/usr/src/app/github.com/kubeflow/katib/pkg/metricscollector/v1beta1/tfevent-metricscollector/:/usr/src/app/github.com/kubeflow/katib/pkg/metricscollector/v1beta1/common/
ENTRYPOINT ["python", "main.py"]
2 changes: 2 additions & 0 deletions cmd/suggestion/hyperband/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
2 changes: 2 additions & 0 deletions cmd/suggestion/hyperopt/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
2 changes: 2 additions & 0 deletions cmd/suggestion/nas/darts/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
2 changes: 2 additions & 0 deletions cmd/suggestion/nas/enas/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
2 changes: 2 additions & 0 deletions cmd/suggestion/optuna/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
2 changes: 2 additions & 0 deletions cmd/suggestion/pbt/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
2 changes: 2 additions & 0 deletions cmd/suggestion/skopt/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ ADD ./${SUGGESTION_DIR}/ ${TARGET_DIR}/${SUGGESTION_DIR}/

WORKDIR ${TARGET_DIR}/${SUGGESTION_DIR}

RUN python -m pip install --upgrade pip \
&& pip install wheel
RUN pip install --prefer-binary --no-cache-dir -r requirements.txt
RUN chgrp -R 0 ${TARGET_DIR} \
&& chmod -R g+rwX ${TARGET_DIR}
Expand Down
4 changes: 4 additions & 0 deletions manifests/v1beta1/components/webhook/webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: katib.kubeflow.org
annotations:
cert-manager.io/inject-ca-from: KATIB_NAMESPACE_PLACEHOLDER/KATIB_CERT_NAME_PLACEHOLDER
Comment on lines +6 to +7
Copy link
Member

@tenzen-y tenzen-y Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add cert-manager related parameters in https://github.com/kubeflow/katib/tree/master/manifests/v1beta1/installs/katib-with-kubeflow since in Katib project, the cert-manager is not required dependencies. The certmanager is required dependencies only for Katib with Kubeflow.

Copy link
Author

@vikas-saxena02 vikas-saxena02 Apr 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tenzen-y Apologies, I just saw this. The reason I added this here was this annotation was previously applied with patches and with move to replacements from vars, the replacements get applied first before patches and hence the builds were failing. Given this annotation was not used elsewhere in katib-standalone and other modules I thought of adding it to the main webhook configuration. But I do not have background on Katib so I left it for review so I am open to ideas, can you suggest something that would be more ideal and I can make that change as part of this PR.

PS: this is my first time doing heavylifting work on Kustomize so yes there is some skill gap.

webhooks:
- name: validator.experiment.katib.kubeflow.org
sideEffects: None
Expand All @@ -28,6 +30,8 @@ apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: katib.kubeflow.org
annotations:
cert-manager.io/inject-ca-from: KATIB_NAMESPACE_PLACEHOLDER/KATIB_CERT_NAME_PLACEHOLDER
webhooks:
- name: defaulter.experiment.katib.kubeflow.org
sideEffects: None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ metadata:
name: katib-webhook-cert
spec:
isCA: true
commonName: $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc
commonName: KATIB_SERVICE_NAME_PLACEHOLDER.KATIB_NAMESPACE_PLACEHOLDER.svc
dnsNames:
- $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc
- $(KATIB_SERVICE_NAME).$(KATIB_NAMESPACE).svc.cluster.local
- KATIB_SERVICE_NAME_PLACEHOLDER.KATIB_NAMESPACE_PLACEHOLDER.svc
- KATIB_SERVICE_NAME_PLACEHOLDER.KATIB_NAMESPACE_PLACEHOLDER.svc.cluster.local
issuerRef:
kind: Issuer
name: katib-selfsigned-issuer
Expand Down
178 changes: 130 additions & 48 deletions manifests/v1beta1/installs/katib-cert-manager/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow
resources:
# Namespace.
- ../../components/namespace
# Katib controller.
- ../../components/controller/
# Katib CRDs.
- ../../components/crd/
# Katib DB manager.
- ../../components/db-manager/
# Katib DB mysql.
- ../../components/mysql/
# Katib UI.
- ../../components/ui/
# Katib webhooks.
- ../../components/webhook/
# Cert-manager certificate for webhooks
- certificate.yaml
# Namespace.
- ../../components/namespace
# Katib controller.
- ../../components/controller/
# Katib CRDs.
- ../../components/crd/
# Katib DB manager.
- ../../components/db-manager/
# Katib DB mysql.
- ../../components/mysql/
# Katib UI.
- ../../components/ui/
# Katib webhooks.
- ../../components/webhook/
# Cert-manager certificate for webhooks
- certificate.yaml
images:
- name: ghcr.io/kubeflow/katib/katib-controller
newName: ghcr.io/kubeflow/katib/katib-controller
Expand All @@ -30,40 +29,123 @@ images:
newName: ghcr.io/kubeflow/katib/katib-ui
newTag: latest

patchesStrategicMerge:
- patches/katib-cert-injection.yaml

vars:
- fieldref:
fieldPath: metadata.namespace
name: KATIB_NAMESPACE
objref:
apiVersion: v1
kind: Service
name: katib-controller
- fieldref:
fieldPath: metadata.name
name: KATIB_SERVICE_NAME
objref:
apiVersion: v1
kind: Service
name: katib-controller
- name: KATIB_CERT_NAME
objref:
kind: Certificate
group: cert-manager.io
version: v1
name: katib-webhook-cert
fieldref:
fieldpath: metadata.name

configurations:
- params.yaml
- params.yaml

configMapGenerator:
- name: katib-config
behavior: create
files:
- katib-config.yaml
- behavior: create
files:
- katib-config.yaml
name: katib-config
options:
disableNameSuffixHash: true

replacements:
- source:
fieldPath: metadata.namespace
kind: Service
name: katib-controller
version: v1
targets:
- fieldPaths:
- spec.commonName
options:
delimiter: .
index: 1
select:
group: cert-manager.io
kind: Certificate
name: katib-webhook-cert
version: v1
- fieldPaths:
- spec.dnsNames.0
options:
delimiter: .
index: 1
select:
group: cert-manager.io
kind: Certificate
name: katib-webhook-cert
version: v1
- fieldPaths:
- spec.dnsNames.1
options:
delimiter: .
index: 1
select:
group: cert-manager.io
kind: Certificate
name: katib-webhook-cert
version: v1
- fieldPaths:
- metadata.annotations.cert-manager\.io/inject-ca-from
options:
delimiter: /
index: 0
select:
kind: ValidatingWebhookConfiguration
name: katib.kubeflow.org
- fieldPaths:
- metadata.annotations.cert-manager\.io/inject-ca-from
options:
delimiter: /
index: 0
select:
kind: MutatingWebhookConfiguration
name: katib.kubeflow.org
- source:
fieldPath: metadata.name
kind: Service
name: katib-controller
version: v1
targets:
- fieldPaths:
- spec.commonName
options:
delimiter: .
select:
group: cert-manager.io
kind: Certificate
name: katib-webhook-cert
version: v1
- fieldPaths:
- spec.dnsNames.0
options:
delimiter: .
select:
group: cert-manager.io
kind: Certificate
name: katib-webhook-cert
version: v1
- fieldPaths:
- spec.dnsNames.1
options:
delimiter: .
select:
group: cert-manager.io
kind: Certificate
name: katib-webhook-cert
version: v1
- source:
fieldPath: metadata.name
kind: Certificate
name: katib-webhook-cert
targets:
- fieldPaths:
- metadata.annotations.cert-manager\.io/inject-ca-from
options:
delimiter: /
index: 1
select:
kind: ValidatingWebhookConfiguration
name: katib.kubeflow.org
- fieldPaths:
- metadata.annotations.cert-manager\.io/inject-ca-from
options:
disableNameSuffixHash: true
delimiter: /
index: 1
select:
kind: MutatingWebhookConfiguration
name: katib.kubeflow.org
4 changes: 2 additions & 2 deletions manifests/v1beta1/installs/katib-cert-manager/params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ varReference:
kind: Certificate
- path: spec/issuerRef/name
kind: Certificate
- path: metadata/annotations
- path: metadata.annotations.cert-manager.io/inject-ca-from
kind: MutatingWebhookConfiguration
- path: metadata/annotations
- path: metadata.annotations.cert-manager.io/inject-ca-from
kind: ValidatingWebhookConfiguration
nameReference:
- kind: Issuer
Expand Down

This file was deleted.

Loading