Skip to content

Commit 2a51886

Browse files
authored
Merge pull request #450 from MikeRayMSFT/master
Add failover manifest
2 parents 810e7c3 + 4362f40 commit 2a51886

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

  • samples/features/high availability/Kubernetes/sample-manifest-files
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata: {name: manual-failover, namespace: ag1}
4+
---
5+
apiVersion: rbac.authorization.k8s.io/v1
6+
kind: Role
7+
metadata: {name: manual-failover, namespace: ag1}
8+
rules:
9+
- apiGroups: ['']
10+
resourceNames: [ag1]
11+
resources: [configmaps]
12+
verbs: [get, update]
13+
- apiGroups: ['']
14+
resourceNames: [ag1]
15+
resources: [endpoints]
16+
verbs: [get]
17+
- apiGroups: ['']
18+
resources: [pods]
19+
verbs: [list]
20+
---
21+
apiVersion: rbac.authorization.k8s.io/v1
22+
kind: RoleBinding
23+
metadata: {name: manual-failover, namespace: ag1}
24+
roleRef: {apiGroup: rbac.authorization.k8s.io, kind: Role, name: manual-failover}
25+
subjects:
26+
- {kind: ServiceAccount, name: manual-failover}
27+
---
28+
apiVersion: batch/v1
29+
kind: Job
30+
metadata: {name: manual-failover, namespace: ag1}
31+
spec:
32+
template:
33+
metadata: {name: manual-failover}
34+
spec:
35+
containers:
36+
- command: [/mssql-server-k8s-failover]
37+
env:
38+
- {name: MSSQL_K8S_AG_NAME, value: ag1}
39+
- {name: MSSQL_K8S_NEW_PRIMARY, value: <containerName>}
40+
- name: MSSQL_K8S_NAMESPACE
41+
valueFrom:
42+
fieldRef: {fieldPath: metadata.namespace}
43+
image: mcr.microsoft.com/mssql/ha:vNext-CTP2.0-ubuntu
44+
name: manual-failover
45+
restartPolicy: Never
46+
serviceAccount: manual-failover

0 commit comments

Comments
 (0)