This file contains 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
deploy: | |
image: | |
name: bitnami/kubectl:latest | |
entrypoint: [""] | |
stage: deploy | |
dependencies: [] | |
script: | |
# Update the deployment | |
- kubectl patch deployment my-app -p '{"spec":{"template":{"metadata":{"labels":{"commitRef":"'sha-$CI_COMMIT_SHORT_SHA'"}}}}}' | |
# If you want to wait for the rollout |
This file contains 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
$ KUBECONFIG=/path/to/config.yml kubectl get deployment | |
NAME READY UP-TO-DATE AVAILABLE AGE | |
my-app 1/1 1 1 1s |
This file contains 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 | |
clusters: | |
- cluster: | |
certificate-authority-data: EdAGjzRzleL2JladlfiP2kItNJHPg4aZYvFE0XB9Z7brN60e0rks6eYKO/oEyT5vTDgjtuZfPuAAh7lyJgFaLT8QljoA7RZb9fc0KGXsJcvNlH9075Q6QpMiOjQ2PQN4MZO8Z3729yHhqsgRsaaN//9tU2+TPDk81fYeBF2eeUQ= | |
server: https://my-k8s.example.com:6443 | |
name: default | |
contexts: | |
- context: | |
cluster: default | |
namespace: my-namespace |
This file contains 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
$ echo 'uz8MTKfySDNSDvVo+rYCUQh6qk5UM8/+Efoqk54CMs/0rtBsFyYAotHUTeckqHPF6OXO/WLqiftJXftXAzikYw==' | base64 -d | |
PzjCMXyy34MrTRmUEgFxzwNmVkqTanizdxEWPxupTjKuxgNU |
This file contains 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
$ kubectl get secret gitlab-token-1cdd47 -o yaml | |
apiVersion: v1 | |
data: | |
ca.crt: EdAGjzRzleL2JladlfiP2kItNJHPg4aZYvFE0XB9Z7brN60e0rks6eYKO/oEyT5vTDgjtuZfPuAAh7lyJgFaLT8QljoA7RZb9fc0KGXsJcvNlH9075Q6QpMiOjQ2PQN4MZO8Z3729yHhqsgRsaaN//9tU2+TPDk81fYeBF2eeUQ= | |
... | |
token: uz8MTKfySDNSDvVo+rYCUQh6qk5UM8/+Efoqk54CMs/0rtBsFyYAotHUTeckqHPF6OXO/WLqiftJXftXAzikYw== | |
kind: Secret | |
metadata: | |
name: gitlab-token-1cdd47 | |
type: kubernetes.io/service-account-token |
This file contains 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
$ kubectl get sa gitlab -o yaml | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
... | |
name: gitlab | |
... | |
secrets: | |
- name: gitlab-token-1cdd47 |
This file contains 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: ServiceAccount | |
metadata: | |
name: gitlab | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: Role | |
metadata: | |
name: pod-manager | |
rules: |
This file contains 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: apps/v1 | |
kind: Deployment | |
metadata: | |
labels: | |
app: my-app | |
name: my-app | |
spec: | |
replicas: 1 | |
strategy: | |
type: Recreate |
This file contains 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
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import kotlin.reflect.KClass | |
fun <T : Any> KClass<T>.logger(): Logger { | |
return LoggerFactory.getLogger(this.java) | |
} |
This file contains 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
val LOG = LoggerFactory.getLogger(MyClass::class.java) |
NewerOlder