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

Update EdgeConnect samples (#3734) #3828

Open
wants to merge 1 commit into
base: main
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
93 changes: 93 additions & 0 deletions assets/samples/edgeconnect/automation-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
apiVersion: dynatrace.com/v1alpha2
kind: EdgeConnect
metadata:
name: edge-connect-sample
namespace: dynatrace
spec:
# Documentation:
# https://docs.dynatrace.com/docs/setup-and-configuration/setup-on-k8s/guides/operation/edgeconnect/kubernetes-automation/edge-connect-kubernetes-automation-operator-supported-setup

apiServer: "https://example.dev.apps.dynatracelabs.com"
replicas: 1

# The service account has to have the proper permissions that match the purpose of the
# workflow steps this EdgeConnect is used for.
serviceAccountName: edgeconnect-automation

# Enable K8S Automation for workflows
kubernetesAutomation:
enabled: true

oauth:
# OAuth client has to be created in Dynatrace account management
# https://docs.dynatrace.com/docs/shortlink/account-api-authentication#create-an-oauth2-client
#
# Please consult https://docs.dynatrace.com/docs/setup-and-configuration/setup-on-k8s/guides/operation/edgeconnect/kubernetes-automation/edge-connect-kubernetes-automation-operator-supported-setup
# for the scopes required specific to EdgeConnect with Kubernetes Automation enabled
clientSecret: provisioner-automation-oauth-client-secret
endpoint: https://sso-dev.dynatracelabs.com/sso/oauth2/token
resource: urn:dtaccount:cd99bbd6-3b73-467e-b1fb-c09b9db9e7cc

# Mandatory to be true for K8S automation
provisioner: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
annotations:
name: edgeconnect-automation
namespace: dynatrace
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: edgeconnect-automation
rules:
# The required permissions depend on the requirements of the workflow steps that use this edgeconnect.
# This is just an example.
- apiGroups:
- ""
resources:
- pods
- namespaces
- services
verbs:
- list
- get
- apiGroups:
- apps
resources:
- deployments
- replicasets
- statefulsets
- daemonsets
verbs:
- list
- get
- apiGroups:
- dynatrace.com
resources:
- dynakubes
verbs:
- list
- get
- nonResourceURLs:
- /metrics
- /version
- /readyz
- /livez
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: edgeconnect-automation
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: edgeconnect-automation
subjects:
- kind: ServiceAccount
name: edgeconnect-automation
namespace: dynatrace
2 changes: 1 addition & 1 deletion assets/samples/edgeconnect/edgeconnect.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: dynatrace.com/v1alpha1
apiVersion: dynatrace.com/v1alpha2
kind: EdgeConnect
metadata:
name: edge-connect-sample
Expand Down
24 changes: 24 additions & 0 deletions assets/samples/edgeconnect/provisioner.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: dynatrace.com/v1alpha2
kind: EdgeConnect
metadata:
name: edge-connect-sample
namespace: dynatrace
spec:
# Documentation:
# https://docs.dynatrace.com/docs/setup-and-configuration/setup-on-k8s/guides/operation/edgeconnect/edge-connect-provision

apiServer: "https://example.dev.apps.dynatracelabs.com"
replicas: 1

oauth:
# OAuth client has to be created in Dynatrace account management
# https://docs.dynatrace.com/docs/shortlink/account-api-authentication#create-an-oauth2-client
#
# Please consult https://docs.dynatrace.com/docs/setup-and-configuration/setup-on-k8s/guides/operation/edgeconnect/edge-connect-provision
# for the scopes required specific to EdgeConnect with Kubernetes Automation enabled
clientSecret: provisioner-oauth-client-secret
endpoint: https://sso-dev.dynatracelabs.com/sso/oauth2/token
resource: urn:dtaccount:cd99bbd6-3b73-467e-b1fb-c09b9db9e7cc

# Enable EdgeConnect provisioning
provisioner: true
Loading