Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia | ||
info:cursos:pue:devops:sesion12 [23/03/2019 03:24] – mate | info:cursos:pue:devops:sesion12 [08/04/2020 06:59] (actual) – mate | ||
---|---|---|---|
Línia 1: | Línia 1: | ||
- | = Sesión 12 : k8s | + | = Sesión 12 : k8s (traefik) |
+ | {{tag> | ||
== k8s | == k8s | ||
=== lab (traefik) | === lab (traefik) | ||
Línia 284: | Línia 285: | ||
</ | </ | ||
- | === objetos kubernetes | + | === lab (flocker) |
+ | * '' | ||
+ | |||
+ | ==== instalar (sin flocker) un WP y MYSQL | ||
+ | * mysql:< | ||
+ | apiVersion: v1 | ||
+ | kind: Secret | ||
+ | metadata: | ||
+ | name: mysql-secret | ||
+ | type: Opaque | ||
+ | data: | ||
+ | password: cm9vdA== | ||
+ | </ | ||
+ | <code yaml; mysql.yaml> | ||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | name: wordpress-mysql | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | spec: | ||
+ | ports: | ||
+ | - port: 3306 | ||
+ | selector: | ||
+ | app: wordpress | ||
+ | tier: mysql | ||
+ | clusterIP: None | ||
+ | --- | ||
+ | apiVersion: v1 | ||
+ | kind: PersistentVolumeClaim | ||
+ | metadata: | ||
+ | name: mysql-pv-claim | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | spec: | ||
+ | accessModes: | ||
+ | - ReadWriteOnce | ||
+ | resources: | ||
+ | requests: | ||
+ | storage: 20Gi | ||
+ | --- | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | name: wordpress-mysql | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | spec: | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: wordpress | ||
+ | tier: mysql | ||
+ | strategy: | ||
+ | type: Recreate | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | tier: mysql | ||
+ | spec: | ||
+ | containers: | ||
+ | - image: mysql:5.6 | ||
+ | name: mysql | ||
+ | env: | ||
+ | - name: MYSQL_ROOT_PASSWORD | ||
+ | valueFrom: | ||
+ | secretKeyRef: | ||
+ | name: mysql-secret | ||
+ | key: password | ||
+ | ports: | ||
+ | - containerPort: | ||
+ | name: mysql | ||
+ | volumeMounts: | ||
+ | - name: mysql-persistent-storage | ||
+ | mountPath: / | ||
+ | volumes: | ||
+ | - name: mysql-persistent-storage | ||
+ | persistentVolumeClaim: | ||
+ | claimName: mysql-pv-claim | ||
+ | </ | ||
+ | <code yaml; wordpress.yaml> | ||
+ | apiVersion: v1 | ||
+ | kind: Service | ||
+ | metadata: | ||
+ | name: wordpress-service | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | spec: | ||
+ | ports: | ||
+ | - name: http | ||
+ | targetPort: 80 | ||
+ | port: 80 | ||
+ | # - port: 80 | ||
+ | selector: | ||
+ | app: wordpress | ||
+ | tier: frontend | ||
+ | # type: LoadBalancer | ||
+ | --- | ||
+ | apiVersion: v1 | ||
+ | kind: PersistentVolumeClaim | ||
+ | metadata: | ||
+ | name: wp-pv-claim | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | spec: | ||
+ | accessModes: | ||
+ | - ReadWriteOnce | ||
+ | resources: | ||
+ | requests: | ||
+ | storage: 20Gi | ||
+ | --- | ||
+ | apiVersion: apps/v1 | ||
+ | kind: Deployment | ||
+ | metadata: | ||
+ | name: wordpress | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | spec: | ||
+ | # replicas: 1 | ||
+ | selector: | ||
+ | matchLabels: | ||
+ | app: wordpress | ||
+ | tier: frontend | ||
+ | # strategy: | ||
+ | # type: Recreate | ||
+ | template: | ||
+ | metadata: | ||
+ | labels: | ||
+ | app: wordpress | ||
+ | tier: frontend | ||
+ | spec: | ||
+ | containers: | ||
+ | - image: wordpress: | ||
+ | name: wordpress | ||
+ | env: | ||
+ | - name: WORDPRESS_DB_HOST | ||
+ | value: wordpress-mysql | ||
+ | - name: WORDPRESS_DB_PASSWORD | ||
+ | valueFrom: | ||
+ | secretKeyRef: | ||
+ | name: mysql-secret | ||
+ | key: password | ||
+ | ports: | ||
+ | - containerPort: | ||
+ | name: wordpress | ||
+ | volumeMounts: | ||
+ | - name: wordpress-persistent-storage | ||
+ | mountPath: / | ||
+ | volumes: | ||
+ | - name: wordpress-persistent-storage | ||
+ | persistentVolumeClaim: | ||
+ | claimName: wp-pv-claim | ||
+ | --- | ||
+ | apiVersion: extensions/ | ||
+ | kind: Ingress | ||
+ | metadata: | ||
+ | name: wordpress-ingress | ||
+ | annotations: | ||
+ | kubernetes.io/ | ||
+ | spec: | ||
+ | rules: | ||
+ | - host: wordpress-192-168-99-100.nip.io | ||
+ | http: | ||
+ | paths: | ||
+ | - path: / | ||
+ | backend: | ||
+ | serviceName: | ||
+ | servicePort: | ||
+ | </ | ||
+ | |||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * lo que no se muestra: | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | ==== flocker | ||
+ | * instalación: | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | == objetos kubernetes | ||
* replicationcontroller: | * replicationcontroller: | ||
* replicaset: [[https:// | * replicaset: [[https:// | ||
Línia 300: | Línia 488: | ||
* persistentVolumeProvisioning: | * persistentVolumeProvisioning: | ||
* storage classes: [[https:// | * storage classes: [[https:// | ||
+ | * secrets: [[https:// | ||
+ | * labels: [[https:// | ||
== otros | == otros | ||
* '' | * '' |