MigrationToKubernetesSheckList
preparing:
Move to Node
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
type: NodePort
ports:
- port: 80
protocol: TCP
name: http
# ports:
# - protocol: "TCP"
# nodePort: 32111
# port: 80
selector:
app: nginx
# ports:
# - protocol: "TCP"
# port: 80
add helsChecks
spec:
containers:
- name: nginx
image: nginx
ports:
- name: http
containerPort: 80
# ports:
# - containerPort: 80
# HTTP Health Check
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
Create Secret ssl key
kubectl create secret tls foo-secret --key /tmp/tls.key --cert /tmp/tls.crt
kubectl create secret tls custom-tls-cert --key /path/to/tls.key --cert /path/to/tls.crt
kubectl create secret tls ssl-u4u-ru --key ssl/u4u_ru_private.key --cert ssl/u4u_ru_union.crt
Prepering Ingress file
Example:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: "ingress-develop-u4u-online"
annotations:
# External IP address name in Google Cloud
# kubernetes.io/ingress.global-static-ip-name: "production-u4u-ru"
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/proxy-body-size: "500m"
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/configuration-snippet: |
if ($host = 'www.develop.u4u.online' ) {
return 308 $scheme://develop.u4u.online$request_uri;
}
spec:
tls:
- hosts:
- develop.u4u.online # Your host. CHANGE ME
secretName: ssl-letsencrypt-develop-u4u-online # Name of the secret
rules:
- host: develop.u4u.online # CHANGE ME!
http:
paths:
- path: /
backend:
serviceName: u4u
servicePort: http
1. Create Test User in old Prod
2. Maintenens page
3. Create BackUp with custom name
4. Restore BackUp to new prod
5. Check User exist and new server work properly
7. Pull Out external Ip from old domain. We will use this IP in vars name CHANGE_TO_VALID_EXTERNAL_IP
8. Install controller-ingress
may be: 104.155.127.157
helm install --namespace kube-system --name nginx-ingress stable/nginx-ingress --set rbac.create=true --set controller.service.externalIPs={CHANGE_TO_VALID_EXTERNAL_IP}
9. Test with DEC configmap
10. Change to PROD configmap. Test
kubectl create configmap production.u4u.ru --dry-run --from-env-file u4u/env_config/production.dev_vers.u4u.ru.ini -o yaml | kubectl replace -f -
Debug Ingress Controlle
Cert Maneger Debug:
kubectl logs --ollow cert-manager-05-54cbd9c87c-lzpjp
Curl
curl -v https://www.develop.u4u.online
Access to nginx config file
kubectl exec vetoed-tarsier-nginx-ingress-controller-789f7677f6-vsvrf -n kube-system cat /etc/nginx/nginx.conf > nginx.conf.6
$ kubectl --namespace kube-system exec -it vetoed-tarsier-nginx-ingress-controller-789f7677f6-vsvrf -- /bin/bash
$ cat /etc/nginx/nginx.conf