Create a Composite Deployment Container
Before creating a Kubernetes pod, make sure that the Oracle SOA Suite Docker image is available on a node, or you can create an image pull secret so that the pod can pull the Docker image on the host where it gets created.
- Create an image pull secret to pull image soasuite:release-version by the
Kubernetes pod:
kubectl create secret docker-registry image-secret -n soans --docker-server=your-registry.com --docker-username=xxxxxx --docker-password=xxxxxxx --docker-email=my@company.com - Create a PersistentVolume and PersistentVolumeClaim
(
soadeploy-pv.yamlandsoadeploy-pvc.yaml) with sample composites for build and deploy placed at/share/soa-deploy.- Create a PersistentVolume with the sample provided
(
soadeploy-pv.yaml), which uses NFS (you can usehostPathor any other supported PV type):apiVersion: v1 kind: PersistentVolume metadata: name: soadeploy-pv spec: storageClassName: soadeploy-storage-class capacity: storage: 10Gi accessModes: - ReadWriteMany # Valid values are Retain, Delete or Recycle persistentVolumeReclaimPolicy: Retain # hostPath: nfs: server: X.X.X.X path: "/share/soa-deploy" - Apply the YAML:
kubectl apply -f soadeploy-pv.yaml - Create a PersistentVolumeClaim (soadeploy-pvc.yaml):
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: soadeploy-pvc namespace: soans spec: storageClassName: soadeploy-storage-class accessModes: - ReadWriteMany resources: requests: storage: 10Gi - Apply the YAML:
kubectl apply -f soadeploy-pvc.yaml
- Create a PersistentVolume with the sample provided
(
- Create a composite deploy pod using
soadeploy.yaml to mount the composites inside pod at/composites:apiVersion: v1 kind: Pod metadata: labels: run: soadeploy name: soadeploy namespace: soans spec: imagePullSecrets: - name: image-secret containers: - image: soasuite:release-version name: soadeploy env: - name: M2_HOME value: /u01/oracle/oracle_common/modules/thirdparty/apache-maven_bundle/3.9.4.0.0/apache-maven-3.9.4 command: ["/bin/bash", "-c", "echo 'export PATH=$PATH:$M2_HOME/bin' >> $HOME/.bashrc; sleep infinity"] imagePullPolicy: IfNotPresent volumeMounts: - name: mycomposite mountPath: /composites volumes: - name: mycomposite persistentVolumeClaim: claimName: soadeploy-pvc - Create the pod:
kubectl apply -f soadeploy.yaml - Once the Kubernetes pod is deployed, exec into the pod to perform Maven/Ant
based build and deploy:
kubectl exec -it -n soans soadeploy -- bash