Представленный шаблон позволяет развернуть сервис eltex-disconnect в кластере OpenShift.
Подготовка к установке:
Порядок установки:
применить шаблон при помощи команды
oc apply -f eltex-disconnect-template.yaml |

kind: Template
apiVersion: v1
metadata:
name: eltex-disconnect-template
annotations:
description: "Eltex-disconnect application template"
openshift.io/display-name: "The Eltex Disconnect service"
openshift.io/provider-display-name: "Eltex"
iconClass: "icon-openjdk"
objects:
- apiVersion: v1
kind: Secret
metadata:
name: ${INSTANCE_NAME}-secret
stringData:
public.pem: ${PUBLIC_DATA}
type: Opaque
- apiVersion: v1
kind: ConfigMap
metadata:
name: ${INSTANCE_NAME}-config
data:
application.conf: |-
server {
port = 9096
}
pcrf {
host = ${PCRF_HOST}
port = 7070
timeout = 100
}
validation {
public_key = /etc/eltex-disconnect-service/keys/public.pem
}
log4j2.xml: |-
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<Properties>
<Property name="defaultPattern" value="%d{ISO8601} [%t] %-5p %logger{1} %C{1}.%M(line:%L). %m%n"/>
</Properties>
<Appenders>
<Console name="STDOUT" target="SYSTEM_OUT">
<PatternLayout>
<Pattern>${defaultPattern}</Pattern>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="STDOUT"/>
</Root>
</Loggers>
</Configuration>
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
labels:
app: ${INSTANCE_NAME}
name: ${INSTANCE_NAME}
spec:
replicas: 1
selector:
app: ${INSTANCE_NAME}
strategy:
type: Rolling
template:
metadata:
labels:
app: ${INSTANCE_NAME}
spec:
containers:
- name: ${INSTANCE_NAME}-container
image: ${IMAGE_NAME}
imagePullPolicy: Always
livenessProbe:
httpGet:
path: /actuator/health
port: 9096
scheme: HTTP
initialDelaySeconds: 30
volumeMounts:
- name: config-volume
mountPath: /etc/eltex-disconnect-service/log4j2.xml
subPath: log4j2.xml
- name: config-volume
mountPath: /etc/eltex-disconnect-service/application.conf
subPath: application.conf
- name: secret-volume
mountPath: /etc/eltex-disconnect-service/keys
volumes:
- name: config-volume
configMap:
name: ${INSTANCE_NAME}-config
items:
- key: log4j2.xml
path: log4j2.xml
- key: application.conf
path: application.conf
- name: secret-volume
secret:
secretName: ${INSTANCE_NAME}-secret
triggers:
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
name: ${INSTANCE_NAME}-service
spec:
ports:
- port: 9096
protocol: TCP
selector:
app: ${INSTANCE_NAME}
- apiVersion: v1
kind: Route
metadata:
name: ${INSTANCE_NAME}-route
spec:
to:
kind: Service
name: ${INSTANCE_NAME}-service
parameters:
- name: INSTANCE_NAME
displayName: Name of service
description: Name of service in openshift
required: true
value: eltex-disconnect
- name: IMAGE_NAME
displayName: Image name
description: Image name or pull spec
required: true
value: hub.eltex-co.ru/softwlc/eltex-disconnect-service:latest
- name: PCRF_HOST
displayName: PCRF host
description: PCRF host
required: true
value: localhost
- name: PUBLIC_DATA
displayName: public.pem
description: Contents of public.pem
required: true
message: "... The Eltex Disconnect with name ${INSTANCE_NAME} is starting ..."
|