This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(operator): Add Quarkus Operator
Fixes #898
- Loading branch information
Showing
22 changed files
with
677 additions
and
2 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
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,15 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: launchers.launcher.fabric8.io | ||
spec: | ||
group: launcher.fabric8.io | ||
names: | ||
kind: Launcher | ||
listKind: LauncherList | ||
plural: launchers | ||
singular: launcher | ||
scope: Namespaced | ||
version: v1alpha2 | ||
subresources: | ||
status: {} |
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,51 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: launcher-operator | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
name: launcher-operator | ||
template: | ||
metadata: | ||
labels: | ||
name: launcher-operator | ||
spec: | ||
serviceAccountName: launcher-operator | ||
containers: | ||
- name: launcher-operator | ||
image: quay.io/gastaldi/launcher-operator:latest | ||
ports: | ||
- containerPort: 60000 | ||
name: metrics | ||
imagePullPolicy: Always | ||
readinessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 4 | ||
periodSeconds: 10 | ||
timeoutSeconds: 10 | ||
failureThreshold: 1 | ||
livenessProbe: | ||
httpGet: | ||
path: /health | ||
port: 8080 | ||
scheme: HTTP | ||
initialDelaySeconds: 4 | ||
periodSeconds: 10 | ||
timeoutSeconds: 10 | ||
failureThreshold: 1 | ||
env: | ||
- name: WATCH_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: OPERATOR_NAME | ||
value: "launcher-operator" |
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,72 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
creationTimestamp: null | ||
name: launcher-operator | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- services | ||
- endpoints | ||
- persistentvolumeclaims | ||
- events | ||
- configmaps | ||
- secrets | ||
- serviceaccounts | ||
- processedtemplates.template.openshift.io | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- template.openshift.io | ||
resources: | ||
- processedtemplates | ||
verbs: [ get, list, create, update, delete, deletecollection, watch] | ||
- apiGroups: | ||
- "" | ||
- apps.openshift.io | ||
resources: | ||
- deploymentconfigs | ||
- deploymentconfigs/instantiate | ||
verbs: [ get, list, create, update, delete, deletecollection, watch] | ||
- apiGroups: | ||
- route.openshift.io | ||
resources: | ||
- routes | ||
- routes/custom-host | ||
verbs: [ get, list, create, update, delete, deletecollection, watch] | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- namespaces | ||
verbs: | ||
- get | ||
- apiGroups: | ||
- apps | ||
resources: | ||
- deployments | ||
- daemonsets | ||
- replicasets | ||
- statefulsets | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- monitoring.coreos.com | ||
resources: | ||
- servicemonitors | ||
verbs: | ||
- get | ||
- create | ||
- apiGroups: | ||
- launcher.fabric8.io | ||
resources: | ||
- '*' | ||
verbs: | ||
- '*' | ||
- apiGroups: | ||
- apiextensions.k8s.io | ||
resources: | ||
- customresourcedefinitions | ||
verbs: | ||
- list |
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 @@ | ||
kind: RoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: launcher-operator | ||
subjects: | ||
- kind: ServiceAccount | ||
name: launcher-operator | ||
roleRef: | ||
kind: Role | ||
name: launcher-operator | ||
apiGroup: rbac.authorization.k8s.io |
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,4 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: launcher-operator |
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,78 @@ | ||
apiVersion: launcher.fabric8.io/v1alpha2 | ||
kind: Launcher | ||
metadata: | ||
name: example-launcher | ||
environment: production | ||
spec: | ||
catalog: | ||
repositoryUrl: http://github.com/fabric8-launcher/launcher-booster-catalog | ||
repositoryRef: master | ||
filter: filter expression | ||
reindexToken: token | ||
openshift: | ||
apiUrl: apiUrl (default is the same cluster as the operator is installed) | ||
consoleUrl: consoleUrl | ||
subscriptionToken: token | ||
username: username | ||
password: password | ||
token: | ||
valueFrom: | ||
secretKeyRef: | ||
name: openshift-test-secret | ||
key: token | ||
impersonate: true | ||
clusters: | ||
- id: starter-us-east-1 | ||
name: "Starter: US East (Virginia)" | ||
apiUrl: https://api.starter-us-east-1.openshift.com | ||
consoleUrl: https://console.starter-us-east-1.openshift.com | ||
type: starter | ||
- id: starter-us-west-1 | ||
name: "Starter: US West (California)" | ||
apiUrl: https://api.starter-us-west-1.openshift.com | ||
consoleUrl: https://console.starter-us-west-1.openshift.com | ||
type: starter | ||
- id: starter-us-west-2 | ||
name: "Starter: US West (Oregon)" | ||
apiUrl: https://api.starter-us-west-2.openshift.com | ||
consoleUrl: https://console.starter-us-west-2.openshift.com | ||
type: starter | ||
- id: starter-ca-central-1 | ||
name: "Starter: Canada (Central)" | ||
apiUrl: https://api.starter-ca-central-1.openshift.com | ||
consoleUrl: https://console.starter-ca-central-1.openshift.com | ||
type: starter | ||
- id: pro-us-east-1 | ||
name: "Pro: US East (N. Virginia)" | ||
apiUrl: https://api.pro-us-east-1.openshift.com | ||
consoleUrl: https://console.pro-us-east-1.openshift.com | ||
type: pro | ||
- id: pro-eu-west-1 | ||
name: "Pro: EU West (Ireland)" | ||
apiUrl: https://api.pro-eu-west-1.openshift.com | ||
consoleUrl: https://console.pro-eu-west-1.openshift.com | ||
type: pro | ||
- id: pro-ap-southeast-2 | ||
name: "Pro: Asia Pacific (Sydney)" | ||
apiUrl: https://api.pro-ap-southeast-2.openshift.com | ||
consoleUrl: https://console.pro-ap-southeast-2.openshift.com | ||
type: pro | ||
git: | ||
provider: GITHUB | ||
url: https://github.com | ||
repositoryDescription: Generated by the Red Hat Developer Launch (https://developers.redhat.com/launch) | ||
username: username (or secretKeyRef as below) | ||
token: | ||
valueFrom: | ||
secretKeyRef: | ||
name: github-test-secret | ||
key: token | ||
keycloak: | ||
url: https://sso.openshift.io/auth | ||
realm: rh-developers-launch | ||
clientId: | ||
segment: | ||
token: token | ||
sentry: | ||
backendToken: value or valueFrom/secretKeyRef | ||
frontendToken: value or valueFrom/secretKeyRef |
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,13 @@ | ||
apiVersion: launcher.fabric8.io/v1alpha2 | ||
kind: Launcher | ||
metadata: | ||
name: launcher | ||
spec: | ||
|
||
####### OpenShift Configuration | ||
openshift: | ||
consoleUrl: #<the OpenShift Console Url (ex: 'https://192.168.64.4:8443')># | ||
|
||
####### OAuth Configuration | ||
oauth: | ||
enabled: true |
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,112 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<artifactId>launcher-parent</artifactId> | ||
<groupId>io.fabric8.launcher</groupId> | ||
<version>1-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>launcher-operator</artifactId> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-kubernetes-client</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-smallrye-health</artifactId> | ||
</dependency> | ||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>io.fabric8.launcher</groupId> | ||
<artifactId>launcher-base-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-test-kubernetes-client</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>launcher-operator</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>build</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<systemProperties> | ||
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager> | ||
</systemProperties> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>native</id> | ||
<activation> | ||
<property> | ||
<name>operatorNative</name> | ||
</property> | ||
</activation> | ||
<properties> | ||
<native-image.docker-build>true</native-image.docker-build> | ||
</properties> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>native-image</goal> | ||
</goals> | ||
<configuration> | ||
<enableHttpUrlHandler>true</enableHttpUrlHandler> | ||
<additionalBuildArgs>-H:IncludeResources=../templates/openshift/launcher-template.yaml</additionalBuildArgs> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-failsafe-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>integration-test</goal> | ||
<goal>verify</goal> | ||
</goals> | ||
<configuration> | ||
<systemProperties> | ||
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path> | ||
</systemProperties> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
Oops, something went wrong.