--- apiVersion: v1 kind: Namespace metadata: labels: app.kubernetes.io/part-of: fakeworkload name: ${current_ns} --- apiVersion: apps/v1 kind: Deployment metadata: name: fakeworkload namespace: ${current_ns} labels: &deploy_labels app.kubernetes.io/part-of: fakeworkload app.kubernetes.io/name: ${current_ns} spec: replicas: 2 revisionHistoryLimit: 2 progressDeadlineSeconds: 2000 strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 25% maxSurge: 25% selector: matchLabels: *deploy_labels template: metadata: creationTimestamp: null labels: *deploy_labels spec: securityContext: runAsNonRoot: true seccompProfile: type: RuntimeDefault affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: wkloadtype operator: In values: - fakeload podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: - ${current_ns} topologyKey: kubernetes.io/hostname tolerations: - key: wkloadtype operator: Equal value: fakeload effect: "NoSchedule" containers: - image: quay.io/simbelmas/nginx:stable resources: requests: memory: "1Mi" cpu: "1m" limits: memory: "20Mi" command: - bash - -e - -c - |- lc() { ( pids="" cpus=\${1:-1} seconds=\${2:-60} echo loading \$cpus CPUs for \$seconds seconds trap 'for p in \$pids; do kill \$p; done' 0 for ((i=0;i/var/www/index.html < ${current_ns}

${current_ns}

EOF image: quay.io/simbelmas/nginx:stable imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false capabilities: drop: ['ALL'] name: generate-web volumeMounts: - mountPath: /var/www name: web volumes: - emptyDir: {} name: web --- apiVersion: v1 kind: Service metadata: labels: &svc_labels app.kubernetes.io/part-of: fakeworkload app.kubernetes.io/name: ${current_ns} name: fakeworkload-${current_ns} namespace: ${current_ns} spec: ports: - name: http port: 80 protocol: TCP targetPort: 8080 selector: *svc_labels sessionAffinity: ClientIP type: ClusterIP --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: fakeworkload-${current_ns} namespace: ${current_ns} labels: app.kubernetes.io/part-of: fakeworkload app.kubernetes.io/name: ${current_ns} spec: ingressClassName: openshift-default rules: - host: ${current_ns}.${route_domain} http: paths: - path: / pathType: Prefix backend: service: name: fakeworkload-${current_ns} port: number: 80