Skip to content

Instantly share code, notes, and snippets.

View velotiotech's full-sized avatar

Velotio Technologies velotiotech

View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: mysql-service
spec:
ports:
- port: 3306
targetPort: 3306
protocol: TCP
name: http
apiVersion: v1
kind: Service
metadata:
name: test-service
spec:
type: LoadBalancer
ports:
- name: test-service
port: 80
protocol: TCP
async.parallel([
function(callback) {
setTimeout(function() {
console.log('Task One');
callback(null, 1);
}, 200);
},
function(callback) {
setTimeout(function() {
console.log('Task Two');
async.series([
function(callback) {
console.log('one');
callback(null, 1);
},
function(callback) {
console.log('two');
callback(null, 2);
},
function(callback) {
async.waterfall([
function(callback) {
callback(null, 'Task 1', 'Task 2');
},
function(arg1, arg2, callback) {
// arg1 now equals 'Task 1' and arg2 now equals 'Task 2'
let arg3 = arg1 + ' and ' + arg2;
callback(null, arg3);
},
function(arg1, callback) {
// create a queue object with concurrency 2
var q = async.queue(function(task, callback) {
console.log('Hello ' + task.name);
callback();
}, 2);
// assign a callback
q.drain = function() {
console.log('All items have been processed');
};
// create a queue object with concurrency 1
var q = async.priorityQueue(function(task, callback) {
console.log('Hello ' + task.name);
callback();
}, 1);
// assign a callback
q.drain = function() {
console.log('All items have been processed');
};
async.race([
function (callback) {
setTimeout(function () {
callback(null, 'one');
}, 300);
},
function (callback) {
setTimeout(function () {
callback(null, 'two');
}, 100);
{
"cluster": {
"status": "CREATING",
"name": "eks-blog-cluster",
"certificateAuthority": {},
"roleArn": "arn:aws:iam::XXXXXXXXXXXX:role/eks-service-role",
"resourcesVpcConfig": {
"subnetIds": [
"subnet-0b8da2094908e1b23",
"subnet-01a46af43b2c5e16c"
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mongodb
spec:
template:
metadata:
labels:
app: mongodb
spec: