# Resalloc kubernetes resalloc-kubernetes used for generating in cluster pod resource for [COPR](https://copr.fedorainfracloud.org/) cluster. # Prerequisite The pod's [Service Account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/)'s [Role](https://kubernetes.io/docs/reference/access-authn-authz/rbac/) need pvc's `create`, `delete` and pod's `create`, `delete`, `list`, `watch`, `get` permissions, For example, the RBAC role should be something like: ```yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role ... rules: - apiGroups: [""] resources: ["pods"] verbs: ["create", "delete", "list", "get", "watch"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["create", "delete"] ... ``` **NOTE**: If there's no `delete` permissions for pod and pvc in Service Account, the allocated resource may be leaked and need to be released manually! # Generate pod command would be: ```console Create new pod resource Usage: resalloc-kubernetes add [OPTIONS] --image-tag --cpu-resource --memory-resource Options: --timeout timeout for waiting pod to be ready [default: 60] --image-tag specify the image tag used for generating, for example: docker.io/organization/image:tag --namespace --cpu-resource specify the request and limit cpu resource, '1', '2000m' and etc. --memory-resource specify the request and limit memory resource, '1024Mi', '2Gi' and etc. --node-selector specify the node selector for pod resource in the format of 'NAME=VALUE', can be specified with multiple times --privileged run pod in privileged mode --additional-labels specify the additional labels for pod resource in the format of 'NAME=VALUE', can be specified with multiple times --additional-volume-size specify the additional persistent volume size, use in group(additional_volume_size, additional_volume_class, additional_volume_mount_path). --additional-volume-class specify the additional persistent volume class, use in group(additional_volume_size, additional_volume_class, additional_volume_mount_path). --additional-volume-mount-path specify mount point for persistent volume, use in group(additional_volume_size, additional_volume_class, additional_volume_mount_path). -h, --help Print help information ``` # Remove pod command would be: ````console Delete existing pod resource by IP address Usage: resalloc-kubernetes delete [OPTIONS] --name Options: --name specify ip address of pod to delete. [env: RESALLOC_NAME=] --namespace -h, --help Print help information ````