Because the state directory, which is still currently used, only allows for a single pod to mount it, allow for 0 available pods when updating the deployment. Otherwise it will block updating until the state directory is available for mounting, which will be never.
137 lines
3.3 KiB
YAML
137 lines
3.3 KiB
YAML
apiVersion: v1
|
|
kind: Template
|
|
labels:
|
|
app: osbuild-composer
|
|
template: osbuild-composer
|
|
metadata:
|
|
annotations:
|
|
description: OCP template for osbuild-composer in cloud.redhat.com
|
|
name: osbuild-composer
|
|
objects:
|
|
|
|
- apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
labels:
|
|
service: osbuild-composer
|
|
name: osbuild-composer
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
name: osbuild-composer
|
|
strategy:
|
|
# Update pods 1 at a time
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
# Create at most 0 extra pod over .spec.replicas
|
|
maxSurge: 0
|
|
# At all times there should be .spec.replicas - 1 available
|
|
maxUnavailable: 1
|
|
template:
|
|
metadata:
|
|
labels:
|
|
name: osbuild-composer
|
|
spec:
|
|
containers:
|
|
- image: "${IMAGE_NAME}:${IMAGE_TAG}"
|
|
name: osbuild-composer
|
|
ports:
|
|
- name: api
|
|
containerPort: 9196
|
|
protocol: TCP
|
|
- name: workers
|
|
containerPort: 8700
|
|
volumeMounts:
|
|
- name: composer-config
|
|
mountPath: "/etc/osbuild-composer"
|
|
readOnly: true
|
|
- name: state-directory
|
|
mountPath: "/var/lib/osbuild-composer"
|
|
- name: cache-directory
|
|
mountPath: "/var/cache/osbuild-composer"
|
|
volumes:
|
|
- name: composer-config
|
|
configMap:
|
|
name: composer-config
|
|
- name: state-directory
|
|
persistentVolumeClaim:
|
|
claimName: osbuild-composer-state-dir
|
|
- name: cache-directory
|
|
emptyDir: {}
|
|
|
|
- apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
labels:
|
|
service: composer
|
|
name: composer
|
|
spec:
|
|
ports:
|
|
- name: composer-api
|
|
protocol: TCP
|
|
port: ${{API_LISTENER_PORT}}
|
|
targetPort: 9196
|
|
selector:
|
|
name: osbuild-composer
|
|
|
|
- apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
labels:
|
|
service: composer-worker
|
|
name: composer-worker
|
|
spec:
|
|
ports:
|
|
- name: composer-worker
|
|
protocol: TCP
|
|
port: ${{API_LISTENER_PORT}}
|
|
targetPort: 8700
|
|
selector:
|
|
name: osbuild-composer
|
|
|
|
- apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: osbuild-composer-state-dir
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
resources:
|
|
requests:
|
|
storage: ${STATE_VOLUME_CAPACITY}
|
|
|
|
- apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: composer-config
|
|
data:
|
|
osubild-composer.toml: |
|
|
[koji]
|
|
[worker]
|
|
[composer_api]
|
|
identity_filter = [${COMPOSER_API_IDENTITY_FILTER}]
|
|
[worker_api]
|
|
identity_filter = [${WORKER_API_IDENTITY_FILTER}]
|
|
|
|
|
|
parameters:
|
|
- description: osbuild-composer image name
|
|
name: IMAGE_NAME
|
|
value: quay.io/cloudservices/osbuild-composer
|
|
required: true
|
|
- description: image-builder image tag
|
|
name: IMAGE_TAG
|
|
required: true
|
|
- description: api listener port
|
|
name: API_LISTENER_PORT
|
|
value: "8080"
|
|
- description: Size of composer state directory
|
|
name: STATE_VOLUME_CAPACITY
|
|
value: 2Gi
|
|
- description: Identity filter for the composer api
|
|
name: COMPOSER_API_IDENTITY_FILTER
|
|
value: "" # example: '"012345", "123456"'
|
|
- description: Identity filter for the composer api
|
|
name: WORKER_API_IDENTITY_FILTER
|
|
value: ""
|