YML file API example


apiVersion: v1
kind: Service
metadata:
  labels:
    run: NAME_SERVER
  name: NAME_SERVER
  namespace: default
spec:
  externalTrafficPolicy: Cluster
  ports:
  - name: port
    port: PORT
    protocol: TCP
    targetPort: PORT
  selector:
    run: NAME_SERVER
  sessionAffinity: None
  type: NodePort
status:
  loadBalancer: {}

---

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
  labels:
    run: NAME_SERVER
  name: NAME_SERVER
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      run: NAME_SERVER
  template:
    metadata:
      creationTimestamp: null
      labels:
        run: NAME_SERVER
    spec:
      containers:
      - image: DOCKER_HUB_IMAGE
        imagePullPolicy: Always
        name: NAME_SERVER
        ports:
        - containerPort: PORT
          protocol: TCP
YML file API example
Compartilhe isto