Skip to content

Commit

Permalink
feat: merge pull request #30 from krateoplatformops/29-manager-bearer…
Browse files Browse the repository at this point in the history
…-tokens-through-secrets

29 manager bearer tokens through secrets
  • Loading branch information
FrancescoL96 authored Jul 14, 2024
2 parents f25db58 + 9512b50 commit 0ba3f5d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 59 deletions.
58 changes: 4 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,62 +24,12 @@ The exporter container is created in the namespace of the CR. The exporter conta
- Access to a Kubernetes v1.11.3+ cluster.

### To Deploy on the cluster
**Build and push your image to the location specified by `IMG`:**

```sh
IMG=<some-registry>/operator-exporter:tag ./scripts/docker-build-push.sh
```

**NOTE:** This image ought to be published in the personal registry you specified.
And it is required to have access to pull the image from the working environment.
Make sure you have the proper permission to the registry if the above commands don’t work.

**Deploy the Manager to the cluster with the image specified by `IMG`:**
**the REPO variable is mandatory. This variable points to the repository for the prometheus-exporter-generic image**

```sh
IMG=<some-registry>/operator-exporter:tag REPO=<some-registry> ./scripts/deploy.sh
```

> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
privileges or be logged in as admin.

**Create instances of your solution**
You can apply the samples (examples) from the config/sample:

```sh
kubectl apply -k config/samples/
```

>**NOTE**: Ensure that the samples has default values to test it out.
### To Uninstall
**Delete the instances (CRs) from the cluster:**

```sh
kubectl delete -k config/samples/
```

**UnDeploy the controller from the cluster:**

## Installation with HELM
```sh
./scripts/undeploy.sh
$ helm repo add krateo https://charts.krateo.io
$ helm repo update krateo
$ helm install finops-operator-exporter krateo/finops-operator-exporter
```
## License

Copyright 2024.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

## Tested platforms
- Azure
Expand Down
12 changes: 7 additions & 5 deletions api/v1/exporterscraperconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ type ExporterConfig struct {
Provider ObjectRef `yaml:"provider" json:"provider"`
Url string `yaml:"url" json:"url"`
// +optional
UrlParsed string `yaml:"urlParsed" json:"urlParsed,omitempty"`
RequireAuthentication bool `yaml:"requireAuthentication" json:"requireAuthentication"`
AuthenticationMethod string `yaml:"authenticationMethod" json:"authenticationMethod"`
PollingIntervalHours int `yaml:"pollingIntervalHours" json:"pollingIntervalHours"`
AdditionalVariables map[string]string `yaml:"additionalVariables" json:"additionalVariables"`
UrlParsed string `yaml:"urlParsed" json:"urlParsed,omitempty"`
RequireAuthentication bool `yaml:"requireAuthentication" json:"requireAuthentication"`
AuthenticationMethod string `yaml:"authenticationMethod" json:"authenticationMethod"`
// +optional
BearerToken ObjectRef `yaml:"bearerToken" json:"bearerToken"`
PollingIntervalHours int `yaml:"pollingIntervalHours" json:"pollingIntervalHours"`
AdditionalVariables map[string]string `yaml:"additionalVariables" json:"additionalVariables"`
}

type ScraperConfig struct {
Expand Down
1 change: 1 addition & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions config/crd/bases/finops.krateo.io_exporterscraperconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ spec:
type: object
authenticationMethod:
type: string
bearerToken:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
pollingIntervalHours:
type: integer
provider:
Expand Down

0 comments on commit 0ba3f5d

Please sign in to comment.