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: Pod | |
| metadata: | |
| name: mysql-debug | |
| spec: | |
| containers: | |
| - name: mysql-debug | |
| image: mysql:5.7 | |
| command: | |
| - sleep |
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
| require 'pty' | |
| # Initialize master | |
| ruby_block 'kubeadm init' do | |
| block do | |
| command = <<-CMD | |
| kubeadm init \ | |
| --token=#{node['kubeadm']['token']} \ | |
| --pod-network-cidr=#{node['kubeadm']['pod_cidr']} \ | |
| --service-cidr=#{node['kubeadm']['service_cidr']} \ |
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
| execute 'kubeadm init' do | |
| command = <<-CMD | |
| kubeadm init \ | |
| --token=#{node['kubeadm']['token']} \ | |
| --pod-network-cidr=#{node['kubeadm']['pod_cidr']} \ | |
| --service-cidr=#{node['kubeadm']['service_cidr']} \ | |
| --service-dns-domain=#{node['kubeadm']['dns_domain']} \ | |
| --apiserver-advertise-address=#{node['kubeadm']['api_ip_address']} | |
| CMD | |
| action :run |
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
| require 'sidekiq/api' | |
| module Sidekiq | |
| class JobSet < SortedSet | |
| alias :old_delete_by_value :delete_by_value | |
| def delete_by_value(name, value) | |
| parsed = JSON.parse(value) | |
| CommisChannel::BackgroundTasks.broadcast_delete(parsed['jid']) |
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
| let ws = new WebSocket('wss://ws.domain.eu/cable/', ['actioncable-v1-json']); | |
| ws.onopen = () => { console.log('WS Open') }; | |
| ws.onerror = (error) => { console.log('WS ERROR:', error) }; | |
| ws.onclose = () => { console.log('WS CLOSED') }; | |
| ws.onmessage = (message) => { console.log('WS message:', message) }; |
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: PersistentVolumeClaim | |
| metadata: | |
| name: csi-pvc | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 5Gi |
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
| # | |
| # In order to get Kubernetes to be authorised to fetch the Docker images from | |
| # the private gitlab registry, we are creating a docker-registry secret. | |
| # | |
| function create_gitlab_registry_secret() { | |
| echo "Creating the gitlab-registry secret ..." | |
| # Save the JSON to create the gitlab-registry docker-registry secret | |
| GITLAB_REGISTRY_SECRET_JSON=$( | |
| kubectl create secret --namespace=$KUBE_NAMESPACE \ | |
| docker-registry gitlab-registry \ |
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
| echo $FINAL_JSON | \ | |
| kubectl replace --namespace=$KUBERNETES_NAMESPACE \ | |
| --force \ | |
| -f - |
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
| # Updates the GITLAB_REGISTRY_SECRET_JSON with the removed auths key | |
| # and replace the Kubernetes secret | |
| FINAL_JSON=$( | |
| echo $GITLAB_REGISTRY_SECRET_JSON | \ | |
| sed -e s"/\".dockerconfigjson\":\s\"\([a-zA-Z0-9=]\+\)\"/\".dockerconfigjson\":\"$AUTHS\"/" | |
| ) |
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
| # Extracts the auths key from the decoded JSON | |
| AUTHS=$( | |
| echo $GITLAB_REGISTRY_SECRET_JSON | \ | |
| jq '.data[".dockerconfigjson"]' -r | \ | |
| base64 -d | \ | |
| jq '.auths' -c | \ | |
| base64 | \ | |
| tr -d '\n' | |
| ) |
NewerOlder