This file contains hidden or 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
aws ecr describe-repositories --region=us-east-1 | jq -r '.[] | .[] | .repositoryName' | while read line; do aws ecr list-images --repository-name=$line --region=us-east-1; echo "------------"; done |
This file contains hidden or 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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: goglides | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
labels: |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Service account created using above manifest file | |
serviceaccount=goglidescustomsa | |
namespace=goglides | |
# Get related Secrets for this Service Account | |
secret=$(kubectl get sa $serviceaccount -n $namespace -o json | jq -r .secrets[].name) | |
# Get ca.crt from secret (using OSX base64 with -D flag for decode) | |
kubectl get secret $secret -n $namespace -o json | jq -r '.data["ca.crt"]' | base64 -D > ca.crt |
This file contains hidden or 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
# Copying kubernetes resources accross namespaces | |
kubectl get rs,secrets -o json --namespace old | jq '.items[].metadata.namespace = "new"' | kubectl create -f - | |
kubectl get cm -o json --namespace old some-config-map | jq '.metadata.namespace = "new"' | kubectl create -f - | |
# kubectl exec in each pods | |
for pod in `kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}'`; do echo $pod date:; kubectl exec -it $pod -- date ; echo "--------------"; done |
This file contains hidden or 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
package de.tdlabs.keycloak.client; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import javax.ws.rs.core.Response; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; |
This file contains hidden or 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
package de.tdlabs.keycloak.client; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.keycloak.OAuth2Constants; | |
import org.keycloak.RSATokenVerifier; | |
import org.keycloak.admin.client.Keycloak; | |
import org.keycloak.admin.client.KeycloakBuilder; | |
import org.keycloak.common.VerificationException; | |
import org.keycloak.jose.jws.JWSHeader; | |
import org.keycloak.representations.AccessToken; |
This file contains hidden or 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
FROM gradle:jdk8 as builder | |
RUN mkdir -p /home/gradle/app | |
WORKDIR /home/gradle/app | |
ADD --chown=gradle:gradle . /home/gradle/app | |
RUN /home/gradle/app/gradlew assemble | |
FROM openjdk:8-jre-alpine | |
COPY --from=builder /home/gradle/app/build/libs/*.war /app.war | |
CMD java -jar /app.war |
This file contains hidden or 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
git checkout master | |
git fetch | |
git pull | |
# Merge the feature branch into the master branch. | |
git merge FEATURE/demo | |
# Reset the master branch to origin's state. | |
git reset origin/master |
This file contains hidden or 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
# Create service and assign cluster-admin role | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: dashboard-admin | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding |
This file contains hidden or 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
podTemplate(label: 'kube-node', yaml: """ | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: docker | |
labels: | |
role: kube-node | |
spec: | |
hostNetwork: true | |
containers: |