INT 21h

Hi, I am Vladimir Smagin, SysAdmin, DevOps and barely good guy. Telegram Email / GIT / Микроблог / Thingiverse / GPG

Django operator for Kubernetes

№ 10240 В разделах: Programming Sysadmin от August 22nd, 2019,
В подшивках: , , , ,

You can run projects with collectstatic and migrations at init stage, provide ENVs, service and pods annotations.

https://git.blindage.org/21h/django-operator

Full Spec:

image specific settings

PullPolicy: imagePullPolicy, default IfNotPresent
Image: string, required, format “image:tag”
Replicas: integer, default 1

manage resources

Read more about resources limiting here https://kubernetes.io/docs/concepts/policy/resource-quotas/

PodRequests: default is empty
PodLimits: default is empty

Affinity and antiaffinity manual https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity

Affinity: default is empty

set annotations to service and pod

ServiceAnnotations: key: value dict, default is empty
PodAnnotations: key: value dict, default is empty

application specific configuration

AppPort: integer, internal application port, default 8000
AppEnv: EnvVar array, default is empty
AppStaticPath: string, path to static files, default /app/static
RunMigrate: bool, run migrations at init stage, default False
RunCollectStatic: bool, run collectstatic at init stage, default False

Нет комментариев »

WordPress operator for Kubernetes

№ 10224 В разделах: Programming Sysadmin от August 18th, 2019,
В подшивках: , , , ,

Run multiple WordPress instances in your Kubernetes cluster. Use internal or external database. Internal database means a single pod with MariaDB without any replication or clusterization, my WordPress operator is NOT MySQL operator. If you need database high availability use MySQL operator to create cluster.

https://git.blindage.org/21h/wordpress-operator

Нет комментариев »

scheme.AddGeneratedDeepCopyFuncs undefined

№ 10195 В разделе "Programming" от August 9th, 2019,
В подшивках:

pkg/apis/redis/v1/zz_generated.deepcopy.go:22:15: scheme.AddGeneratedDeepCopyFuncs undefined 
(type *"github.com/tekliner/im-redis-operator/vendor/k8s.io/apimachinery/pkg/runtime".Scheme has 
no field or method AddGeneratedDeepCopyFuncs)

pkg/apis/redis/v1/zz_generated.deepcopy.go:23:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:27:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:31:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:35:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:39:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:43:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:47:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:51:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:55:3: undefined: conversion.GeneratedDeepCopyFunc
pkg/apis/redis/v1/zz_generated.deepcopy.go:55:3: too many errors
^Cmake: *** [Makefile:14: bin/redis] Interrupt 

Update versions of client-go, api and apimachinery. Install code generation tools.

go get k8s.io/code-generator
go get k8s.io/klog
cd ~/go/src/k8s.io/code-generator
go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen}

Now rebuild project.

Нет комментариев »

Splash: how to change user-agent with Lua in Bash

№ 10157 В разделах: Programming Sysadmin от August 3rd, 2019,
В подшивках: , , ,

Before start install jq application, required to work with JSON, used to prepare lua script for sending to Splash API.

Create file named splash.lua

function main(splash, args)
  splash:set_user_agent('Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11 Safari/525.20')
  splash:set_viewport_size(800, 600)
  splash:go('https://www.whatismybrowser.com/')
  splash:wait(0.5)
  return splash:png()
end

Create bash script run.sh

#!/bin/bash

JSON="{\"lua_source\":$(jq -Rs . < script.lua)}"

curl -s -X POST -H "Content-Type: application/json" -d "${JSON}" \
   "http://192.168.1.9:5009/execute" -o out.png

Check result image

Нет комментариев »

Микроблог перейти

# 2019-12-23 09:14:01

Очень интересная концепция, docker-compose для kubernetes kompose.io/ #devops #kubernetes #docker

# 2019-12-16 17:21:18

Надо будет почитать для общего развития как оживить кластер в случае проеба сертов habr.com/ru/company/southbridg #kubernetes #devops

# 2019-12-12 17:33:46

js bootstrap с интерфейсом как в DOS github.com/kristopolous/BOOTST


© Vladimir Smagin, 2005-2019. Копирование материалов без разрешения запрещено. GPG DA4CD0F5E222EA727D6A40C413BCE12E5618F071 *
Яндекс.Метрика

Fortune cookie: "I am against religion because it teaches us to be satisfied with not understanding the world." [Richard Dawkins]