Application Management

By leveraging Shipa, you can provide developers with an easier and seamless way to deploy their applications across multiple Kubernetes clusters and Linux nodes.

📘

Shipa Application and Deployment Object Merge - Shipa 1.7.1

Shipa has merged the Application and Deployment Terraform Objects in Shipa 1.7.1+. If using a prior version, check out the previous version's documentation.

Creating and Deploying Applications

The code snippet below creates an application on Shipa.

apiVersion: shipa.crossplane.io/v1alpha1
kind: AppDeploy
metadata:
  name: crossplane-app
spec:
  forProvider:
    app: crossplane-app
    image: docker.io/shipasoftware/bulletinboard:1.0
    appConfig:
      team: shipa-team
      framework: sample-framework
      env:
      - VARIABLE_ONE=v1
      - VARIABLE_TWO=v2
      plan: shipa-plan
      tags:
      - soaktest
      - chaos_acceptance
    port:
      number: 2121
      protocol: TCP
    registry:
      user: docker.user
      secret: docker.secret
    volumes:
    - name: mysql
      mountPath: var/lib/mysql
    - name: scratch
      mountPath: tmp/scratch

Top-Level Attributes

Here are the attributes that provide top-level information about each component definition.

ComponentTypeDescription
apiVersionstringthe version of the API.
kindstringthe kind of custom resource that will be created by Shipa.

AppDeploy is the kind used by Shipa for creating and deploying applications.
metadatathe name of the custom resource that will be created by Shipa. A good practice is to keep this as the application name.
specthe specification that will be used by Shipa when creating the application.

Specification - For Provider

Main deployment object e.g. the image.

ComponentTypeDescription
appstringthe name of the application.

Required: Yes
imagestringthe address of the image that should be used by Shipa for deployment.

Required: Yes

Specification - For Provider - App Config

Application specific configs.

ComponentTypeDescription
teamstringthe name of the team who will own the application.

Required: Yes
frameworkstringthe name of the framework that should be used for creating the application.

Required: Yes
envarrayarray of environmental variable objects. In the format variable_name=variable_value.

Required: No
planstringthe name of the resource limit plan that should be used by this application.

If not defined, the one defined at the framework level will be used.

Required: No
tagsarraya list of tags that should be assigned to the application.

Required: No

Specification - For Provider - Port (Not Required)

Custom Port exposure. Add this section if wanting to expose a certain port.

ComponentTypeDescription
numberintegera specific port that should be assigned to the application for it to be exposed.

If not specified, Shipa will automatically expose port 8888 to the application.

Required: No
Condition: Only when port is specified.
protocolstringthe protocol your application can accept ingress or egress.

Required: No
Condition: Only when port is specified.

Specification - For Provider - Registry (Not Required)

Private Registry wiring. Add this section if wanting to use a Private Registry.

ComponentTypeDescriptiomn
userstringthe username of the private registry for authentication, so Shipa can pull the image.

Required: No
Condition: Only when registry is specified.
secretstringthe password of the private registry for authentication, so Shipa can pull the image.

Required: No
Condition: Only when registry is specified.

Specification - For Provider - Volumes (Not Required)

Shipa Volumes to be bound. A Volume Plan and Volume will need to be created before.

ComponentTypeDescription
namestringname of shipa volume.

Required: No
Condition: Only when volumes is specified.
mountPathstringmount path of volume to be exposed.

Required: No
Condition: Only when volumes is specified.

CNAME Management

The code snippet below adds a CNAME entry to an existing application:

apiVersion: shipa.crossplane.io/v1alpha1
kind: AppCname
metadata:
  name: crossplane-app
spec:
  forProvider:
    app: crossplane-app
    cname: www.test.com
    encrypt: true

Top-Level Attributes

Here are the attributes that provide top-level information about each component definition.

ComponentTypeDescription
apiVersionstringthe version of the API.
kindstringAppCname is the kind used by Shipa for assigning a CNAME to an existing application.
metadatathe name of the custom resource that will be created by Shipa.
specthe name of the custom resource that will be created by Shipa.

Metadata

ComponentTypeDescription
namestringthe name of the custom resource that will be created by Shipa.

Specification

ComponentTypeDescription
appstringthe name of the application where deployment should happen.

Required: Yes
cnamestringthe CNAME you want to assign to your existing application.

Required: Yes
encryptbooleanif Shipa should automatically create a certificate and assign to your CNAME so your application is served over HTTPS.

Required: No

Networking Management

The code snippet below adds a network policy entry to an existing application:

apiVersion: shipa.crossplane.io/v1alpha1
kind: NetworkPolicy
metadata:
  name: netpolicy-k8-app1
spec:
  forProvider:
    app: k8-app1
    networkPolicy:
      ingress:
        policy_mode: allow-custom-rules-only
        custom_rules:
          - id: framework
            enabled: true
            description: framework block
            allowed_apps:
              - app1
              - app2
            allowed_frameworks:
              - cp-prod
            ports:
              - port: 8080
                protocol: TCP
      egress:
        policy_mode: allow-all
      restart_app: true

Top-Level Attributes

Here are the attributes that provide top-level information about each component definition.

ComponentTypeDescription
apiVersionstringversion
kindstringNetworkPolicy is the kind used by Shipa for assigning a CNAME to an existing application.
metadatathe name of the custom resource that will be created by Shipa.
specthe specification that will be used by Shipa when deploying the application.

Metadata

ComponentTypeDescription
namestringthe name of the custom resource that will be created by Shipa.

Specification

ComponentTypeDescription
ingressingress definition that will be applied to the application.

if not defined, Shipa will leverage the network policies defined at the framework level.

Required: No
policy_modestringthe policy mode that should be applied to your application.

Current options from this provider are:
- allow-all
- deny-all
- allow-custom-rules-only

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
custom_rulesif policy_mode is set to allow-custom-rules-only, you can define custom rules for detailed ingress or egress configuration for the application.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
idstringthe name of the custom rule.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
enabledboolif the custom rule is enabled by default or not for this application.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
descriptionstringThe description of the custom rule being enforced.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
allowed_appsstringthe specific applications that communicate with your application.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
allowed_frameworksstringallow traffic from applications deployed through this, or list of, frameworks.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
portsport configuration where your application can accept ingress or egress.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
portintthe specific port (or list of ports) where your application can accept ingress or egress.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
protocolstringthe protocol your application can accept ingress or egress.

Required: No
Condition: Only when policy_mode is set to allow-custom-rules-only
egressegress definition that will be accepted by your application.

if not defined, Shipa will leverage the network policies defined at the framework level.

Required: No
restart_appboolif the application should be restarted automatically once the network policy is defined.

network policy is only in effect once the application is restarted. If not set to yes, the application won't be restarted and the new policy will only take effect when you restart the application manually.

Required: No

📘

Detailed network policies

Shipa enables you to define more granular network policies through its dashboard. If rules are overly complex, we recommend using the dashboard to define a sample framework and network policy.