sudo snap install lxd
sudo lxd init
# ref: https://coderwall.com/p/ez1x2w/send-mail-like-a-boss | |
# install mailx | |
yum -y install mailx | |
# create a directory with a certificate, to send mail using TLS | |
mkdir ~/.certs | |
certutil -N -d ~/.cert | |
# create a user ~/.mailrc, to use custom settings |
import jenkins | |
import time | |
# It comes with pip module python-jenkins | |
# use pip to install python-jenkins | |
# Jenkins Authentication URL | |
JENKINS_URL = "https://xxxx" | |
JENKINS_USERNAME = "xxxxx" | |
JENKINS_PASSWORD = "xxxxxxx" |
#!/bin/bash | |
# file: startstop.sh | |
#---- | |
# Simple script to start / stop a python script in the background. | |
#---- | |
#---- | |
# To Use: |
# List images in k8s | |
ctr --namespace k8s.io image list | |
# Create etcd snapshot | |
ctr --namespace k8s.io \ | |
run \ | |
--mount type=bind,src={{ backup_temp_dir.path }}/,dst=/backup/,options=rbind:rw \ | |
--net-host \ | |
--env ETCDCTL_API=3 \ | |
--rm "{{ etcd_image_name.stdout | trim }}" \ |
# crictl documentation: https://kubernetes.io/docs/tasks/debug-application-cluster/crictl/ | |
# Runtime endpoints: | |
sudo crictl --runtime-endpoint unix:///run/containerd/containerd.sock | |
sudo crictl --runtime-endpoint unix:///var/run/dockershim.sock | |
sudo crictl --runtime-endpoint unix:///run/crio/crio.sock | |
## Containers | |
# Get all containers |
name: AKS Deployment | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
AZURE_CONTAINER_REGISTRY: "repo.azurecr.io" |
# Logs in to the Azure Container Registry | |
- uses: Azure/docker-login@v1 | |
with: | |
login-server: ${{ env.AZURE_CONTAINER_REGISTRY }} | |
username: ${{ secrets.ACR_USERNAME }} | |
password: ${{ secrets.ACR_PASSWORD }} | |
# Build and push image to Azure Container Registry | |
- name: Build and push image to Azure Container Registry | |
run: | |
#!/usr/bin/env bash | |
# Versoin one | |
oc get $(oc api-resources --namspaced=true | tail -n+2 | awk '{ print $1 }' | xargs | sed -e 's/\s/,/g') | |
# Version two (from https://access.redhat.com/solutions/4165791) | |
oc api-resources --verbs=list --namespaced -o name | xargs -n 1 oc get --show-kind --ignore-not-found -n $PROJECT_NAME |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
annotations: | |
deployment.kubernetes.io/revision: "1" | |
kubectl.kubernetes.io/last-applied-configuration: | | |
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"basic-ocp-demo"},"name":"basic-ocp-demo","namespace":"basic-ocp-demo-project"},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"basic-ocp-demo"}},"template":{"metadata":{"labels":{"app":"basic-ocp-demo"}},"spec":{"containers":[{"env":[{"name":"BASIC_OCP_DEMO_ENV","value":"master"}],"image":"quay.io/freedomben/basic-ocp-demo:latest","imagePullPolicy":"Always","name":"basic-ocp-demo","ports":[{"containerPort":4567,"protocol":"TCP"}],"readinessProbe":{"httpGet":{"path":"/healthz","port":4567,"scheme":"HTTP"},"initialDelaySeconds":5,"periodSeconds":1}}]}}}} | |
creationTimestamp: "2021-01-08T02:09:21Z" | |
generation: 1 | |
labels: |