K8S utilities


Лицензия

Лицензия

Категории

Категории

Maven Компиляция и сборка
Группа

Группа

com.github.saiprasadkrishnamurthy
Идентификатор

Идентификатор

k8s-utils-maven-plugin
Последняя версия

Последняя версия

1.2
Дата

Дата

Тип

Тип

maven-plugin
Описание

Описание

K8S utilities
K8S utilities
Ссылка на сайт

Ссылка на сайт

https://github.com/SaiprasadKrishnamurthy/k8s-utils-maven-plugin
Система контроля версий

Система контроля версий

https://github.com/SaiprasadKrishnamurthy/k8s-utils-maven-plugin.git

Скачать k8s-utils-maven-plugin

Как подключить последнюю версию

<plugin>
    <groupId>com.github.saiprasadkrishnamurthy</groupId>
    <artifactId>k8s-utils-maven-plugin</artifactId>
    <version>1.2</version>
</plugin>

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
org.apache.commons : commons-configuration2 jar 2.7
com.github.ulisesbocchio : jasypt-spring-boot-starter jar 2.1.1
org.yaml : snakeyaml jar 1.24
commons-io : commons-io jar 2.6

provided (3)

Идентификатор библиотеки Тип Версия
org.apache.maven : maven-plugin-api jar 3.6.0
org.apache.maven : maven-core jar 3.6.0
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5

Модули Проекта

Данный проект не имеет модулей.

Kubernetes Deployment Generator for Spring Boot apps.

This maven plugin acts as a bridge between your spring-boot app and kubernetes and generates the necessary Kubernetes deployment descriptors, config maps and utility shell scrips simply by extracting the application.properties and your maven metadata.

Usage in your pom.

        <plugin>
                <groupId>com.github.saiprasadkrishnamurthy</groupId>
                <artifactId>k8s-utils-maven-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>generate-kubernetes-deployment-descriptors</id>
                        <goals>
                            <goal>generate-deployment</goal>
                        </goals>
                        <configuration>
                            <dockerImageNamespace>dockerhub.com</dockerImageNamespace>
                            <dockerImagePrefix>appname</dockerImagePrefix>
                            <replicas>1</replicas>
                            <volumeMount>/mymount</volumeMount>
                        </configuration>
                    </execution>
                </executions>
         </plugin>

Pass the relevant parameters above in your section. This plugin gets kicked off during the prepare-package phase by default.

Once this is run, you'll find target/k8s directory created.

Let's assume if your spring boot application has the following structure of application properties.

src
    main
        resources
            application.properties
            application-local.properties
            application-dev.properties
            application-test.properties
            application-staging.properties
            application-prod.properties

For every spring environment profile (local, dev, test, staging, prod), a pair of Kubernetes files would be created

  • <application_name>-deployment- yml
  • <application_name>-configmap-.yml

Assume your project's artifact id is: user-search-service

target
     k8s
        user-search-service-deployment-local.yml
        user-search-service-configmap-local.yml
        user-search-service-deployment-dev.yml
        user-search-service-configmap-dev.yml
        user-search-service-deployment-test.yml
        user-search-service-configmap-test.yml
        user-search-service-deployment-staging.yml
        user-search-service-configmap-staging.yml
        user-search-service-deployment-prod.yml
        user-search-service-configmap-prod.yml

In addition to that, 3 utility shell scripts would be created:

  • deploy_configs.sh - Script that helps you to deploy a specific environment specific config map for this service using kubectl.
  • deploy_service.sh - Script that helps you to deploy a specific environment specific deployment for this service using kubectl.
  • logs.sh - Script that helps you to tail the logs.

Версии библиотеки

Версия
1.2
1.1
1.0