Proper kustomize setup for the operator
This commit is contained in:
parent
e2ac7b38f4
commit
90d6432d16
6 changed files with 63 additions and 16 deletions
|
@ -33,8 +33,20 @@ Compile the project and generate the Docker image with JIB:
|
|||
mvn clean package -Doperator -Dquarkus.container-image.build=true -Dquarkus.kubernetes.deployment-target=minikube
|
||||
```
|
||||
|
||||
Install the CRD definition and the operator in the cluster:
|
||||
Install the CRD definition and the operator in the cluster in the `keycloak` namespace:
|
||||
|
||||
```bash
|
||||
kubectl apply -k .
|
||||
kubectl apply -k target
|
||||
```
|
||||
|
||||
to install in the `default` namespace:
|
||||
|
||||
```bash
|
||||
kubectl apply -k overlays/default-namespace
|
||||
```
|
||||
|
||||
Remove the created resources with:
|
||||
|
||||
```bash
|
||||
kubectl delete -k <previously-used-folder>
|
||||
```
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
resources:
|
||||
- target/kubernetes/keycloaks.keycloak.org-v1.yml
|
||||
- target/kubernetes/minikube.yml
|
||||
- kubernetes/deployments-role.yaml
|
7
operator/overlays/default-namespace/kustomization.yaml
Normal file
7
operator/overlays/default-namespace/kustomization.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- ../../target
|
||||
|
||||
namespace: default
|
|
@ -123,16 +123,37 @@
|
|||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>${quarkus.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<groupId>io.quarkus</groupId>
|
||||
<artifactId>quarkus-maven-plugin</artifactId>
|
||||
<version>${quarkus.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${basedir}/target</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/kubernetes</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
|
11
operator/src/main/kubernetes/kustomization.yml
Normal file
11
operator/src/main/kubernetes/kustomization.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
namespace: keycloak
|
||||
|
||||
resources:
|
||||
- kubernetes/keycloaks.keycloak.org-v1.yml
|
||||
- kubernetes/kubernetes.yml
|
||||
|
||||
patches:
|
||||
- kubernetes/minikube.yml
|
Loading…
Reference in a new issue