SkyU Kustomize Transformer
SkyU uses a Kustomize transform plugin to add the necessary configurations for the SkyU platform to manage the resources. This plugin is automatically applied to the merged Kubernetes manifests before deploying them to the environment.
The folder structure of the Kustomize plugin is as follows:
|-- kustomize
| |-- base
| | |-- deployment.yaml
| |-- overlays
| | |-- dev
| | | |-- deployment-patch.yaml
| | | |-- skyu-transform.yaml
| | |-- staging
| | | |-- deployment-patch.yaml
| | | |-- skyu-transform.yaml
| | |-- prod
| | | |-- deployment-patch.yaml
| | | |-- skyu-transform.yaml
Please note that kustomization.yaml
is not required in the plugin folder structure. This yaml is automatically generated by SkyU at runtime.
Kustomize File Merge
SkyU uses Kustomize to manage the Kubernetes manifests in the GitOps repository. Kustomize allows you to customize Kubernetes resources through a Kubernetes-style configuration file.
When you create a project in SkyU, SkyU creates a GitOps repository for you. This repository contains the base and overlay folders. The base folder contains the base Kubernetes manifests for your applications and infrastructure. The overlay folders contain the environment-specific configurations for your applications and infrastructure.
When you deploy an application or infrastructure in SkyU, SkyU merges the base and overlay folders using Kustomize. This allows you to customize the Kubernetes resources for different environments without duplicating the base Kubernetes manifests.
After the initial merge, it would go through another transform via a SkyU Kustomize transform plugin to add the necessary configurations for the SkyU platform to manage the resources.
The manifest spec for the skyu-transform
plugin is as follows:
spec:
type: string # Job, CronJob, Deployment
applicationContainers:
- name: string
applicationPorts:
- protocol: string
port: 0
targetPort: 0
apiSpec:
gitPath: string
urlPath: string
imageRegistry: string
imageTag: string
cpuRequestMili: 0
cpuLimitMili: 0
memoryRequestMb: 0
memoryLimitMb: 0
command:
- string
args:
- string
healthChecks:
- initialDelaySeconds: 0
timeoutSeconds: 0
periodSeconds: 0
successThreshold: 0
failureThreshold: 0
httpGet:
path: string
port: 0
httpHeaders:
- name: string
value: string
scheme: string
tcpSocket:
port: 0
exec:
command:
- string
grpc:
port: 0
service: string
probeType:
- string # readinessProbe, livenessProbe, startupProbe
configMounts:
- mountPath: string
isFile: false
configMapName: string
secretName: string
key: string
isEnv: false
imagePullPolicy: string
credentialId: string
imagePullSecretName: string
commitDetails:
commitHash: string
commitTime: string
commitUser: string
commitMessage: string
commitAvatar: string
minReplicas: 0
maxReplicas: 0 # default replica count
terminationGracePeriodSeconds: 0
nodeSelector:
key: string
serviceType: string # todo
namespace: string
cronTab: string
suspend: false
ttlSecondsAfterFinished: 0
serviceAccountName: string
name: string
version: string
labels:
key: string
horizontalAutoScalingRules:
- ruleType: string # cpu, memory
percentage: 0
volumes:
- name: string
type: string
pvc:
claimName: string
yamlFilePath: string
hostPath:
path: string
nfs:
server: string
path: string
volumeMounts:
- containerName: string
mountPath: string