Skip to content
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

Failed to create subnamespace due to service "webhook-service" not found #139

Closed
pddg opened this issue Jun 24, 2024 · 1 comment · Fixed by #140
Closed

Failed to create subnamespace due to service "webhook-service" not found #139

pddg opened this issue Jun 24, 2024 · 1 comment · Fixed by #140
Assignees
Labels
bug Something isn't working

Comments

@pddg
Copy link

pddg commented Jun 24, 2024

Describe the bug
A setup where CRD is installed separately and accurate itself is managed by helm is described in the documentation.
https://github.com/cybozu-go/accurate/tree/v1.3.0/charts/accurate#installing-customresourcedefinitions-optional

However, setting up in this way fails with the following error.

❯ kubectl accurate sub create sub root
Error: failed to create a SubNamespace: conversion webhook for accurate.cybozu.com/v1, Kind=SubNamespace failed: Post "https://webhook-service.system.svc:443/convert?timeout=30s": service "webhook-service" not found

Environments

  • Version: v1.3.0
  • OS: Ubuntu 24.04

To Reproduce
Steps to reproduce the behavior:

  1. Create kubernetes cluster
    1. kind create cluster --name accurate
  2. Install cert-manager
    1. curl -fsL https://github.com/cert-manager/cert-manager/releases/download/v1.15.0/cert-manager.yaml | kubectl apply -f -
  3. Install CRD of accurate
    1. kustomize build https://github.com/cybozu-go/accurate/config/crd | kubectl apply -f -
  4. Install accurate by helm with installCRDs=false
    1. helm repo add accurate https://cybozu-go.github.io/accurate/
    2. helm repo update
    3. helm install --create-namespace --namespace accurate --set installCRDs=false accurate accurate/accurate
  5. create sub namespace

Expected behavior
accurate works and sub namespaces are created.

Additional context
This occurs because accurate uses helm templates to make some of the CRDs variable and the CRDs installed through this procedure are different from the CRDs installed through helm.

metadata:
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/{{ template "accurate.fullname" . }}-serving-cert'
controller-gen.kubebuilder.io/version: v0.15.0
labels:
app.kubernetes.io/managed-by: '{{ .Release.Service }}'
app.kubernetes.io/name: '{{ include "accurate.name" . }}'
app.kubernetes.io/version: '{{ .Chart.AppVersion }}'
helm.sh/chart: '{{ include "accurate.chart" . }}'
name: subnamespaces.accurate.cybozu.com
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
name: '{{ template "accurate.fullname" . }}-webhook-service'
namespace: '{{ .Release.Namespace }}'
path: /convert
conversionReviewVersions:
- v1

I want the documentation to say what changes should be made to the CRD.

@pddg pddg added the bug Something isn't working label Jun 24, 2024
@erikgb
Copy link
Contributor

erikgb commented Jun 24, 2024

I agree something isn't right here. But the conversion webhook configuration in the CRD needs to know which namespace the webhook is running in, so I don't expect an easy/good fix to be available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants