...
Deploying the SOAVirt Server in Kubernetes Manually
To deploy the SOAVirt server in Kubernetes, follow the process outlined below.
Prerequisites
First, create create a namespace for the SOAVirt server to run in. For example:
Code Block |
---|
kubectl create namespace parasoft-sv-namespace |
Note: The namespace name "parasoft-sv-namespace" is used throughout this documentation in command and resource examples. If you use a different name for your namespace, be sure to change any instances of "parasoft-sv-namespace" in those examples to your namespace name.
Warning |
---|
Once the SOAVirt server has been licensed, deleting the namespace will invalidate machine-locked licenses, even if you recreate the same namespace. |
...
Code Block |
---|
language | yml |
---|
title | parasoft-permissions.yaml |
---|
|
apiVersion: v1
kind: ServiceAccount
metadata:
name: parasoft-account
namespace: parasoft-sv-namespace
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: parasoft-read
namespace: parasoft-sv-namespace
rules:
- apiGroups:
- "*"
resources:
- "*"
verbs:
- get
- read
- list
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: parasoft-read-bind
namespace: parasoft-sv-namespace
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: parasoft-read
subjects:
- kind: ServiceAccount
name: parasoft-account
namespace: parasoft-sv-namespace |
...
Warning: When scaling beyond one replica, the events and statistics services should be disabled.
Note: kind: Deployment
is not supported. Use either kind: Pod
or kind: StatefulSet
.
Code Block |
---|
Code Block |
---|
language | yml |
---|
title | soavirt.yaml |
---|
|
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: soavirt
namespace: parasoft-sv-namespace
labels:
tag: soavirt
spec:
replicas: 1
selector:
matchLabels:
tag: soavirt
serviceName: soavirt
template:
metadata:
labels:
tag: soavirt
spec:
securityContext:
runAsNonRoot: true
serviceAccountName: parasoft-account
automountServiceAccountToken: true
volumes:
- name: soavirt-pv
persistentVolumeClaim:
claimName: soavirt-pvc
- name: soavirt-config
configMap:
name: soavirt-config
containers:
- name: soavirt
image: parasoft/soavirt-server
imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
seccompProfile:
type: RuntimeDefault
volumeMounts:
- name: soavirt-pv
mountPath: /usr/local/parasoft/soavirt/webapps/ROOT/workspace
- name: soavirt-config
mountPath: /usr/local/parasoft/soavirt/webapps/config.properties
subPath: config.properties
ports:
- name: http
containerPort: 9080
- name: events
containerPort: 9617
- name: statistics
containerPort: 9618
startupProbe:
httpGet:
path: /soavirt/api/v6/healthcheck
port: 9080
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 30
failureThreshold: 3
livenessProbe:
httpGet:
path: /soavirt/api/v6/healthcheck
port: 9080
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 30
env:
- name: CATALINA_OPTS
value: "-Dparasoft.auto.deploy.new=false
-Dparasoft.event.monitoring.broker.port=9617
-Dparasoft.server.statistics.broker.port=9618
-Dparasoft.cloudvm=true
-Dparasoft.cloudvm.config=Kubernetes"
- name: PARASOFT_POD_NAME #REQUIRED, DO NOT CHANGE
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: PARASOFT_POD_NAMESPACE #REQUIRED, DO NOT CHANGE
valueFrom:
fieldRef:
fieldPath: metadata.namespace |
...
Code Block |
---|
|
kubectl create -f soavirt.yaml |
...
...
Required Settings for a Stable Machine ID
As you modify the soavirt.yaml shown above or craft your own yaml, be aware that the following fields need to be consistent across upgrades and redeployments in order to assure a stable machine ID:
- metadata: name
- metadata: namespace
- containers: name
In addition, the following environment variables are required:
- env: name: PARASOFT_POD_NAME
- env: name: PARASOFT_POD_NAMESPACE
Anchor |
---|
| UsingALocalLicense |
---|
| UsingALocalLicense |
---|
|
Using a Local License
Using a Local License: To use a node-lock license, you will need to retrieve the machine ID from the deployed server in order to procure your license from Parasoft.
...