kubebuilder and operator-sdk are two major tools used to set up a controller/operator code base for kubernetes CRDs. Both of them under the hood using controller-runtime to adding a manager, api scheme and creates an structs implements a reconciler interface, thus the major difference are around the tools for integration, testing and etc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
from datetime import datetime | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import Column, Integer, String, Boolean, Enum, ForeignKey, DateTime | |
TEMPLATE_ID = '00000000-0000-0000-0000-000000000003' | |
CREDENTIAL_ID = '00000000-0000-0000-0000-000000000001' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: tenant_compute* | |
gather_facts: no | |
tasks: | |
- shell: ovs-vsctl list-ports br-int | egrep "tap" | sed "s/^tap//" | |
register: qvo | |
- shell: ovs-vsctl get Port qvo{{item}} tag | |
with_items: qvo.stdout_lines | |
register: qvo_tags |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a lookup for yaml file | |
# e.g /path/to/yaml/file | |
# --- | |
# foo: foo_value | |
# users: | |
# user_one: Jim | |
# user_two: Tom | |
# | |
# With inline lookup, the value of the key has to be a string | |
# 1. var1: "{{lookup('yaml_file', '/path/to/yaml/file key=foo')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- What do Etcd, Consul, and Zookeeper do? | |
- Service Registration: | |
- Host, port number, and sometimes authentication credentials, protocols, versions | |
numbers, and/or environment details. | |
- Service Discovery: | |
- Ability for client application to query the central registry to learn of service location. | |
- Consistent and durable general-purpose K/V store across distributed system. | |
- Some solutions support this better than others. | |
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state. | |
- Centralized locking can be based on this K/V store. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
gerrit_user='<user>' | |
gerrit_pass='<pass>' | |
gerrit_ip='<gerrit_ip>' | |
gerrit_port='8083' | |
gerrit_clone_port='29418' | |
backup_dir="/path/to/git_backup/dir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rufus-scheduler' | |
module Clipper | |
class TaskScheduler | |
def initialize(logger) | |
@scheduler = build_scheduler(logger) | |
@scheduled_tasks = [] | |
@running = false |