Skip to content

Instantly share code, notes, and snippets.

Jonathan Campos jonbcampos

Block or report user

Report or block jonbcampos

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install-spinnaker.sh
# set the account to install spinnaker into
$ACCOUNT=spinnaker-account
# install spinnaker
hal config deploy edit --type distributed --account-name $ACCOUNT
View spinnaker-create-account.sh
# login into GCP
gcloud auth login
# set project id that your cluster belongs to
gcloud config set project <your-gcp-project-id>
# login to kubectl
gcloud auth application-default login
# download kubeconfig to local computer from a cluster by name
gcloud container clusters get-credentials <your-cluster-name> --zone <your-cluster-zone>
# get kubeconfig context
CONTEXT=$(kubectl config current-context)
@jonbcampos
jonbcampos / get-kubeconfig.sh
Created Feb 12, 2019
spinnaker-install-base-service
View get-kubeconfig.sh
# login into GCP
gcloud auth login
# set project id that your cluster belongs to
gcloud config set project <your-gcp-project-id>
# login to kubectl
gcloud auth application-default login
# download kubeconfig to local computer from a cluster by name
gcloud container clusters get-credentials <your-cluster-name> --zone <your-cluster-zone>
# get kubeconfig context
CONTEXT=$(kubectl config current-context)
View medium_configmaps_and_secrets_p2.yaml
...
ports:
- containerPort: 80
volumeMounts:
# volumes to mount
- name: secret-volume # matches secret name
# path for this secret to be available at
mountPath: "/opt/firebase"
readOnly: true # no editing!
volumes:
View medium_configmaps_and_secrets_p1.yaml
env:
- name: NODE_ENV
valueFrom:
configMapKeyRef:
name: basic-config # name of the configmap
key: NODE_ENV # key within the configmap
- name: SOME_VALUE
valueFrom:
configMapKeyRef:
name: basic-config
View kubernetes-series_secrets_k8s_basic-config.yaml
apiVersion: v1
kind: ConfigMap # it is a config map
data: # key value pairs
NODE_ENV: "production"
SOME_VALUE: "my config value"
metadata:
name: basic-config # name to reference
View medium_asynchronous_schematics_p3.ts
function waitingRule(options: any): Rule {
return (host: Tree) => {
const observer = new Observable<Tree>((observer) => {
fetch('someUrl.com/') // any async operation
.then(res => res.json())
.then(data => {
observer.next(host);
observer.complete();
})
.catch(function (err: any) {
View medium_asynchronous_schematics_p2.ts
function myCustomRule(options: any): Rule {
return (host: Tree) => {
return host;
}
}
View medium_asynchronous_schematics_p1.ts
const rule = chain([
rule1,
rule2,
rule3
]);
return rule(host, context);
View medium_integrating_with_other_schematics_p5.json
{
"$schema": "http://json-schema.org/schema",
"id": "SchematicsMaterialInstall",
"title": "Material Install Options Schema",
"type": "object",
"properties": {
"skipPackageJson": {
"type": "boolean",
"default": false,
"description": "Do not add materials dependencies to package.json (e.g., --skipPackageJson)"
You can’t perform that action at this time.