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

Restructure sample folders and add dockerfile for codeModules image #820

Merged
merged 4 commits into from
Jun 7, 2022
Merged
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
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Dynatrace Operator supports rollout and lifecycle management of various Dyna
* `kubernetes-monitoring` allows monitoring of the Kubernetes API
* `metrics-ingest` routes enriched metrics through ActiveGate

For more information please have a look at [our DynaKube Custom Resource examples](config/samples) and
For more information please have a look at [our DynaKube Custom Resource examples](assets/samples) and
our [official help page](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/kubernetes/).

## Supported platforms
Expand Down Expand Up @@ -52,15 +52,7 @@ type *Dynatrace API* and use its values in the following commands respectively.
assistance please refer
to [Create user-generated access tokens](https://www.dynatrace.com/support/help/get-started/access-tokens#create-api-token).

Make sure the tokens have the following permissions:
* API Token
* Read Configuration
* Write Configuration
* Read Entities (if using automatic kubernetes api monitoring)
* Installer Download
* Access problem and event feed, metrics and topology
* Data Ingest Token
* Ingest Metrics
The token scopes required by the Dynatrace Operator are documented on our [official help page](https://www.dynatrace.com/support/help/setup-and-configuration/setup-on-container-platforms/kubernetes/get-started-with-kubernetes-monitoring#tokens)

```sh
$ kubectl -n dynatrace create secret generic dynakube --from-literal="apiToken=DYNATRACE_API_TOKEN" --from-literal="dataIngestToken=DATA_INGEST_TOKEN"
Expand All @@ -75,8 +67,8 @@ contain parameters for various Dynatrace capabilities (OneAgent deployment mode,
>
> If not specified Dynatrace Operator searches for a secret called like the DynaKube custom resource `.metadata.name`.

The recommended approach is using classic Fullstack injection to roll out Dynatrace to your cluster, available as [classicFullStack sample](config/samples/classicFullStack.yaml).
In case you want to have adjustments please have a look at [our DynaKube Custom Resource examples](config/samples).
The recommended approach is using classic Fullstack injection to roll out Dynatrace to your cluster, available as [classicFullStack sample](assets/samples/classicFullStack.yaml).
In case you want to have adjustments please have a look at [our DynaKube Custom Resource examples](assets/samples).

Save one of the sample configurations, change the API url to your environment and apply it to your cluster.
```sh
Expand Down
17 changes: 17 additions & 0 deletions assets/docker/codeModulesAMD.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM alpine AS builder

ARG APIURL
ARG APITOKEN
ARG AGENTVERSION
ARG FLAVOR=multidistro
ARG ARCH=x86

RUN apk update && apk add --update jq
RUN mkdir data
RUN wget "${APIURL}/v1/deployment/installer/agent/unix/paas/version/${AGENTVERSION}/checksum?flavor=${FLAVOR}&arch=${ARCH}&bitness=all&skipMetadata=true" --header "Authorization: Api-Token ${APITOKEN}" -O checksum
RUN wget "${APIURL}/v1/deployment/installer/agent/unix/paas/version/${AGENTVERSION}?flavor=${FLAVOR}&arch=${ARCH}&bitness=all&skipMetadata=true" --header "Authorization: Api-Token ${APITOKEN}" -O /agent.zip
RUN [ "$(jq .sha256 -r checksum)" == "$(sha256sum agent.zip | awk '{ print $1 }')" ]
RUN unzip /agent.zip -d /data

FROM scratch
COPY --from=builder /data /
17 changes: 17 additions & 0 deletions assets/docker/codeModulesARM.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM alpine AS builder

ARG APIURL
ARG APITOKEN
ARG AGENTVERSION
ARG FLAVOR=default
ARG ARCH=arm

RUN apk update && apk add --update jq
RUN mkdir data
RUN wget "${APIURL}/v1/deployment/installer/agent/unix/paas/version/${AGENTVERSION}/checksum?flavor=${FLAVOR}&arch=${ARCH}&bitness=all&skipMetadata=true" --header "Authorization: Api-Token ${APITOKEN}" -O checksum
RUN wget "${APIURL}/v1/deployment/installer/agent/unix/paas/version/${AGENTVERSION}?flavor=${FLAVOR}&arch=${ARCH}&bitness=all&skipMetadata=true" --header "Authorization: Api-Token ${APITOKEN}" -O /agent.zip
RUN [ "$(jq .sha256 -r checksum)" == "$(sha256sum agent.zip | awk '{ print $1 }')" ]
RUN unzip /agent.zip -d /data

FROM scratch
COPY --from=builder /data /
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources:
- ../default
- ../samples
- ../../assets/samples
- ../scorecard
2 changes: 1 addition & 1 deletion config/olm/kubernetes/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../deploy/kubernetes
- ../../samples
- ../../../assets/samples
2 changes: 1 addition & 1 deletion config/olm/openshift/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../../deploy/openshift
- ../../samples
- ../../../assets/samples