|
| 1 | +--- |
| 2 | +apiVersion: v1 |
| 3 | +kind: ServiceAccount |
| 4 | +metadata: |
| 5 | + name: antidotesa |
| 6 | + namespace: default |
| 7 | + |
| 8 | +--- |
| 9 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 10 | +kind: ClusterRole |
| 11 | +metadata: |
| 12 | + name: antidote-role |
| 13 | + namespace: default |
| 14 | +rules: |
| 15 | +- apiGroups: |
| 16 | + - '*' |
| 17 | + resources: |
| 18 | + - '*' |
| 19 | + verbs: |
| 20 | + - '*' |
| 21 | +- nonResourceURLs: |
| 22 | + - '*' |
| 23 | + verbs: |
| 24 | + - '*' |
| 25 | + |
| 26 | +--- |
| 27 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 28 | +kind: ClusterRoleBinding |
| 29 | +metadata: |
| 30 | + name: antidote-binding |
| 31 | + namespace: default |
| 32 | +roleRef: |
| 33 | + apiGroup: rbac.authorization.k8s.io |
| 34 | + kind: ClusterRole |
| 35 | + name: antidote-role |
| 36 | +subjects: |
| 37 | + - kind: ServiceAccount |
| 38 | + name: antidotesa |
| 39 | + |
| 40 | + |
| 41 | +--- |
| 42 | +apiVersion: v1 |
| 43 | +kind: ConfigMap |
| 44 | +metadata: |
| 45 | + name: acore-conf |
| 46 | + labels: |
| 47 | + name: acore-conf |
| 48 | +data: |
| 49 | + antidote-config.yml: |- |
| 50 | + curriculumDir: /curriculum |
| 51 | + instanceId: selfmedicate |
| 52 | + alwaysPull: false |
| 53 | + tier: local |
| 54 | + domain: antidote-local |
| 55 | + enabledServices: |
| 56 | + - api |
| 57 | + - stats |
| 58 | + - scheduler |
| 59 | +
|
| 60 | +--- |
| 61 | +apiVersion: extensions/v1beta1 |
| 62 | +kind: Deployment |
| 63 | +metadata: |
| 64 | + name: acore |
| 65 | +spec: |
| 66 | + replicas: 1 |
| 67 | + revisionHistoryLimit: 3 |
| 68 | + template: |
| 69 | + metadata: |
| 70 | + name: acore |
| 71 | + labels: |
| 72 | + app: acore |
| 73 | + antidote_role: infra |
| 74 | + spec: |
| 75 | + initContainers: |
| 76 | + - name: copy-local-files |
| 77 | + image: antidotelabs/deployer |
| 78 | + env: |
| 79 | + - name: SOURCE_DIR |
| 80 | + value: /antidote-ro |
| 81 | + - name: DEST_DIR |
| 82 | + value: /curriculum |
| 83 | + command: |
| 84 | + - /copy.sh |
| 85 | + volumeMounts: |
| 86 | + - mountPath: /curriculum |
| 87 | + name: local-copy |
| 88 | + readOnly: false |
| 89 | + - mountPath: /antidote-ro |
| 90 | + name: host-volume |
| 91 | + readOnly: true |
| 92 | + serviceAccount: antidotesa |
| 93 | + containers: |
| 94 | + - name: acore |
| 95 | + image: antidotelabs/antidote-core:latest # TEMPORARY - will be set to 0.6.0 after release |
| 96 | + imagePullPolicy: Always |
| 97 | + ports: |
| 98 | + # Only accessible from within the container |
| 99 | + # - containerPort: 50099 # GRPC |
| 100 | + - containerPort: 8086 # REST/HTTP |
| 101 | + readinessProbe: |
| 102 | + httpGet: |
| 103 | + path: / |
| 104 | + port: 8086 |
| 105 | + volumeMounts: |
| 106 | + - name: antidote-config-volume |
| 107 | + mountPath: /etc/antidote/ |
| 108 | + - mountPath: /curriculum |
| 109 | + name: local-copy |
| 110 | + readOnly: false |
| 111 | + - mountPath: /antidote-ro |
| 112 | + name: host-volume |
| 113 | + readOnly: true |
| 114 | + - image: nats |
| 115 | + name: nats |
| 116 | + ports: |
| 117 | + - containerPort: 4222 |
| 118 | + protocol: TCP |
| 119 | + - containerPort: 6222 |
| 120 | + protocol: TCP |
| 121 | + - containerPort: 8222 |
| 122 | + protocol: TCP |
| 123 | + - image: jaegertracing/jaeger-agent:1.9 # Ensure this matches what's deployed in the jaeger collector deployment |
| 124 | + name: jaeger-agent |
| 125 | + ports: |
| 126 | + - containerPort: 5775 |
| 127 | + protocol: UDP |
| 128 | + - containerPort: 6831 |
| 129 | + protocol: UDP |
| 130 | + - containerPort: 6832 |
| 131 | + protocol: UDP |
| 132 | + - containerPort: 5778 |
| 133 | + protocol: TCP |
| 134 | + # args: ["--reporter.grpc.host-port=127.0.0.1:30840"] |
| 135 | + # args: ["--reporter.grpc.host-port=jaeger:14267"] |
| 136 | + args: ["--collector.host-port=jaeger.prod.svc.cluster.local:14267"] #OLD |
| 137 | + # NOTE that grpc probably has a different port. Might want to label things properly and link to docs |
| 138 | + # also for testing if you're using nodeport might want to pick your ports so they don't change. |
| 139 | + |
| 140 | + volumes: |
| 141 | + - name: antidote-config-volume |
| 142 | + configMap: |
| 143 | + defaultMode: 420 |
| 144 | + name: acore-conf |
| 145 | + - name: host-volume |
| 146 | + hostPath: |
| 147 | + path: "/curriculum" |
| 148 | + - name: local-copy |
| 149 | + emptyDir: {} |
| 150 | + |
| 151 | +--- |
| 152 | +kind: Service |
| 153 | +apiVersion: v1 |
| 154 | +metadata: |
| 155 | + name: acore |
| 156 | +spec: |
| 157 | + selector: |
| 158 | + app: acore |
| 159 | + ports: |
| 160 | + # Only enable HTTP - grpc only accessible within the pod |
| 161 | + - name: http |
| 162 | + port: 8086 |
| 163 | + targetPort: 8086 |
| 164 | + type: ClusterIP |
| 165 | + |
| 166 | +--- |
| 167 | +apiVersion: extensions/v1beta1 |
| 168 | +kind: Ingress |
| 169 | +metadata: |
| 170 | + annotations: |
| 171 | + # https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/ |
| 172 | + ingress.kubernetes.io/ingress.class: "nginx" |
| 173 | + ingress.kubernetes.io/ssl-services: "acore" |
| 174 | + ingress.kubernetes.io/ssl-redirect: "true" |
| 175 | + ingress.kubernetes.io/force-ssl-redirect: "true" |
| 176 | + ingress.kubernetes.io/rewrite-target: "/" |
| 177 | + nginx.ingress.kubernetes.io/rewrite-target: "/" |
| 178 | + nginx.ingress.kubernetes.io/limit-connections: "10" |
| 179 | + nginx.ingress.kubernetes.io/limit-rps: "5" |
| 180 | + name: acore |
| 181 | +spec: |
| 182 | + rules: |
| 183 | + - http: |
| 184 | + paths: |
| 185 | + - path: "/acore" |
| 186 | + backend: |
| 187 | + serviceName: acore |
| 188 | + servicePort: 8086 |
0 commit comments