Add documentation for private data source connect using kubernetes (#63863)

pull/63742/head^2
Georges Chaudy 2 years ago committed by GitHub
parent 913cb17eac
commit b009ba6cd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      docs/sources/setup-grafana/configure-security/configure-private-datasource-connect/index.md

@ -93,9 +93,33 @@ To set up a private data source connection, follow these steps:
1. Connect to Grafana Cloud using the ssh or the pdc agent in the same directory as your private key, and the certificate and known_hosts file Grafana Labs provided to you.
There are two options for connecting: SSH, or the PDC Agent Docker image.
There are three connecting options: Kubernetes, SSH, or the PDC Agent Docker image.
- **Option 1:** Using SSH
- **Option 1:** Using Kubernetes
Create a Kubernetes secret with the private key and the certificate and known_hosts file Grafana Labs provided.
```
$ kubectl create secret generic -n ${NAMESPACE} grafana-pdc-agent \
--from-file=key=./${SLUG} \
--from-file=known_hosts=./known_hosts \
--from-file=cert.pub=./${SLUG}-cert.pub
```
Generate a Kubernetes deployment to deploy the agent.
```
SLUG=${SLUG} PDC_GATEWAY=${PDC_GATEWAY} NAMESPACE=${NAMESPACE} /bin/sh -c "$(curl -fsSL https://raw.githubusercontent.com/grafana/pdc-agent/main/production/kubernetes/install-agent.sh)"
kubectl apply -f deployment.yaml
```
The following list contains the environment variables used in the previous commands:
- ${PDC_GATEWAY}: The URL of the private data source connect in Grafana Cloud. The Grafana team will give you this URL. The URL follows the format `grafana-private-datasource-connect-<cluster>.grafana.net`
- ${SLUG}: The name of the stack you want to connect to your data source. For example, the stack `test.grafana.net` has the slug `test.`
- ${NAMESPACE}: The Kubernetes namespace for the pdc-agent.
- **Option 2:** Using SSH
```
$ ssh -i ${SLUG} ${SLUG}@${PDC_GATEWAY} -p 22 -o UserKnownHostsFile=./known_hosts -o CertificateFile=${SLUG}-cert.pub -R 0 -vv
@ -118,7 +142,7 @@ To set up a private data source connection, follow these steps:
- ${PDC_GATEWAY}: The URL of the private data source connect in Grafana Cloud. The Grafana team will give you this URL. The URL follows the format `private-datasource-connect-<cluster>.grafana.net`
- ${SLUG}: The name of the stack you want to connect to your data source. For example, the stack `test.grafana.net` has the slug `test.`
- **Option 2:** Using the [pdc-agent](https://github.com/grafana/pdc-agent) docker [image](https://hub.docker.com/r/grafana/pdc-agent/tags)
- **Option 3:** Using the [pdc-agent](https://github.com/grafana/pdc-agent) docker [image](https://hub.docker.com/r/grafana/pdc-agent/tags)
```
docker run --rm --name pdc-agent -v $(pwd):/etc/keys grafana/pdc-agent:latest -i /etc/keys/${SLUG} ${SLUG}@${PDC_GATEWAY} -p 22 -o BatchMode=yes -o UserKnownHostsFile=/etc/keys/known_hosts -o CertificateFile=/etc/keys/${SLUG}-cert.pub -R 0 -v

Loading…
Cancel
Save