Skip to content
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
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,14 @@ crossplane-install:

# Install the Kubernetes provider using kubectl
crossplane-provider-install:
kubectl apply -f crossplane/provider.yaml -n $(CROSSPLANE_NAMESPACE)
kubectl apply -f examples/crossplane/provider.yaml -n $(CROSSPLANE_NAMESPACE)
kubectl wait --for=condition=Healthy provider/provider-helm --timeout=1m
kubectl apply -f crossplane/provider-config.yaml -n $(CROSSPLANE_NAMESPACE)
kubectl apply -f examples/crossplane/provider-config.yaml -n $(CROSSPLANE_NAMESPACE)



.PHONY: install-k8s-provider

.PHONY: helm-provider-sample
crossplane-provider-sample:
kubectl apply -f crossplane/release.yaml -n $(CROSSPLANE_NAMESPACE)
kubectl apply -f examples/crossplane/release.yaml -n $(CROSSPLANE_NAMESPACE)
8 changes: 8 additions & 0 deletions api/v1beta1/common_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package v1beta1

const (
// StatusTrue indicates the metric resource is considered ready/active.
StatusTrue = "True"
// StatusFalse indicates the metric resource is not ready/active.
StatusFalse = "False"
)
4 changes: 2 additions & 2 deletions examples/basic_metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
kind: Release
group: helm.crossplane.io
version: v1beta1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
---
apiVersion: metrics.cloud.sap/v1alpha1
kind: Metric
Expand All @@ -20,7 +20,7 @@ spec:
kind: Pod
group: ""
version: v1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
---
#apiVersion: metrics.cloud.sap/v1alpha1
#kind: Metric
Expand Down
7 changes: 7 additions & 0 deletions examples/crossplane/provider-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: helm.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
name: helm-provider
spec:
credentials:
source: InjectedIdentity
32 changes: 32 additions & 0 deletions examples/crossplane/provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: provider-helm
spec:
package: xpkg.upbound.io/crossplane-contrib/provider-helm:v0.17.0
runtimeConfigRef:
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
name: provider-helm
---
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
name: provider-helm
spec:
serviceAccountTemplate:
metadata:
name: provider-helm
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: provider-helm-cluster-admin
subjects:
- kind: ServiceAccount
name: provider-helm
namespace: crossplane-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
75 changes: 75 additions & 0 deletions examples/crossplane/release-oci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
apiVersion: v1
kind: Namespace
metadata:
name: wordpress2
---
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: wordpress-oci-example
spec:
# rollbackLimit: 3
forProvider:
chart:
name: wordpress
repository: "oci://localhost:5000/helm-charts"
version: 15.2.5
# pullSecretRef:
# name: oci-creds
# namespace: default
# url: "oci://localhost:5000/helm-charts/wordpress:9.3.19"
namespace: wordpress2
# insecureSkipTLSVerify: true
# skipCreateNamespace: true
# wait: true
# skipCRDs: true
values:
service:
type: ClusterIP
set:
- name: param1
value: value2
# valuesFrom:
# - configMapKeyRef:
# key: values.yaml
# name: default-vals
# namespace: wordpress
# optional: false
# - secretKeyRef:
# key: svalues.yaml
# name: svals
# namespace: wordpress
# optional: false
# connectionDetails:
# - apiVersion: v1
# kind: Service
# name: wordpress-example
# namespace: wordpress
# fieldPath: spec.clusterIP
# #fieldPath: status.loadBalancer.ingress[0].ip
# toConnectionSecretKey: ip
# - apiVersion: v1
# kind: Service
# name: wordpress-example
# namespace: wordpress
# fieldPath: spec.ports[0].port
# toConnectionSecretKey: port
# - apiVersion: v1
# kind: Secret
# name: wordpress-example
# namespace: wordpress
# fieldPath: data.wordpress-password
# toConnectionSecretKey: password
# - apiVersion: v1
# kind: Secret
# name: manual-api-secret
# namespace: wordpress
# fieldPath: data.api-key
# toConnectionSecretKey: api-key
# # this secret created manually (not via Helm chart), so skip 'part of helm release' check
# skipPartOfReleaseCheck: true
# writeConnectionSecretToRef:
# name: wordpress-credentials
# namespace: crossplane-system
providerConfigRef:
name: helm-provider
70 changes: 70 additions & 0 deletions examples/crossplane/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
apiVersion: helm.crossplane.io/v1beta1
kind: Release
metadata:
name: wordpress-example
spec:
# rollbackLimit: 3
forProvider:
chart:
name: wordpress
repository: https://charts.bitnami.com/bitnami
version: 15.2.5 ## To use development versions, set ">0.0.0-0"
# pullSecretRef:
# name: museum-creds
# namespace: default
# url: "https://charts.bitnami.com/bitnami/wordpress-9.3.19.tgz"
namespace: wordpress
# insecureSkipTLSVerify: true
# skipCreateNamespace: true
# wait: true
# skipCRDs: true
values:
service:
type: ClusterIP
set:
- name: param1
value: value2
# valuesFrom:
# - configMapKeyRef:
# key: values.yaml
# name: default-vals
# namespace: wordpress
# optional: false
# - secretKeyRef:
# key: svalues.yaml
# name: svals
# namespace: wordpress
# optional: false
# connectionDetails:
# - apiVersion: v1
# kind: Service
# name: wordpress-example
# namespace: wordpress
# fieldPath: spec.clusterIP
# #fieldPath: status.loadBalancer.ingress[0].ip
# toConnectionSecretKey: ip
# - apiVersion: v1
# kind: Service
# name: wordpress-example
# namespace: wordpress
# fieldPath: spec.ports[0].port
# toConnectionSecretKey: port
# - apiVersion: v1
# kind: Secret
# name: wordpress-example
# namespace: wordpress
# fieldPath: data.wordpress-password
# toConnectionSecretKey: password
# - apiVersion: v1
# kind: Secret
# name: manual-api-secret
# namespace: wordpress
# fieldPath: data.api-key
# toConnectionSecretKey: api-key
# # this secret created manually (not via Helm chart), so skip 'part of helm release' check
# skipPartOfReleaseCheck: true
# writeConnectionSecretToRef:
# name: wordpress-credentials
# namespace: crossplane-system
providerConfigRef:
name: helm-provider
2 changes: 1 addition & 1 deletion examples/dev-core/metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
kind: LandscaperDeployment
group: landscaper-service.gardener.cloud
version: v1alpha1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
---
2 changes: 1 addition & 1 deletion examples/fed-managed-resoruces/crossplane-managed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
spec:
name: xfed-managed
description: crossplane managed resources
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
federateCaRef:
name: federate-ca-sample
namespace: default
Expand Down
2 changes: 1 addition & 1 deletion examples/federated-resources/crdsdeletion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
resource: customresourcedefinitions
version: v1
fieldSelector: "metadata.deletionTimestamp"
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
projections:
- name: deletion
fieldPath: "metadata.deletionTimestamp"
Expand Down
2 changes: 1 addition & 1 deletion examples/federated-resources/entitlements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
group: account.btp.orchestrate.cloud.sap
resource: entitlements
version: v1alpha1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
projections:
- name: servicename
fieldPath: "spec.forProvider.serviceName"
Expand Down
2 changes: 1 addition & 1 deletion examples/federated-resources/serviceinstances.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
group: services.cloud.sap.com
resource: serviceinstances
version: v1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
federateCaRef:
name: federate-ca-sample
namespace: default
Expand Down
2 changes: 1 addition & 1 deletion examples/federated-resources/subaccounts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
group: account.btp.orchestrate.cloud.sap
resource: subaccounts
version: v1alpha1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
projections:
- name: region
fieldPath: "spec.forProvider.region"
Expand Down
2 changes: 1 addition & 1 deletion examples/managed_metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ spec:
kind: Release
group: helm.crossplane.io
version: v1beta1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
6 changes: 3 additions & 3 deletions examples/remoteclusteraccess/metric_with_rca.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ spec:
kind: ManagedControlPlane
group: cola.cloud.sap
version: v1alpha1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
remoteClusterAccessRef:
name: crate-cluster
namespace: test-monitoring
Expand All @@ -23,7 +23,7 @@ spec:
kind: CloudOrchestrator
group: cola.cloud.sap
version: v1alpha1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
remoteClusterAccessRef:
name: crate-cluster
namespace: test-monitoring
Expand All @@ -38,7 +38,7 @@ spec:
kind: DataPlane
group: cola.cloud.sap
version: v1alpha1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
remoteClusterAccessRef:
name: crate-cluster
namespace: test-monitoring
Expand Down
2 changes: 1 addition & 1 deletion examples/v1beta1/compmetric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
resource: pods
group: ""
version: v1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
projections:
- name: pod-namespace
fieldPath: "metadata.namespace"
Expand Down
2 changes: 1 addition & 1 deletion examples/v1beta1/fedmetric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
group: pkg.crossplane.io
resource: providers
version: v1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
projections:
- name: package
fieldPath: "spec.package"
Expand Down
4 changes: 2 additions & 2 deletions examples/v1beta1/singlemetric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
kind: Release
group: helm.crossplane.io
version: v1beta1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
---
apiVersion: metrics.cloud.sap/v1beta1
kind: SingleMetric
Expand All @@ -22,7 +22,7 @@ spec:
kind: Pod
group: ""
version: v1
frequency: 1 # in minutes
checkInterval: "1m" # in minutes
---
#apiVersion: metrics.cloud.sap/v1alpha1
#kind: Metric
Expand Down
Loading
Loading