ask stack
ask stack

Reputation: 1

EDIT : how to make a service with active/passive option to choose only a master pod?

if i have this deployment file & its service :

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nix
  labels:
    app: nix-app
    name: nix
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nix-app
      name: nix
  template:
    metadata:
      name: nix
      labels:
        app: nix-app
        name: nix
    spec:
      containers:
      - name: nix
        image: nginx
        ports:
          - containerPort: 8000
        imagePullPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
  name: svc
  labels:
    name:  svc
    app: nix-app
spec:
  type: ClusterIP
  ports:
   - port: 8000
     targetPort: 8000
  selector:
     app: nix-app
     name: nix
     

and I want to make the service with an option to choose one pod as a master and the other being passive and if the master has been terminated the passive will work. any idea? tnx

Upvotes: 0

Views: 171

Answers (0)

Related Questions