Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod |
Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.
As the name says, its primary function is to be used in the deploy process, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.
#!/bin/bash | |
# Copyright © 2017 Google Inc. | |
# 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 |
Outdated note: the process is a lot easier now: after you brew install postgresql
you can initialize or stop the daemon with these commands: brew services start postgresql
or brew services stop postgresql
.
new out put may look like
To have launchd start postgresql now and restart at login:
brew services start postgresql
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgres start
In your command-line run the following commands:
brew doctor
brew update
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Created by Stephan Hügel on 2017-03-02 | |
The MIT License (MIT) | |
Copyright (c) 2017 Stephan Hügel | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
# Inspired by: https://stackoverflow.com/questions/42170380/how-to-add-users-to-kubernetes-kubectl | |
# this script creates a service account (user1) on a Kubernetes cluster (tested with AWS EKS 1.9) | |
# prereqs: a kubectl ver 1.10 installed and proper configuration of the heptio authenticator | |
# this has been tested on Linux in a Cloud9 environment (for MacOS the syntax may be slightly different) | |
************************************************** | |
******* Create an account ******* | |
************************************************** | |
# Create service account for user user1 | |
kubectl create sa user1 |
#!/bin/bash | |
# Author: Alfredo Hernández <aldomann.designs@gmail.com> | |
#----- MESSAGE FUNCTIONS -----# | |
show_info() { | |
echo -e "\033[1;34m$@\033[0m" | |
} | |
show_success() { | |
echo -e "\033[1;32m$@\033[0m" | |
} |
# Remove unused images | |
docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}") | |
# Remove dangling images | |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
# Ejecutar bash dentro de un servicio docker | |
$ docker-compose exec <service id> bash |