-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(Clair-Action): Caching Updates (#119)
- Loading branch information
1 parent
c834ffe
commit d3e7160
Showing
20 changed files
with
330 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: ceph.rook.io/v1 | ||
kind: CephFilesystem | ||
metadata: | ||
name: rook-ceph-fs-ci | ||
namespace: rook-ceph | ||
annotations: | ||
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true | ||
argocd.argoproj.io/sync-wave: "2" | ||
spec: | ||
metadataPool: | ||
replicated: | ||
size: 2 | ||
dataPools: | ||
- name: replicated | ||
replicated: | ||
size: 2 | ||
preserveFilesystemOnDelete: true | ||
metadataServer: | ||
activeCount: 1 | ||
activeStandby: true | ||
resources: | ||
# limits: | ||
# cpu: "3" | ||
# memory: 8Gi | ||
requests: | ||
cpu: "10m" | ||
memory: 128Mi | ||
placement: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: node-role.kubernetes.io/infra | ||
operator: Exists | ||
tolerations: | ||
- key: node-role.kubernetes.io/infra | ||
operator: Exists | ||
topologySpreadConstraints: | ||
- maxSkew: 1 | ||
topologyKey: topology.kubernetes.io/zone | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: ceph-mds | ||
- maxSkew: 1 | ||
topologyKey: kubernetes.io/hostname | ||
whenUnsatisfiable: DoNotSchedule | ||
labelSelector: | ||
matchLabels: | ||
app.kubernetes.io/name: ceph-mds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: rook-cephfs-ci | ||
# Change "rook-ceph" provisioner prefix to match the operator namespace if needed | ||
provisioner: rook-ceph.cephfs.csi.ceph.com | ||
parameters: | ||
# clusterID is the namespace where the rook cluster is running | ||
# If you change this namespace, also change the namespace below where the secret namespaces are defined | ||
clusterID: rook-ceph | ||
|
||
# CephFS filesystem name into which the volume shall be created | ||
fsName: rook-ceph-fs-ci | ||
|
||
# Ceph pool into which the volume shall be created | ||
# Required for provisionVolume: "true" | ||
pool: rook-ceph-fs-ci-replicated | ||
|
||
# The secrets contain Ceph admin credentials. These are generated automatically by the operator | ||
# in the same namespace as the cluster. | ||
csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner | ||
csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph | ||
csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner | ||
csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph | ||
csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node | ||
csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph | ||
allowVolumeExpansion: true | ||
reclaimPolicy: Delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: clair-action-cache-db | ||
namespace: homelab | ||
spec: | ||
schedule: "55 */2 * * *" | ||
concurrencyPolicy: Replace | ||
successfulJobsHistoryLimit: 1 | ||
failedJobsHistoryLimit: 1 | ||
suspend: false | ||
startingDeadlineSeconds: 60 | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
serviceAccountName: pipeline | ||
automountServiceAccountToken: false | ||
securityContext: | ||
seccompProfile: | ||
type: RuntimeDefault | ||
runAsNonRoot: true | ||
containers: | ||
- name: clair-action-cache | ||
image: registry.arthurvardevanyan.com/homelab/toolbox:not_latest | ||
command: | ||
- /bin/bash | ||
- -c | ||
- | | ||
############################# | ||
### Clair Action DB Cache ### | ||
############################# | ||
export DB_IMAGE="registry.arthurvardevanyan.com/homelab/clair-action-db:latest" | ||
mkdir -p /tmp/vuln-store/db | ||
echo "Extracting Image" | ||
oc image extract "${DB_IMAGE}" \ | ||
--path "/":"/tmp/vuln-store/db" | ||
securityContext: | ||
runAsNonRoot: true | ||
privileged: false | ||
readOnlyRootFilesystem: true | ||
allowPrivilegeEscalation: false | ||
seccompProfile: | ||
type: RuntimeDefault | ||
capabilities: | ||
drop: | ||
- ALL | ||
resources: | ||
requests: | ||
memory: "128Mi" | ||
cpu: "50m" | ||
ephemeral-storage: 1Gi | ||
limits: | ||
memory: "256Mi" | ||
cpu: "1000m" | ||
ephemeral-storage: 1Gi | ||
volumeMounts: | ||
- name: tmp | ||
mountPath: /tmp/ | ||
- name: vuln-store | ||
mountPath: /tmp/vuln-store | ||
restartPolicy: Never | ||
volumes: | ||
- name: tmp | ||
emptyDir: | ||
sizeLimit: 1Gi | ||
- name: vuln-store | ||
persistentVolumeClaim: | ||
claimName: clair-action-vuln-store-cache |
Oops, something went wrong.