Commit 3fcb0484 authored by Jose Ernesto Suarez's avatar Jose Ernesto Suarez

Ajustes para el ingress

parent 27e57868
apiVersion: v1
kind: Service
metadata:
name: app-final-service
spec:
type: LoadBalancer
selector:
app: app-final
ports:
- protocol: TCP
port: 80
targetPort: foreman-port
\ No newline at end of file
...@@ -86,17 +86,3 @@ spec: ...@@ -86,17 +86,3 @@ spec:
- name: activestorage - name: activestorage
persistentVolumeClaim: persistentVolumeClaim:
claimName: rails-activestorage-claim claimName: rails-activestorage-claim
#Montar el Liveness
---
apiVersion: v1
kind: Service
metadata:
name: app-final-service
spec:
type: LoadBalancer
selector:
app: app-final
ports:
- protocol: TCP
port: 80
targetPort: foreman-port
\ No newline at end of file
...@@ -3,52 +3,22 @@ kind: Service ...@@ -3,52 +3,22 @@ kind: Service
metadata: metadata:
name: app-final-service name: app-final-service
spec: spec:
type: ClusterIP
selector: selector:
app: app-final app: app-final
ports: ports:
- protocol: TCP - protocol: TCP
port: 80 port: 5000
targetPort: foreman-port
---
apiVersion: v1
kind: Service
metadata:
name: first-app-service
spec:
type: ClusterIP
selector:
app: firstapp
ports:
- protocol: TCP
port: 80
targetPort: nodejs-port
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: first-deploy-service name: first-deploy-service
spec: spec:
type: ClusterIP
selector: selector:
app: firstdeploy app: firstdeploy
ports: ports:
- protocol: TCP - protocol: TCP
port: 80 port: 3000
targetPort: nodejs-port
---
apiVersion: v1
kind: Service
metadata:
name: awesome-service
spec:
type: ClusterIP
selector:
app: firstapp
ports:
- protocol: TCP
port: 80
targetPort: nodejs-port
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
...@@ -56,23 +26,19 @@ metadata: ...@@ -56,23 +26,19 @@ metadata:
name: cool-app name: cool-app
spec: spec:
type: type:
type: ClusterIP
selector: selector:
app: rails app: rails
ports: ports:
- protocol: TCP - protocol: TCP
port: 80 port: 3000
targetPort: rails-port
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: sinatra name: sinatra
spec: spec:
type: ClusterIP
selector: selector:
app: sinatra app: sinatra
ports: ports:
- protocol: TCP - protocol: TCP
port: 80 port: 4567
targetPort: 4567 \ No newline at end of file
\ No newline at end of file
kubectl apply -f ../3.deployments/first-app-deployment.yaml
kubectl apply -f ../6.secrets/cool-app.yaml
kubectl apply -f ../9.configmaps/sinatra.yaml
kubectl apply -f ../11.app-final/mysql-configmap.yaml
kubectl apply -f ../11.app-final/mysql-secret.yaml
kubectl apply -f ../11.app-final/mysql-storage.yaml
kubectl apply -f ../11.app-final/mysql.yaml
kubectl apply -f ../11.app-final/app-config.yaml
kubectl apply -f ../11.app-final/app-storage.yaml
kubectl apply -f ../11.app-final/app.yaml
kubectl apply -f ./app-services.yaml
\ No newline at end of file
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-resource
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /hello
backend:
serviceName: hello-app
servicePort: 8080
\ No newline at end of file
...@@ -3,10 +3,10 @@ kind: Ingress ...@@ -3,10 +3,10 @@ kind: Ingress
metadata: metadata:
name: ingress-frontend name: ingress-frontend
annotations: annotations:
nginx.ingress.kubernetes.io/auth-type: basic #nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth #nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Service' #nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - Service'
kubernetes.io/ingress.class: gce kubernetes.io/ingress.class: nginx
spec: spec:
tls: tls:
- hosts: - hosts:
...@@ -19,25 +19,25 @@ spec: ...@@ -19,25 +19,25 @@ spec:
- path: / - path: /
backend: backend:
serviceName: cool-app serviceName: cool-app
servicePort: 80 servicePort: 3000
- host: deploy.edu.wedoops.io - host: deploy.edu.wedoops.io
http: http:
paths: paths:
- path: / - path: /
backend: backend:
serviceName: first-deploy-service serviceName: first-deploy-service
servicePort: 80 servicePort: 3000
- host: sinatra.edu.wedoops.io - host: sinatra.edu.wedoops.io
http: http:
paths: paths:
- path: / - path: /
backend: backend:
serviceName: sinatra serviceName: sinatra
servicePort: 80 servicePort: 4567
- host: final.edu.wedoops.io - host: final.edu.wedoops.io
http: http:
paths: paths:
- path: / - path: /
backend: backend:
serviceName: app-final-service serviceName: app-final-service
servicePort: 80 servicePort: 5000
\ No newline at end of file \ No newline at end of file
apiVersion: v1 apiVersion: v1
data: data:
auth: RWwuY3Vyc28uZGUuRGVjZW0uaGEuZXN0YWRvLmdlbmlhbA== auth: YWRtaW46RWwuY3Vyc28uZGUuRGVjZW0uaGEuZXN0YWRvLmdlbmlhbA==
kind: Secret kind: Secret
metadata: metadata:
name: basic-auth name: basic-auth
......
#!/bin/bash
docker run -it --rm --name certbot \
-v "/Users/ernesto/Code/SRE/certbot/etc:/etc/letsencrypt" \
-v "/Users/ernesto/Code/SRE/certbot/lib:/var/lib/letsencrypt" \
certbot/certbot certonly --manual --preferred-challenges dns
echo "PASS: $(kubectl get secret basic-auth -o jsonpath="{.data.auth}" | base64 --decode)"
\ No newline at end of file
apiVersion: v1
kind: Service
metadata:
name: sinatra
spec:
type: LoadBalancer
selector:
app: sinatra
ports:
- protocol: TCP
port: 80
targetPort: 4567
\ No newline at end of file
...@@ -19,16 +19,3 @@ spec: ...@@ -19,16 +19,3 @@ spec:
envFrom: envFrom:
- configMapRef: - configMapRef:
name: backend-config name: backend-config
---
apiVersion: v1
kind: Service
metadata:
name: sinatra
spec:
type: LoadBalancer
selector:
app: sinatra
ports:
- protocol: TCP
port: 80
targetPort: 4567
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment