add failover manifest

This commit is contained in:
Mike Ray (SQL)
2018-10-05 10:31:11 -07:00
parent 2d87e6024d
commit 4362f40abd
@@ -0,0 +1,46 @@
apiVersion: v1
kind: ServiceAccount
metadata: {name: manual-failover, namespace: ag1}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata: {name: manual-failover, namespace: ag1}
rules:
- apiGroups: ['']
resourceNames: [ag1]
resources: [configmaps]
verbs: [get, update]
- apiGroups: ['']
resourceNames: [ag1]
resources: [endpoints]
verbs: [get]
- apiGroups: ['']
resources: [pods]
verbs: [list]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata: {name: manual-failover, namespace: ag1}
roleRef: {apiGroup: rbac.authorization.k8s.io, kind: Role, name: manual-failover}
subjects:
- {kind: ServiceAccount, name: manual-failover}
---
apiVersion: batch/v1
kind: Job
metadata: {name: manual-failover, namespace: ag1}
spec:
template:
metadata: {name: manual-failover}
spec:
containers:
- command: [/mssql-server-k8s-failover]
env:
- {name: MSSQL_K8S_AG_NAME, value: ag1}
- {name: MSSQL_K8S_NEW_PRIMARY, value: <containerName>}
- name: MSSQL_K8S_NAMESPACE
valueFrom:
fieldRef: {fieldPath: metadata.namespace}
image: mcr.microsoft.com/mssql/ha:vNext-CTP2.0-ubuntu
name: manual-failover
restartPolicy: Never
serviceAccount: manual-failover