Step by Step Deployment OCP
6 min
Intro
Example how to deploy on Red Hat OpenShift Container Platform (RH OCP)
- Use configMap for configuration
- No RWX storage
- GUI read only
Bash/Shell commands to deploy on RH OCP
##set vars to use in script
vfns="dflow-ns"
vflocalfilepath="/home/myuser/dflow-files"
#make local folder
mkdir -p $vflocalfilepath/$vfns/ssl-cert
mkdir -p $vflocalfilepath/$vfns/config
mkdir -p $vflocalfilepath/$vfns/sap-cert
##copy the main.ini file to the 'config' file.
##copy the 'certificate.crt' and 'cert-private.key' to the 'ssl-cert folder
##copy the CS1P81-Y7.cer to the 'sap-cert' folder, after send cert in SAP check /dflow/config/certificates folder for the cert.
### naming convention is <<content.system>>-<<Archive Name>>.cer
## create NS
kubectl create namespace $vfns
##set as default ns
kubectl config set-context --current --namespace=$vfns
## create image pull secret ##
kubectl -n $vfns create secret docker-registry image-repo-login-secret \
--docker-username=my-username \
--docker-password=pass123 \
--docker-server=versafile.azurecr.io \
[email protected]
##deploy config (via configMaps and secret)
#kubectl -n $vfns delete cm dflow-config
kubectl -n $vfns create configmap dflow-config --from-file=$vflocalfilepath/$vfns/config
## import SSL cert and key as secret
#kubectl -n $vfns delete secret dflow-x509
kubectl -n $vfns create secret tls dflow-x509 \
--cert=$vflocalfilepath/$vfns/ssl-cert/certificate.crt \
--key=$vflocalfilepath/$vfns/ssl-cert/cert-private.key
##add SAP certs we trust (seckey sigValidation) as secret
#kubectl -n $vfns delete secret dflow-sap-cert
kubectl -n $vfns create secret generic dflow-sap-cert --from-file=$vflocalfilepath/$vfns/sap-cert
##yaml with deployment and service kind.
kubectl -n $vfns apply -f dflow-deploy.yml
## deploy route for GUI and CS
## modify first to set the hostname to correct hostname.
#check hostname
yq .spec.host route-dflow-cs.yaml
kubectl -n $vfns apply -f route-dflow-gui.yaml
kubectl -n $vfns apply -f route-dflow-cs.yaml
##tips how to scale up/down
YAML files
Example of config folders