-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2d18450
Showing
5 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# k3d Cluster | ||
|
||
## Create | ||
``` | ||
sudo k3d cluster create crossplane-demo | ||
sudo k3d kubeconfig merge crossplane-demo --kubeconfig-switch-context -o /home/<username>/.kube/config | ||
sudo chown <username>:<username> ~/.kube/config | ||
``` | ||
|
||
## Start and Stop | ||
``` | ||
sudo k3d cluster stop crossplane-demo | ||
sudo k3d cluster start crossplane-demo | ||
``` | ||
|
||
# Crossplane | ||
https://docs.crossplane.io/latest/software/install/ | ||
|
||
## Install via Helm | ||
``` | ||
helm repo add crossplane-stable https://charts.crossplane.io/stable | ||
helm repo update | ||
``` | ||
|
||
``` | ||
helm install crossplane \ | ||
--namespace crossplane-system \ | ||
--create-namespace crossplane-stable/crossplane | ||
``` | ||
|
||
# Crossplane UI | ||
|
||
## Install via Helm | ||
``` | ||
helm repo add komodorio https://helm-charts.komodor.io | ||
helm repo update | ||
helm install komoplane komodorio/komoplane --set "ingress.enabled=true,ingress.hosts[0].host=komoplane.k8s.local,ingress.hosts[0].paths[0].path=/,ingress.hosts[0].paths[0].pathType=ImplementationSpecific" | ||
``` | ||
|
||
Add entry to /etc/hosts | ||
``` | ||
<LoadBalancerIP> komoplane.k8s.local | ||
``` | ||
|
||
Crossplane UI URL: http://komoplane.k8s.local/ | ||
|
||
# Testing with Grafana | ||
## Install Grafana via Helm | ||
https://github.com/grafana/helm-charts/blob/main/charts/grafana/README.md | ||
|
||
|
||
``` | ||
helm repo add grafana https://grafana.github.io/helm-charts | ||
helm repo update | ||
helm install my-release grafana/grafana --set "adminUser=admin,adminPassword=password,ingress.enabled=true,ingress.hosts[0]=grafana.k8s.local" | ||
``` | ||
|
||
Add entry to /etc/hosts | ||
``` | ||
<LoadBalancerIP> grafana.k8s.local | ||
``` | ||
|
||
Grafana URL: http://grafana.k8s.local/ | ||
|
||
## Install Crossplane Grafana Provider | ||
[Grafana Provider](https://marketplace.upbound.io/providers/grafana/provider-grafana/v0.8.0) was generated by [upjet](https://github.com/upbound/upjet). | ||
|
||
Therefore Provider configuration can be inferred by: | ||
https://registry.terraform.io/providers/grafana/grafana/latest/docs#schema | ||
|
||
|
||
``` | ||
kubectl apply -f ./k8s/crossplane | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: pkg.crossplane.io/v1 | ||
kind: Provider | ||
metadata: | ||
name: provider-grafana | ||
spec: | ||
package: xpkg.upbound.io/grafana/provider-grafana:v0.8.0 | ||
packagePullPolicy: IfNotPresent | ||
revisionActivationPolicy: Automatic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: provider-grafana-config-creds | ||
namespace: crossplane-system | ||
type: Opaque | ||
stringData: | ||
credentials: | | ||
{ | ||
"url": "http://my-release-grafana.default", | ||
"auth": "admin:password" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: grafana.crossplane.io/v1beta1 | ||
kind: ProviderConfig | ||
metadata: | ||
name: local-grafana-instance-config | ||
spec: | ||
credentials: | ||
source: Secret | ||
secretRef: | ||
namespace: crossplane-system | ||
name: provider-grafana-config-creds | ||
key: credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: Folder | ||
metadata: | ||
name: local-test-folder-1 | ||
spec: | ||
forProvider: | ||
title: 'Crossplane Folder Test!' | ||
providerConfigRef: | ||
name: local-grafana-instance-config | ||
--- | ||
apiVersion: oss.grafana.crossplane.io/v1alpha1 | ||
kind: Folder | ||
metadata: | ||
name: local-test-folder-2 | ||
spec: | ||
forProvider: | ||
title: 'Another Crossplane Folder Test!' | ||
providerConfigRef: | ||
name: local-grafana-instance-config | ||
--- |