Skip to content

Commit

Permalink
fix: retina.sh (#26)
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
  • Loading branch information
rbtr authored Mar 12, 2024
1 parent 6988fd2 commit 7c7953d
Show file tree
Hide file tree
Showing 32 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
issues:
max-same-issues: 0
max-issues-per-linter: 0
new-from-rev: origin/master
new-from-rev: origin/main
linters:
presets:
- bugs
Expand Down
2 changes: 1 addition & 1 deletion controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func main() {
// Port: 9443, // retina-agent is host-networked, we don't want to abuse the port for conflicts.
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "ecaf1259.retina.io",
LeaderElectionID: "ecaf1259.retina.sh",
}

// Local context has its meaning only when pod level(advanced) metrics is enabled.
Expand Down
4 changes: 2 additions & 2 deletions crd/api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// Package v1alpha1 contains API Schema definitions for the retina v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=retina.io
// +groupName=retina.sh
package v1alpha1

import (
Expand All @@ -13,7 +13,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "retina.io", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "retina.sh", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: captures.retina.io
name: captures.retina.sh
spec:
group: retina.io
group: retina.sh
names:
categories:
- retina
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: metricsconfigurations.retina.io
name: metricsconfigurations.retina.sh
spec:
group: retina.io
group: retina.sh
names:
categories:
- retina
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: retinaendpoints.retina.io
name: retinaendpoints.retina.sh
spec:
group: retina.io
group: retina.sh
names:
kind: RetinaEndpoint
listKind: RetinaEndpointList
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
name: tracesconfigurations.retina.io
name: tracesconfigurations.retina.sh
spec:
group: retina.io
group: retina.sh
names:
categories:
- retina
Expand Down
16 changes: 8 additions & 8 deletions deploy/manifests/controller/helm/retina/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ rules:
- list
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints
verbs:
Expand All @@ -147,7 +147,7 @@ rules:
- update
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- metricsconfigurations
verbs:
Expand All @@ -159,7 +159,7 @@ rules:
- update
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- metricsconfigurations/status
verbs:
Expand All @@ -171,13 +171,13 @@ rules:
- update
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints/finalizers
verbs:
- update
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints/status
verbs:
Expand Down Expand Up @@ -214,7 +214,7 @@ rules:
verbs:
- get
- apiGroups:
- retina.io
- retina.sh
resources:
- captures
verbs:
Expand All @@ -226,13 +226,13 @@ rules:
- update
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- captures/finalizers
verbs:
- update
- apiGroups:
- retina.io
- retina.sh
resources:
- captures/status
verbs:
Expand Down
10 changes: 5 additions & 5 deletions deploy/manifests/controller/helm/retina/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rules:
resources: ["clusterobservers"]
verbs: ["get", "list", "watch"]
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints
verbs:
Expand All @@ -31,7 +31,7 @@ rules:
- list
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints
verbs:
Expand All @@ -43,7 +43,7 @@ rules:
- update
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- metricsconfigurations
verbs:
Expand All @@ -55,13 +55,13 @@ rules:
- update
- watch
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints/finalizers
verbs:
- update
- apiGroups:
- retina.io
- retina.sh
resources:
- retinaendpoints/status
verbs:
Expand Down
12 changes: 6 additions & 6 deletions deploy/registercrd.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ import (
)

const (
RetinaCapturesYAMLpath = "retina.io_captures.yaml"
RetinaEndpointsYAMLpath = "retina.io_retinaendpoints.yaml"
MetricsConfigurationYAMLpath = "retina.io_metricsconfigurations.yaml"
RetinaCapturesYAMLpath = "retina.sh_captures.yaml"
RetinaEndpointsYAMLpath = "retina.sh_retinaendpoints.yaml"
MetricsConfigurationYAMLpath = "retina.sh_metricsconfigurations.yaml"
)

//go:embed manifests/controller/helm/retina/crds/retina.io_captures.yaml
//go:embed manifests/controller/helm/retina/crds/retina.sh_captures.yaml
var RetinaCapturesYAML []byte

//go:embed manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml
//go:embed manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml
var RetinaEndpointsYAML []byte

//go:embed manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml
//go:embed manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml
var MetricsConfgurationYAML []byte

func GetRetinaCapturesCRD() (*apiextensionsv1.CustomResourceDefinition, error) {
Expand Down
10 changes: 5 additions & 5 deletions deploy/registercrd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ func TestInstallOrUpdateCRDs(t *testing.T) {
name: "install all CRDs",
enableRetinaEndpoint: true,
want: map[string]*apiextensionsv1.CustomResourceDefinition{
"captures.retina.io": capture,
"retinaendpoints.retina.io": endpoint,
"metricsconfigurations.retina.io": metrics,
"captures.retina.sh": capture,
"retinaendpoints.retina.sh": endpoint,
"metricsconfigurations.retina.sh": metrics,
},
},
{
name: "disable retina endpoint",
enableRetinaEndpoint: false,
want: map[string]*apiextensionsv1.CustomResourceDefinition{
"captures.retina.io": capture,
"metricsconfigurations.retina.io": metrics,
"captures.retina.sh": capture,
"metricsconfigurations.retina.sh": metrics,
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions docs/CRDs/Capture.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ To use the `Capture` CRD, [install Retina](../installation/setup.md) with captur

## CRD Specification

The full specification for the `Capture` CRD can be found in the [Capture CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.io_captures.yaml) file.
The full specification for the `Capture` CRD can be found in the [Capture CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_captures.yaml) file.

The `Capture` CRD is defined with the following specifications:

- **API Group:** retina.io
- **API Group:** retina.sh
- **API Version:** v1alpha1
- **Kind:** Capture
- **Plural:** captures
Expand Down Expand Up @@ -43,7 +43,7 @@ The `Capture` CRD is defined with the following specifications:
To create a `Capture`, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`:

```yaml
apiVersion: retina.io/v1alpha1
apiVersion: retina.sh/v1alpha1
kind: Capture
metadata:
name: example-capture
Expand Down
6 changes: 3 additions & 3 deletions docs/CRDs/MetricsConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Retina by default emits node level metrics, however, customers can apply `Metric

## CRD Specification

The full specification for the `MetricsConfiguration` CRD can be found in the [MetricsConfiguration CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.io_metricsconfigurations.yaml) file.
The full specification for the `MetricsConfiguration` CRD can be found in the [MetricsConfiguration CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_metricsconfigurations.yaml) file.

The `MetricsConfiguration` CRD is defined with the following specifications:

- **API Group:** retina.io
- **API Group:** retina.sh
- **API Version:** v1alpha1
- **Kind:** MetricsConfiguration
- **Plural:** metricsconfigurations
Expand Down Expand Up @@ -38,7 +38,7 @@ The `MetricsConfiguration` CRD is defined with the following specifications:
To create a `MetricsConfiguration`, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`:

```yaml
apiVersion: retina.io/v1alpha1
apiVersion: retina.sh/v1alpha1
kind: MetricsConfiguration
metadata:
name: metricsconfigcrd
Expand Down
6 changes: 3 additions & 3 deletions docs/CRDs/RetinaEndpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ In large-scale API servers, each Retina Pod needs to learn about cluster state,

## CRD Specification

The full specification for the `RetinaEndpoint` CRD can be found in the [RetinaEndpoint CRD]( https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.io_retinaendpoints.yaml) file.
The full specification for the `RetinaEndpoint` CRD can be found in the [RetinaEndpoint CRD]( https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_retinaendpoints.yaml) file.

The `RetinaEndpoint` CRD is defined with the following specifications:

- **API Group:** retina.io
- **API Group:** retina.sh
- **API Version:** v1alpha1
- **Kind:** RetinaEndpoint
- **Plural:** retinaendpoints
Expand All @@ -38,7 +38,7 @@ The `RetinaEndpoint` CRD is defined with the following specifications:
To create a `RetinaEndpoint`, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`:

```yaml
apiVersion: retina.io/v1alpha1
apiVersion: retina.sh/v1alpha1
kind: RetinaEndpoint
metadata:
name: example-retinaendpoint
Expand Down
2 changes: 1 addition & 1 deletion docs/captures/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type: Opaque
Create a Capture specifying the secret created as blobUpload, this example will also store the artifact on the node host path
```yaml
apiVersion: retina.io/v1alpha1
apiVersion: retina.sh/v1alpha1
kind: Capture
metadata:
name: capture-test
Expand Down
2 changes: 1 addition & 1 deletion docs/installation/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Defaults are specified for each component in *deploy/manifests/controller/helm/r

* `enablePodLevel`: When this toggle is set to true, Retina will gather Advanced/Pod-Level metrics. Advanced metrics can attach Pod metadata to Retina's metrics.
* `remoteContext`: When this toggle is set to true, retina will watch Pods on the cluster.
* `enableAnnotations`: When this toggle is set to true, retina will gather metrics for the annotated resources. Namespaces or Pods can be annotated with "retina.io/v1alpha=observe". The operator and enableRetinaEndpoint for the operator should be enabled.
* `enableAnnotations`: When this toggle is set to true, retina will gather metrics for the annotated resources. Namespaces or Pods can be annotated with "retina.sh/v1alpha=observe". The operator and enableRetinaEndpoint for the operator should be enabled.
* `enabledPlugin_linux`: Array of enabled plugins for linux.
* `enabledPlugin_win`: Array of enabled plugins for windows.
* `metricsInterval`: the interval for which metrics will be gathered.
Expand Down
2 changes: 1 addition & 1 deletion operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func main() {
Port: 9443,
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "16937e39.retina.io",
LeaderElectionID: "16937e39.retina.sh",

// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ func New(client client.Client, scheme *runtime.Scheme, metricsModule *mm.Module)
}
}

//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfiguration,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfiguration/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfiguration/finalizers,verbs=update
//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfiguration,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfiguration/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfiguration/finalizers,verbs=update

func (r *MetricsConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
mcc := &retinav1alpha1.MetricsConfiguration{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/daemon/retinaendpoint/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func New(client client.Client, cache *cache.Cache) *RetinaEndpointReconciler {
}
}

// +kubebuilder:rbac:groups=retina.io,resources=retinaendpoints,verbs=get;list;watch
// +kubebuilder:rbac:groups=retina.sh,resources=retinaendpoints,verbs=get;list;watch
func (r *RetinaEndpointReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
startTime := time.Now()
r.l.Info("Reconciling RetinaEndpoint", zap.String("RetinaEndpoint", req.NamespacedName.String()))
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/operator/capture/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ func NewCaptureReconciler(client client.Client, scheme *runtime.Scheme, kubeClie
return cr
}

//+kubebuilder:rbac:groups=retina.io,resources=captures,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=retina.io,resources=captures/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=retina.io,resources=captures/finalizers,verbs=update
//+kubebuilder:rbac:groups=retina.sh,resources=captures,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=retina.sh,resources=captures/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=retina.sh,resources=captures/finalizers,verbs=update
//+kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch;create;update;patch;delete;deletecollection
//+kubebuilder:rbac:groups=batch,resources=jobs/status,verbs=get
//+kubebuilder:rbac:groups="",resources=secrets,verbs=get;list
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func New(client client.Client, scheme *runtime.Scheme) *MetricsConfigurationReco
}
}

//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfigurations,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfigurations/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.retina.io,resources=metricsconfigurations/finalizers,verbs=update
//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfigurations,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfigurations/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.retina.sh,resources=metricsconfigurations/finalizers,verbs=update

func (r *MetricsConfigurationReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
mcc := &retinav1alpha1.MetricsConfiguration{}
Expand Down
6 changes: 3 additions & 3 deletions pkg/controllers/operator/pod/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ func New(client client.Client, scheme *k8sruntime.Scheme, podchannel chan<- cach
}
}

//+kubebuilder:rbac:groups=operator.retina.io,resources=pods,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=operator.retina.io,resources=pods/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.retina.io,resources=pods/finalizers,verbs=update
//+kubebuilder:rbac:groups=operator.retina.sh,resources=pods,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=operator.retina.sh,resources=pods/status,verbs=get;update;patch
//+kubebuilder:rbac:groups=operator.retina.sh,resources=pods/finalizers,verbs=update

func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
pod := &corev1.Pod{}
Expand Down
Loading

0 comments on commit 7c7953d

Please sign in to comment.