Skip to content

Commit

Permalink
Merge branch 'main' into decouple-ui
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/resources/application.yaml
  • Loading branch information
carlosthe19916 committed Nov 13, 2024
2 parents 1554d0e + 6350930 commit 9cc6aba
Show file tree
Hide file tree
Showing 16 changed files with 613 additions and 7 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/helm-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Helm Chart Build

on:
workflow_dispatch:
push:
branches:
- "main"
- "release-*"

concurrency:
group: helm-${{ github.ref }}
cancel-in-progress: true

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Extract tag
id: extract_tag
run: |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi)
echo "tag=$tag" >> $GITHUB_OUTPUT
outputs:
tag: ${{ steps.extract_tag.outputs.tag }}

helm-build:
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
cache: "maven"
- name: Create Helm
run: |
## Set -Dquarkus.container-image.tag as empty to remove the "v" prefix from the container image of Deployment
mvn package -DskipTests -Dquarkus.container-image.tag=
# YQ
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
APP_IMAGE_TAG=$TAG yq e -i '.appVersion=strenv(APP_IMAGE_TAG)' target/helm/Chart.yaml
env:
TAG: ${{ needs.prepare.outputs.tag }}
- name: Git add Helm
id: git-add-helm
continue-on-error: true
run: |
cp -R target/helm/ ./
if [ -z $(git status --porcelain) ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo git status
git add helm/*
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and Push
uses: trustification/release-tools/.github/actions/commit@main
if: steps.git-add-helm.outputs.has_changes == 'true'
with:
commit_message: "🔅 Helm chart update"
branch: ${{github.ref_name}}
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Quick Start - Helm Chart

If you want to give a quick try of the operator without the whole glory of OLM you can deploy our Operator using Helm.

- Start minikube:

```shell
minikube start --addons=ingress,dashboard
```

- Install the Helm Chart:

```shell
helm install myhelm helm/
```

- Create an instance of Trustify:

```shell
cat << EOF | kubectl apply -f -
apiVersion: "org.trustify/v1alpha1"
kind: "Trustify"
metadata:
name: myapp
spec: { }
EOF
```

# Local development

## Minikube
Expand Down
5 changes: 5 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "trustify-operator"
version: "1.0.0-SNAPSHOT"
apiVersion: "v2"
appVersion: "latest"
10 changes: 10 additions & 0 deletions helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Configuration

The following values are configurable:

- `watchNamespaces` - namespaces to be watched, either:
- a list of comma-separated namespace names
- `JOSDK_ALL_NAMESPACES` to watch all namespaces
- `JOSDK_WATCH_CURRENT` to watch only the namespace in which the operator is deployed
- `version` - the current version of the application.

203 changes: 203 additions & 0 deletions helm/crds/trustifies.org.trustify-v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
# Generated by Fabric8 CRDGenerator, manual edits might get overwritten!
apiVersion: "apiextensions.k8s.io/v1"
kind: "CustomResourceDefinition"
metadata:
name: "trustifies.org.trustify"
spec:
group: "org.trustify"
names:
kind: "Trustify"
plural: "trustifies"
singular: "trustify"
scope: "Namespaced"
versions:
- name: "v1alpha1"
schema:
openAPIV3Schema:
properties:
spec:
properties:
db:
description: "In this section you can find all properties related\
\ to connect to a database."
properties:
externalDatabase:
description: "Use external database."
type: "boolean"
host:
description: "The host of the database."
type: "string"
name:
description: "The database name."
type: "string"
passwordSecret:
description: "The reference to a secret holding the password of\
\ the database user."
properties:
key:
type: "string"
name:
type: "string"
optional:
type: "boolean"
type: "object"
port:
description: "The port of the database."
type: "string"
pvcSize:
description: "Size of the PVC to create. Valid only if externalDatabase=false"
type: "string"
resourceLimits:
description: "In this section you can configure resource limits\
\ settings. Valid only if externalDatabase=false"
properties:
cpuLimit:
description: "Limit CPU."
type: "string"
cpuRequest:
description: "Requested CPU."
type: "string"
memoryLimit:
description: "Limit Memory."
type: "string"
memoryRequest:
description: "Requested memory."
type: "string"
type: "object"
usernameSecret:
description: "The reference to a secret holding the username of\
\ the database user."
properties:
key:
type: "string"
name:
type: "string"
optional:
type: "boolean"
type: "object"
type: "object"
dbImage:
description: "Custom Trustify DB Server image to be used. For internal\
\ use only"
type: "string"
hostname:
description: "In this section you can configure hostname and related\
\ properties."
properties:
hostname:
description: "Hostname for the server."
type: "string"
type: "object"
http:
description: "In this section you can configure features related to\
\ HTTP and HTTPS"
properties:
tlsSecret:
description: "A secret containing the TLS configuration for HTTPS.\
\ Reference: https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets."
type: "string"
type: "object"
imagePullPolicy:
description: "Custom Image Pull Policy for images managed by the Operator"
type: "string"
imagePullSecrets:
description: "Secret(s) that might be used when pulling an image from\
\ a private container image registry or repository."
items:
properties:
name:
type: "string"
type: "object"
type: "array"
oidc:
description: "In this section you can configure Oidc settings."
properties:
enabled:
description: "Enable Oidc Auth."
type: "boolean"
serverClientId:
description: "Oidc client id for the Server."
type: "string"
serverUrl:
description: "Oidc server url."
type: "string"
uiClientId:
description: "Oidc client id for the UI."
type: "string"
type: "object"
serverImage:
description: "Custom Trustify Server image to be used. For internal\
\ use only"
type: "string"
serverResourceLimits:
description: "In this section you can configure resource limits settings\
\ for the Server."
properties:
cpuLimit:
description: "Limit CPU."
type: "string"
cpuRequest:
description: "Requested CPU."
type: "string"
memoryLimit:
description: "Limit Memory."
type: "string"
memoryRequest:
description: "Requested memory."
type: "string"
type: "object"
storage:
description: "In this section you can configure Storage settings."
properties:
compression:
description: "Storage compression."
enum:
- "NONE"
- "ZSTD"
type: "string"
filesystem:
properties:
pvcSize:
description: "Size of the PVC to create."
type: "string"
type: "object"
s3:
properties:
accessKey:
description: "Access key."
type: "string"
bucket:
description: "Bucket name."
type: "string"
region:
description: "Region name."
type: "string"
secretKey:
description: "Secret key."
type: "string"
type: "object"
type:
description: "Storage type."
enum:
- "FILESYSTEM"
- "S3"
type: "string"
type: "object"
type: "object"
status:
properties:
conditions:
items:
properties:
status:
type: "string"
type:
type: "string"
type: "object"
type: "array"
type: "object"
type: "object"
served: true
storage: true
subresources:
status: {}
Empty file.
Loading

0 comments on commit 9cc6aba

Please sign in to comment.