EUGENIO SOUZA CARVALHO 3 years ago
parent
commit
82679dbc4d
1 changed files with 29 additions and 36 deletions
  1. 29 36
      040-app.yaml

+ 29 - 36
040-app.yaml

@@ -1,67 +1,60 @@
 kind: Deployment
 apiVersion: apps/v1
 metadata:
-  name: stilton
+  name: whoami
   labels:
-    app: cheese
-    cheese: stilton
+    app: containous
+    name: whoami
+
 spec:
   replicas: 2
   selector:
     matchLabels:
-      app: cheese
-      task: stilton
+      app: containous
+      task: whoami
   template:
     metadata:
       labels:
-        app: cheese
-        task: stilton
-        version: v0.0.1
+        app: containous
+        task: whoami
     spec:
       containers:
-      - name: cheese
-        image: errm/cheese:stilton
-        ports:
-        - containerPort: 80
+        - name: containouswhoami
+          image: containous/whoami
+          ports:
+            - containerPort: 80
+
 ---
 apiVersion: v1
 kind: Service
 metadata:
-  name: stilton
+  name: whoami
+
 spec:
   ports:
-  - name: http
-    targetPort: 80
-    port: 80
+    - name: http
+      port: 80
   selector:
-    app: cheese
-    task: stilton
----
----
-apiVersion: v1
-kind: Secret
-metadata:
-  name: supersecret
-data:
-  tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0=
-  tls.key: LS0tLS1CRUdJTiBQUklWQVRFIEtFWS0tLS0tCi0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0=
+    app: containous
+    task: whoami
 
 ---
 kind: Ingress
 apiVersion: networking.k8s.io/v1beta1
 metadata:
-  name: cheese
+  name: myingress
   annotations:
-    traefik.ingress.kubernetes.io/router.entrypoints: websecure
-    traefik.ingress.kubernetes.io/router.tls: "true"
+    traefik.ingress.kubernetes.io/router.entrypoints: web
 spec:
-  tls:
-    - secretName: supersecret
   rules:
-    - host: traefik.eugeniocarvalho.dev
+    - host: k8s.eugeniocarvalho.dev
       http:
         paths:
-          - path: ""
+          - path: /bar
+            backend:
+              serviceName: whoami
+              servicePort: 80
+          - path: /foo
             backend:
-              serviceName: stilton
-              servicePort: http
+              serviceName: whoami
+              servicePort: 80