bugfest / tor-controller

Tor toolkit for Kubernetes (Tor instances, onion services and more)
Apache License 2.0
113 stars 17 forks source link

[BUG] `OnionService.spec.serviceMonitor` is not declared in schema #36

Closed samip5 closed 1 year ago

samip5 commented 1 year ago

Describe the bug

It seems that tor.k8s.torproject.org/v1alpha2 CRD doesn't include the serviceMonitor in the schema which should probably be fixed.

The customresourcedefinitions seems to have been updated 5 months ago, despite changes 5 days ago.

To Reproduce Try to deploy OnionService whit v1alpha2 api version.

Expected behavior There would be no issues.

Additional information

OnionService/tor/ahmia-search dry-run failed, error: .spec.serviceMonitor: field not declared in schema
bugfest commented 1 year ago

Hi @samip5 are you using namespaced deployment here?

samip5 commented 1 year ago

Hi @samip5 are you using namespaced deployment here?

Yes

bugfest commented 1 year ago

Hi @samip5 I cannot reproduce it in my local env. Can you provide more info?

samip5 commented 1 year ago
$ k explain OnionService.spec
KIND:     OnionService
VERSION:  tor.k8s.torproject.org/v1alpha2

RESOURCE: spec <Object>

DESCRIPTION:
     OnionServiceSpec defines the desired state of OnionService

FIELDS:
   authorizedClients    <[]Object>

   extraConfig  <string>

   masterOnionAddress   <string>

   privateKeySecret     <Object>
     SecretReference represents a Secret Reference

   rules        <[]Object>

   serviceMonitor       <boolean>

   template     <Object>
     Template describes the pods that will be created.

   version      <integer>

$ k get crd/servicemonitors.monitoring.coreos.com
NAME                                    CREATED AT
servicemonitors.monitoring.coreos.com   2023-02-02T02:29:16Z

I installed it using Helm, and fresh install. The issue is that if my onionService doesn't include that serviceMonitor field at all, eg https://github.com/samip5/k8s-cluster/blob/main/cluster/apps/tor/services/ahmia-hidden.yaml I get that error when applied via Flux

samip5 commented 1 year ago

It seems that I was able to deploy the manifest manually so I'm closing this