Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
   $ cat <<EOF >~/nginx-app.yaml
   apiVersion: v1
   kind: Service
   metadata:
      name: nginx
      labels:
        app: nginx
   spec:
      type: NodePort
      ports:
      - port: 80
        protocol: TCP
        name: http
      selector:
        app: nginx
   ---
   apiVersion: v1
   kind: ReplicationController
   metadata:
      name: nginx
   spec:
      replicas: 2
      template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
    EOF

then test the Kubernetes working status with the script:

...