File size: 2,182 Bytes
f97dae7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
apiVersion: apps/v1
kind: Deployment
metadata:
  name: granite-guardian-pod
  labels:
    app: granite-guardian
spec:
  selector:
    matchLabels:
      run: granite-guardian
  replicas: 1
  template:
    metadata:
      labels:
        run: granite-guardian
    spec:
      containers:
        - name: granite-guardian
          image: us.icr.io/research3/granite-guardian
          resources:
            limits:
              cpu: 1
              memory: 2Gi
            requests:
              cpu: 1
              memory: 2Gi
          ports:
            - containerPort: 7860
          env:
            - name: WATSONX_API_KEY
              valueFrom:
                secretKeyRef:
                  name: granite-guardian-secrets
                  key: WATSONX_API_KEY
            - name: WATSONX_PROJECT_ID
              valueFrom:
                secretKeyRef:
                  name: granite-guardian-secrets
                  key: WATSONX_PROJECT_ID
            - name: INFERENCE_ENGINE
              valueFrom:
                secretKeyRef:
                  name: granite-guardian-secrets
                  key: INFERENCE_ENGINE
      imagePullSecrets:
        - name: all-icr-io
---
apiVersion: v1
kind: Service
metadata:
  name: granite-guardian-service
spec:
  type: NodePort
  sessionAffinity: "ClientIP"
  selector:
    run: granite-guardian
  ports:
    - port: 80
      targetPort: 7860
      protocol: TCP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/allow-http: 'false'
    ingress.kubernetes.io/ssl-redirect: 'true'
    kubernetes.io/ingress.class: f5
    virtual-server.f5.com/balance: round-robin
    virtual-server.f5.com/ip: 9.12.246.36
    virtual-server.f5.com/partition: RIS3-INT-OCP-DAL12
    virtual-server.f5.com/clientssl: '[ { "bigIpProfile": "/Common/BlueMix" } ]'
  name: granite-guardian-ingress
  namespace: granite-guardian
spec:
  rules:
  - host: granite-guardian.bx.cloud9.ibm.com
    http:
      paths:
      - backend:
          service:
            name: granite-guardian-service
            port:
              number: 80
        path: /
        pathType: ImplementationSpecific