2023-05-03 03:55:25 +00:00
|
|
|
import { AppKind, DeploymentType } from './types';
|
|
|
|
|
|
|
|
// Portainer specific labels
|
|
|
|
export const appStackNameLabel = 'io.portainer.kubernetes.application.stack';
|
2023-05-29 03:06:14 +00:00
|
|
|
export const appStackIdLabel = 'io.portainer.kubernetes.application.stackid';
|
2023-05-03 03:55:25 +00:00
|
|
|
export const appOwnerLabel = 'io.portainer.kubernetes.application.owner';
|
|
|
|
export const appNoteAnnotation = 'io.portainer.kubernetes.application.note';
|
|
|
|
export const appDeployMethodLabel = 'io.portainer.kubernetes.application.kind';
|
2023-05-29 03:06:14 +00:00
|
|
|
export const defaultDeploymentUniqueLabel = 'pod-template-hash';
|
|
|
|
|
|
|
|
export const appRevisionAnnotation = 'deployment.kubernetes.io/revision';
|
|
|
|
|
|
|
|
// unchangedAnnotationKeysForRollbackPatch lists the annotations that should be preserved from the deployment and not
|
|
|
|
// copied from the replicaset when rolling a deployment back
|
|
|
|
export const unchangedAnnotationKeysForRollbackPatch = [
|
|
|
|
'kubectl.kubernetes.io/last-applied-configuration',
|
|
|
|
appRevisionAnnotation,
|
|
|
|
'deployment.kubernetes.io/revision-history',
|
|
|
|
'deployment.kubernetes.io/desired-replicas',
|
|
|
|
'deployment.kubernetes.io/max-replicas',
|
|
|
|
'deprecated.deployment.rollback.to',
|
|
|
|
'deprecated.daemonset.template.generation',
|
|
|
|
];
|
2023-05-03 03:55:25 +00:00
|
|
|
|
|
|
|
export const appKindToDeploymentTypeMap: Record<
|
|
|
|
AppKind,
|
|
|
|
DeploymentType | null
|
|
|
|
> = {
|
|
|
|
Deployment: 'Replicated',
|
|
|
|
StatefulSet: 'Replicated',
|
|
|
|
DaemonSet: 'Global',
|
|
|
|
Pod: null,
|
|
|
|
};
|