Skip to content

Commit

Permalink
Merge branch 'main' of github.com:DataDog/datadog-operator into v0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
clamoriniere committed May 1, 2021
2 parents d96d4ce + 3786eb0 commit c46fa38
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from a cluster

deploy: manifests kustomize ## Deploy controller in the configured Kubernetes cluster in ~/.kube/config
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -
$(KUSTOMIZE) build config/default | kubectl apply --force-conflicts --server-side -f -

undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/default | kubectl delete -f -
Expand Down
22 changes: 22 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,13 @@ rules:
- get
- list
- watch
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- get
- apiGroups:
- authorization.k8s.io
resources:
Expand Down Expand Up @@ -285,6 +292,13 @@ rules:
- patch
- update
- watch
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
- get
- apiGroups:
- autoscaling
resources:
Expand Down Expand Up @@ -392,6 +406,14 @@ rules:
- get
- list
- watch
- apiGroups:
- external.metrics.k8s.io
resources:
- '*'
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
Expand Down
4 changes: 4 additions & 0 deletions controllers/datadogagent/clusteragent.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,10 @@ func getEnvVarsForClusterAgent(logger logr.Logger, dda *datadoghqv1alpha1.Datado
Name: datadoghqv1alpha1.DDCollectKubeEvents,
Value: datadoghqv1alpha1.BoolToString(spec.ClusterAgent.Config.CollectEvents),
},
{
Name: datadoghqv1alpha1.DDHealthPort,
Value: strconv.Itoa(int(datadoghqv1alpha1.DefaultAgentHealthPort)),
},
}

if spec.ClusterName != "" {
Expand Down
8 changes: 8 additions & 0 deletions controllers/datadogagent/clusteragent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func clusterAgentDefaultEnvVars() []corev1.EnvVar {
Name: "DD_COLLECT_KUBERNETES_EVENTS",
Value: "false",
},
{
Name: "DD_HEALTH_PORT",
Value: "5555",
},
{
Name: "DD_API_KEY",
ValueFrom: apiKeyValue(),
Expand Down Expand Up @@ -141,6 +145,10 @@ func clusterAgentWithAdmissionControllerDefaultEnvVars(serviceName string, unlab
Name: "DD_COLLECT_KUBERNETES_EVENTS",
Value: "false",
},
{
Name: "DD_HEALTH_PORT",
Value: "5555",
},
{
Name: "DD_API_KEY",
ValueFrom: apiKeyValue(),
Expand Down
7 changes: 5 additions & 2 deletions controllers/datadogagent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,19 @@ type DatadogAgentReconciler struct {

// Configure Admission Controller
// +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=mutatingwebhookconfigurations,verbs=*
// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get
// +kubebuilder:rbac:groups=apps,resources=replicasets,verbs=get
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get
// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get
// +kubebuilder:rbac:groups=authentication.k8s.io,resources=tokenreviews,verbs=create;get
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create;get
// +kubebuilder:rbac:groups=batch,resources=cronjobs,verbs=get
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get

// Configure External Metrics server
// +kubebuilder:rbac:groups=apiregistration.k8s.io,resources=apiservices,verbs=*
// +kubebuilder:rbac:groups=datadoghq.com,resources=watermarkpodautoscalers,verbs=get;list;watch
// +kubebuilder:rbac:groups=external.metrics.k8s.io,resources=*,verbs=get;list;watch

// Use ExtendedDaemonSet
// +kubebuilder:rbac:groups=datadoghq.com,resources=extendeddaemonsets,verbs=get;list;watch;create;update;patch;delete
Expand Down

0 comments on commit c46fa38

Please sign in to comment.