Skip to content

Instantly share code, notes, and snippets.

View dangtrinhnt's full-sized avatar
😎
Busy changing the world

Trinh Nguyen dangtrinhnt

😎
Busy changing the world
View GitHub Profile
@dangtrinhnt
dangtrinhnt / metallb.yaml
Created May 2, 2020 16:37
MetalLB deployment file for MicroK8S
apiVersion: v1
kind: Namespace
metadata:
labels:
app: metallb
name: metallb-system
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
@dangtrinhnt
dangtrinhnt / cleanup_kong_ingress_controller.sh
Last active October 7, 2019 09:56
Clean up kong-ingress-controller
kubectl delete serviceaccount kong-serviceaccount -n kong
kubectl delete clusterrolebinding kong-ingress-clusterrole-nisa-binding -n kong
kubectl delete service kong-proxy -n kong
kubectl delete -n kong service kong-validation-webhook
kubectl delete -n kong service postgres
kubectl delete -n kong deployment ingress-kong
kubectl delete -n kong statefulset postgres
kubectl delete -n kong job kong-migrations
kubectl delete -n kong customresourcedefinitions kongconsumers.configuration.konghq.com
kubectl delete -n kong customresourcedefinitions kongcredentials.configuration.konghq.com
@dangtrinhnt
dangtrinhnt / exclude_sidecar_injection_sample.yaml
Last active October 7, 2019 09:53
Exclude Istio's sidecar injection sample
apiVersion: batch/v1
kind: Job
metadata:
name: MyService
namespace: ABC
spec:
template:
metadata:
annotations:
sidecar.istio.io/inject: "false"
@dangtrinhnt
dangtrinhnt / httpbin-gateway.yaml
Created August 30, 2019 09:39
httpbin-gateway istio sample
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: httpbin-gateway
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
@dangtrinhnt
dangtrinhnt / sleep.yaml
Created August 30, 2019 09:37
sleep service of istio sample
# Copyright 2017 Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@dangtrinhnt
dangtrinhnt / httpbin.yaml
Created August 30, 2019 09:33
httpbin service istio sample
# Copyright 2017 Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@dangtrinhnt
dangtrinhnt / keycloak.yaml
Created August 30, 2019 09:24
KeyCloak K8S deployment service
keycloak:
service:
type: LoadBalancer
password: mykeycloakadminpasswd
persistence:
deployPostgres: true
dbVendor: postgres
@dangtrinhnt
dangtrinhnt / suricata_vnfd.yaml
Created July 22, 2018 19:22
SURICATA VNFD used for dynamic SFC update
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
description: suricata
metadata:
template_name: suricata
topology_template:
node_templates:
VDU1:
type: tosca.nodes.nfv.VDU.Tacker
capabilities:
@dangtrinhnt
dangtrinhnt / vnffg_update_command
Last active July 22, 2018 19:25
VNFFG update command
/usr/local/bin/openstack --os-username admin \
--os-password devstack \
--os-project-name admin \
--os-user-domain-name default \
--os-project-domain-name default \
--os-project-domain-id default \
--os-auth-url http://<devstack ip address>/identity/v3 \
--os-region-name RegionOne \
vnf graph set \
--vnffgd-template /path/to/vnffgd_block_icmp.yaml <name of the existing no classifier VNFFG>
#!/usr/bin/env python
"""
This script is about telling want you need *today* - not what you want to hear
""" # noqa
import sys
import math
from argparse import ArgumentParser
parser = ArgumentParser(description=__doc__.lstrip())