Blog

Blog

Kubernetes : Django, Redis, Frontend, Nginx (reverse proxy & ingress) setup on Bare Metal Server & CICD Guide

Follow Below Steps in sequence. FYI I have created EC2 on AWS.

  1. Create ubuntu 20 LTS instance. open 22, 80, 443 port.
  2. Enable net.bridge.bridge-nf-call-iptables
sudo su
cat > /etc/sysctl.d/20-bridge-nf.conf <<EOF
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system

     3. Install Docker...

Github Actions To deploy angular site to AWS cloudfront & S3

Prerequisites Github Secrets:

  • AWS_ACCESS_KEY_ID   :   AWS IAM user access having S3 and cloudfront permissions
  • AWS_SECRET_ACCESS_KEY
  • AWS_REGION
  • AWS_S3_BUCKET_NAME
  • AWS_CLOUDFRONT_ID

Please Follow Below in sequence (click below "read more" to read full article):

Create AWS Lambda Layers for python using Zappa

Here are quick steps to create Lambda Layer of python packages. (click below "read more" to read full article):

Mount NTFS drive in ubuntu with all permissions

My Ubuntu ext4 partition was running low in memory. so I removed all virtualenvs created on it and planned to move them to NTFS partition.

But got:

Operation not permitted

Django Admin File field ( Widget ) for AWS Identity based S3 uploads

When you are working with AWS serverless, You probably has faced body size limit for your lambda function. Basically It won't allow file uploads beyond size limit specified. 
Here is guide if you are using Django in your website and deployed on AWS Lambda + API Gateway ( Zappa ) And want to allow file uploads of any size in Django Admin using AWS S3 Identity based uploads.

Write One API which give response as following json : 
     `/api/awsIdentity/` // any endpoint you like make sure authenticated and GET only
     {

          "IdentityId": "",
          "Token": "",
          "bucket_name": "",
          "bucket_region": "",
          "auth_role_arn": ""
     }

Your widget for File Field And Admin Form will looks like this : 

    from django import forms
    from django.contrib import admin