Sample YAML files

project.yaml

apiVersion: project.openshift.io/v1
kind: Project
metadata:
  annotations:
    openshift.io/description: ""
    openshift.io/display-name: HashiCorpVault
    openshift.io/requester: kube:admin
  name: hashicorpvault
spec:
  finalizers:
  - kubernetes
status:
  phase: Active

cm.yaml

kind: ConfigMap
apiVersion: v1
metadata:
  name: config
  namespace: hashicorpvault
data:
  config: |
    syntax-version=1
 
    [nethsm_imports]
    local_module=0
    remote_ip=10.194.148.33
    remote_port=9004
    remote_esn=201E-03E0-D947
    keyhash=84800d1bfff6515ed5806fe443bbaca812d73733
    privileged=0

pv_nfast_sockets_definition.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfast-sockets
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 1G 
  accessModes:
    - ReadWriteOnce 
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /opt/nfast/sockets

pv_nfast_sockets_claim.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name : nfast-sockets
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: local-storage
  resources:
    requests:
      storage: 1G
  storageClassName: manual

pv_nfast_kmdata_definition.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfast-kmdata
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 1G 
  accessModes:
    - ReadWriteOnce 
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /opt/nfast/kmdata

pv_nfast_kmdata_claim.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name : nfast-kmdata
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: local-storage
  resources:
    requests:
      storage: 1G
  storageClassName: manual

pv_vault_config_definition.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: vault-config
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10M 
  accessModes:
    - ReadWriteOnce 
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /etc/vault

pv_vault_config_claim.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name : vault-config
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: local-storage
  resources:
    requests:
      storage: 10M
  storageClassName: manual

pv_vault_data_definition.yaml

apiVersion: v1
kind: PersistentVolume
metadata:
  name: vault-data
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10M 
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /etc/vault/data

pv_vault_data_claim.yaml

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name : vault-data
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: local-storage
  resources:
    requests:
      storage: 10M
  storageClassName: manual

pod_dummy.yaml

kind: Pod
apiVersion: v1
metadata:
  generateName: ncop-test-dummy-
  namespace: hashicorpvault
  labels:
    app: nshield
spec:
  imagePullSecrets:
    - name: hashicorpvault
  containers:
    - name: ncop-app
      securityContext:
        privileged: true
      command:
        - sh
        - '-c'
        - sleep 3600
      image: >-
        registry.eselab.net/hashicorp-vault-nshield-app
      ports:
        - containerPort: 8080
          protocol: TCP
      resources: {}
      volumeMounts:
        - name: nfast-sockets
          mountPath: /opt/nfast/sockets
        - name: nfast-kmdata
          mountPath: /opt/nfast/kmdata
        - name: vault-config
          mountPath: /etc/vault
        - name: vault-data
          mountPath: /opt/vault/data
  securityContext: {}
  volumes:
    - name: nfast-sockets
      persistentVolumeClaim:
        claimName: nfast-sockets
    - name: nfast-kmdata
      persistentVolumeClaim:
        claimName: nfast-kmdata
    - name: vault-config
      persistentVolumeClaim:
        claimName: vault-config
    - name: vault-data
      persistentVolumeClaim:
        claimName: vault-data

pod_hashicorpvault_nshield.yaml

kind: Pod
apiVersion: v1
metadata:
  generateName: hashicorpvault-nshield-
  namespace: hashicorpvault
  labels:
    app: nshield
spec:
  imagePullSecrets:
  containers:   
    - name: ncop-hwsp
      imagePullPolicy: IfNotPresent
      securityContext:
        privileged: true
      image: >-
        registry.eselab.net/hashicorp-vault-nshield-hwsp
      ports:
        - containerPort: 8080
          protocol: TCP
      volumeMounts:
        - name: ncop-config
          mountPath: /opt/nfast/kmdata/config
        - name: ncop-hardserver
          mountPath: /opt/nfast/kmdata/hardserver.d
        - name: nfast-sockets
          mountPath: /opt/nfast/sockets
    - name: hashicorp-app
      imagePullPolicy: IfNotPresent
      securityContext:
        privileged: true
      image: >-
        registry.eselab.net/hashicorp-vault-nshield-app
      ports:
        - containerPort: 8080
          protocol: TCP
        - containerPort: 8200
          protocol: TCP
      env:
        - name: VAULT_ADDR
          value: "http://127.0.0.1:8200"
      resources: {}
      volumeMounts:
        - name: nfast-sockets
          mountPath: /opt/nfast/sockets
        - name: nfast-kmdata
          mountPath: /opt/nfast/kmdata
        - name: vault-config
          mountPath: /etc/vault
        - name: vault-data
          mountPath: /opt/vault/data
  securityContext: {}
  volumes:
    - name: ncop-config
      configMap:
        name: config
        defaultMode: 420
    - name: ncop-hardserver
      emptyDir: {}
    - name: nfast-sockets
      persistentVolumeClaim:
        claimName: nfast-sockets
    - name: nfast-kmdata
      persistentVolumeClaim:
        claimName: nfast-kmdata
    - name: vault-config
      persistentVolumeClaim:
        claimName: vault-config
    - name: vault-data
      persistentVolumeClaim:
        claimName: vault-data