diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 65369bf2..bfa96156 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -69,10 +69,12 @@ jobs: # Generate manifests and image cd samples/spring-boot - ./mvnw ${MAVEN_ARGS} clean install -Ddekorate.jib.registry=$KIND_REGISTRY -Ddekorate.jib.group=tests -Ddekorate.jib.version=latest -Ddekorate.jib.autoPushEnabled=true -DskipTests + ./mvnw jib:dockerBuild + kind load docker-image spring-boot-sample:latest + # ./mvnw ${MAVEN_ARGS} clean install -Ddekorate.jib.registry=$KIND_REGISTRY -Ddekorate.jib.group=tests -Ddekorate.jib.version=latest -Ddekorate.jib.autoPushEnabled=true -DskipTests # Install manifests - kubectl apply -f target/classes/META-INF/dekorate/kubernetes.yml + kubectl apply -f k8s/kubernetes.yml # Wait until the service is started kubectl wait --for=condition=available --timeout=600s deployment/spring-boot-sample diff --git a/pom.xml b/pom.xml index d0f394d4..31b2754e 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ https://sonarcloud.io 5.8.2 - 5.12.2 + 6.1.1 1.7.32 2.17.1 4.1.0 @@ -63,6 +63,7 @@ 3.3.1 3.0.1 3.2.1 + 2.7.3 diff --git a/samples/commons/pom.xml b/samples/commons/pom.xml index 3d70ff7b..e06ad7a5 100644 --- a/samples/commons/pom.xml +++ b/samples/commons/pom.xml @@ -14,7 +14,6 @@ 11 - 2.6.6 diff --git a/samples/spring-boot/k8s/kubernetes.yml b/samples/spring-boot/k8s/kubernetes.yml new file mode 100644 index 00000000..82fc8eaf --- /dev/null +++ b/samples/spring-boot/k8s/kubernetes.yml @@ -0,0 +1,131 @@ +# Generated by dekorate - replace with generate if dekorate supports v6.1.1 fabric8 client +--- +apiVersion: v1 +kind: Secret +metadata: + name: pkcs12-pass +data: + password: c3VwZXJzZWNyZXQ= +type: Opaque +--- +apiVersion: v1 +kind: Service +metadata: + annotations: + app.dekorate.io/vcs-url: <> + labels: + app.kubernetes.io/name: spring-boot-sample + app.kubernetes.io/version: 0.2.1-SNAPSHOT + name: spring-boot-sample +spec: + ports: + - name: http + port: 443 + targetPort: 443 + selector: + app.kubernetes.io/name: spring-boot-sample + app.kubernetes.io/version: 0.2.1-SNAPSHOT + type: ClusterIP +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + annotations: + app.dekorate.io/vcs-url: <> + labels: + app.kubernetes.io/version: 0.2.1-SNAPSHOT + app.kubernetes.io/name: spring-boot-sample + name: spring-boot-sample +spec: + dnsNames: + - spring-boot-sample.test.svc + - localhost + duration: 7776000000000000ns + encodeUsagesInRequest: false + isCA: false + issuerRef: + name: spring-boot-sample + keystores: + pkcs12: + create: true + passwordSecretRef: + key: password + name: pkcs12-pass + privateKey: + algorithm: RSA + encoding: PKCS8 + size: 2048 + renewBefore: 1296000000000000ns + secretName: tls-secret + subject: + organizations: + - Dekorate + - Community + usages: + - server auth + - client auth +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + annotations: + app.dekorate.io/vcs-url: <> + labels: + app.kubernetes.io/version: 0.2.1-SNAPSHOT + app.kubernetes.io/name: spring-boot-sample + name: spring-boot-sample +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/version: 0.2.1-SNAPSHOT + app.kubernetes.io/name: spring-boot-sample + template: + metadata: + annotations: + app.dekorate.io/vcs-url: <> + labels: + app.kubernetes.io/version: 0.2.1-SNAPSHOT + app.kubernetes.io/name: spring-boot-sample + spec: + containers: + - env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: SERVER_SSL_KEY_STORE + value: /etc/certs/keystore.p12 + - name: SERVER_SSL_KEY_STORE_PASSWORD + valueFrom: + secretKeyRef: + key: password + name: pkcs12-pass + image: spring-boot-sample:latest + imagePullPolicy: Never + name: spring-boot-sample + ports: + - containerPort: 443 + name: http + protocol: TCP + volumeMounts: + - mountPath: /etc/certs + name: volume-certs + readOnly: true + volumes: + - name: volume-certs + secret: + optional: false + secretName: tls-secret +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + annotations: + app.dekorate.io/vcs-url: <> + labels: + app.kubernetes.io/version: 0.2.1-SNAPSHOT + app.kubernetes.io/name: spring-boot-sample + name: spring-boot-sample +spec: + selfSigned: {} diff --git a/samples/spring-boot/pom.xml b/samples/spring-boot/pom.xml index 3bec0ace..567b3509 100644 --- a/samples/spring-boot/pom.xml +++ b/samples/spring-boot/pom.xml @@ -15,8 +15,7 @@ 11 - 2.6.6 - 2.11.1 + 3.3.0 @@ -40,21 +39,6 @@ org.springframework.boot spring-boot-starter-webflux - - io.dekorate - kubernetes-spring-starter - ${dekorate.version} - - - io.dekorate - certmanager-annotations - ${dekorate.version} - - - io.dekorate - jib-annotations - ${dekorate.version} - org.springframework.boot spring-boot-starter-test @@ -84,6 +68,19 @@ + + com.google.cloud.tools + jib-maven-plugin + ${jib-maven-plugin.version} + + + gcr.io/distroless/java:11 + + + spring-boot-sample + + + org.springframework.boot spring-boot-maven-plugin